Commit 43d36acc authored by Jonathan Marten's avatar Jonathan Marten Committed by Stefano Crocco
Browse files

Port and update the Sidebar

No need to link with KDELibs4Support
Use Qt5 signal connection syntax
kDebug(), qDebug() -> qCDebug() with logging category
Use 'override' as identified by GCC 9.3.0
No need for KonqPlacesCustomPlacesView
KInputDialog -> QInputDialog
SmallIcon() -> QIcon::fromTheme()
KMenu -> QMenu
Correct icon names for Bookmarks and History
Correct use of QStandardPaths::locateAll() in ModuleManager::availablePlugins()

Ignoring for the moment subdirectories 'trees' (which needs Qt3Support)
and 'web_module' (which depends on KHTML).
parent 818eb665
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
find_package(KF5 REQUIRED COMPONENTS JobWidgets)
find_package(KF5 REQUIRED COMPONENTS JobWidgets IconThemes)
if (${QT_QT3SUPPORT_FOUND})
add_subdirectory( trees )
......@@ -15,13 +15,15 @@ if(BUILD_TESTING)
add_subdirectory( test )
endif()
ecm_qt_declare_logging_category(sidebar_DEBUG_SRCS HEADER sidebar_debug.h IDENTIFIER SIDEBAR_LOG CATEGORY_NAME org.kde.konqueror.sidebar)
########### konqsidebarplugin lib: contains the base class for plugins ###############
set(konqsidebarplugin_LIB_SRCS konqsidebarplugin.cpp )
add_library(konqsidebarplugin SHARED ${konqsidebarplugin_LIB_SRCS})
add_library(konqsidebarplugin SHARED ${konqsidebarplugin_LIB_SRCS} ${sidebar_DEBUG_SRCS})
target_link_libraries(konqsidebarplugin KF5::Parts KF5::KDELibs4Support KF5::KIOFileWidgets)
target_link_libraries(konqsidebarplugin KF5::Parts KF5::KIOFileWidgets)
set_target_properties(konqsidebarplugin PROPERTIES VERSION ${KONQUEROR_LIB_VERSION} SOVERSION "5" )
install(TARGETS konqsidebarplugin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
......@@ -34,9 +36,9 @@ set(konq_sidebar_PART_SRCS
konqmultitabbar.cpp
)
add_library(konq_sidebar MODULE ${konq_sidebar_PART_SRCS})
add_library(konq_sidebar MODULE ${konq_sidebar_PART_SRCS} ${sidebar_DEBUG_SRCS})
target_link_libraries(konq_sidebar KF5::Parts KF5::Konq konqsidebarplugin KF5::KCMUtils KF5::KDELibs4Support )
target_link_libraries(konq_sidebar KF5::Parts KF5::Konq konqsidebarplugin KF5::KCMUtils KF5::IconThemes)
install(TARGETS konq_sidebar DESTINATION ${KDE_INSTALL_PLUGINDIR} )
......
......@@ -122,7 +122,7 @@ public:
Q_UNUSED(unused);
QAction *action = new QAction(parent);
action->setText(i18nc("@action:inmenu Add", "Bookmarks Sidebar Module"));
action->setIcon(QIcon::fromTheme("bookmark"));
action->setIcon(QIcon::fromTheme("bookmarks"));
return QList<QAction *>() << action;
}
......@@ -143,7 +143,7 @@ public:
Q_UNUSED(parentWidget);
Q_UNUSED(unused);
configGroup.writeEntry("Type", "Link");
configGroup.writeEntry("Icon", "bookmark");
configGroup.writeEntry("Icon", "bookmarks");
configGroup.writeEntry("Name", i18nc("@title:tab", "Bookmarks"));
configGroup.writeEntry("X-KDE-KonqSidebarModule", "konqsidebar_bookmarks");
return true;
......
[Desktop Entry]
Type=Link
URL=bookmarks:
Icon=bookmark
Icon=bookmarks
Open=true
#X-KDE-TreeModule=Bookmarks
X-KDE-TreeModule=Virtual
......
[Desktop Entry]
Type=Link
Icon=history
# Icon=view-history
Icon=view-history
Open=false
X-KDE-KonqSidebarModule=konqsidebar_history
X-KDE-Weight=2
......
......@@ -19,14 +19,13 @@
*/
#include "history_module.h"
#include <kdebug.h>
#include <konqhistoryview.h>
#include <QAction>
#include <QApplication>
#include <QTreeView>
#include <QIcon>
#include <KLocalizedString>
#include <kpluginfactory.h>
......@@ -35,11 +34,11 @@ KonqSidebarHistoryModule::KonqSidebarHistoryModule(QWidget *parent,
: KonqSidebarModule(parent, configGroup)
{
m_historyView = new KonqHistoryView(parent);
connect(m_historyView->treeView(), SIGNAL(activated(QModelIndex)), this, SLOT(slotActivated(QModelIndex)));
connect(m_historyView->treeView(), SIGNAL(pressed(QModelIndex)), this, SLOT(slotPressed(QModelIndex)));
connect(m_historyView->treeView(), SIGNAL(clicked(QModelIndex)), this, SLOT(slotClicked(QModelIndex)));
connect(m_historyView, SIGNAL(openUrlInNewWindow(QUrl)), this, SLOT(slotOpenWindow(QUrl)));
connect(m_historyView, SIGNAL(openUrlInNewTab(QUrl)), this, SLOT(slotOpenTab(QUrl)));
connect(m_historyView->treeView(), &QAbstractItemView::activated, this, &KonqSidebarHistoryModule::slotActivated);
connect(m_historyView->treeView(), &QAbstractItemView::pressed, this, &KonqSidebarHistoryModule::slotPressed);
connect(m_historyView->treeView(), &QAbstractItemView::clicked, this, &KonqSidebarHistoryModule::slotClicked);
connect(m_historyView, &KonqHistoryView::openUrlInNewWindow, this, &KonqSidebarHistoryModule::slotOpenWindow);
connect(m_historyView, &KonqHistoryView::openUrlInNewTab, this, &KonqSidebarHistoryModule::slotOpenTab);
}
KonqSidebarHistoryModule::~KonqSidebarHistoryModule()
......@@ -109,7 +108,7 @@ public:
virtual KonqSidebarModule *createModule(QWidget *parent,
const KConfigGroup &configGroup,
const QString &desktopname,
const QVariant &unused)
const QVariant &unused) override
{
Q_UNUSED(unused);
Q_UNUSED(desktopname);
......@@ -118,7 +117,7 @@ public:
virtual QList<QAction *> addNewActions(QObject *parent,
const QList<KConfigGroup> &existingModules,
const QVariant &unused)
const QVariant &unused) override
{
Q_UNUSED(unused);
Q_UNUSED(existingModules);
......@@ -129,7 +128,7 @@ public:
}
virtual QString templateNameForNewModule(const QVariant &actionData,
const QVariant &unused) const
const QVariant &unused) const override
{
Q_UNUSED(actionData);
Q_UNUSED(unused);
......@@ -138,7 +137,7 @@ public:
virtual bool createNewModule(const QVariant &actionData, KConfigGroup &configGroup,
QWidget *parentWidget,
const QVariant &unused)
const QVariant &unused) override
{
Q_UNUSED(parentWidget);
Q_UNUSED(actionData);
......@@ -153,6 +152,5 @@ public:
};
K_PLUGIN_FACTORY(KonqSidebarHistoryPluginFactory, registerPlugin<KonqSidebarHistoryPlugin>();)
// K_EXPORT_PLUGIN(KonqSidebarHistoryPluginFactory())
#include "history_module.moc"
......@@ -32,7 +32,7 @@ class KonqSidebarHistoryModule : public KonqSidebarModule
public:
KonqSidebarHistoryModule(QWidget *parent, const KConfigGroup &configGroup);
virtual ~KonqSidebarHistoryModule();
virtual QWidget *getWidget();
virtual QWidget *getWidget() override;
private Q_SLOTS:
void slotActivated(const QModelIndex &index);
......
......@@ -36,7 +36,6 @@
#include <KLocalizedString>
#include <kmessagebox.h>
#include <KPluginFactory>
#include <KPluginLoader>
#include <konq_historyprovider.h>
#include <konqhistorysettings.h>
......@@ -51,9 +50,6 @@ K_EXPORT_PLUGIN(KCMHistoryFactory("kcmhistory"))
HistorySidebarConfig::HistorySidebarConfig(QWidget *parent, const QVariantList &)
: KCModule(parent, QVariantList())
{
//KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
//KLocale::global()->insertCatalog("konqueror");
m_settings = KonqHistorySettings::self();
if (!KParts::HistoryProvider::exists()) {
......@@ -80,33 +76,21 @@ HistorySidebarConfig::HistorySidebarConfig(QWidget *parent, const QVariantList &
dialog->comboOlder->insertItem(KonqHistorySettings::DAYS,
i18np("Day", "Days", 0));
connect(dialog->cbExpire, SIGNAL(toggled(bool)),
dialog->spinExpire, SLOT(setEnabled(bool)));
connect(dialog->spinExpire, SIGNAL(valueChanged(int)),
this, SLOT(slotExpireChanged()));
connect(dialog->spinNewer, SIGNAL(valueChanged(int)),
SLOT(slotNewerChanged(int)));
connect(dialog->spinOlder, SIGNAL(valueChanged(int)),
SLOT(slotOlderChanged(int)));
connect(dialog->btnFontNewer, SIGNAL(clicked()),
SLOT(slotGetFontNewer()));
connect(dialog->btnFontOlder, SIGNAL(clicked()),
SLOT(slotGetFontOlder()));
connect(dialog->btnClearHistory, SIGNAL(clicked()),
SLOT(slotClearHistory()));
connect(dialog->cbDetailedTips, SIGNAL(toggled(bool)),
SLOT(configChanged()));
connect(dialog->cbExpire, SIGNAL(toggled(bool)),
SLOT(configChanged()));
connect(dialog->spinEntries, SIGNAL(valueChanged(int)),
SLOT(configChanged()));
connect(dialog->comboNewer, SIGNAL(currentIndexChanged(int)),
SLOT(configChanged()));
connect(dialog->comboOlder, SIGNAL(currentIndexChanged(int)),
SLOT(configChanged()));
connect(dialog->cbExpire, &QAbstractButton::toggled, dialog->spinExpire, &QWidget::setEnabled);
connect(dialog->spinExpire, QOverload<int>::of(&QSpinBox::valueChanged), this, &HistorySidebarConfig::slotExpireChanged);
connect(dialog->spinNewer, QOverload<int>::of(&QSpinBox::valueChanged), this, &HistorySidebarConfig::slotNewerChanged);
connect(dialog->spinOlder, QOverload<int>::of(&QSpinBox::valueChanged), this, &HistorySidebarConfig::slotOlderChanged);
connect(dialog->btnFontNewer, &QAbstractButton::clicked, this, &HistorySidebarConfig::slotGetFontNewer);
connect(dialog->btnFontOlder, &QAbstractButton::clicked, this, &HistorySidebarConfig::slotGetFontOlder);
connect(dialog->btnClearHistory, &QAbstractButton::clicked, this, &HistorySidebarConfig::slotClearHistory);
connect(dialog->cbDetailedTips, &QAbstractButton::toggled, this, &HistorySidebarConfig::configChanged);
connect(dialog->cbExpire, &QAbstractButton::toggled, this, &HistorySidebarConfig::configChanged);
connect(dialog->spinEntries, QOverload<int>::of(&QSpinBox::valueChanged), this, &HistorySidebarConfig::configChanged);
connect(dialog->comboNewer, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &HistorySidebarConfig::configChanged);
connect(dialog->comboOlder, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &HistorySidebarConfig::configChanged);
dialog->show();
topLayout->addWidget(dialog);
......
......@@ -44,11 +44,11 @@ class HistorySidebarConfig : public KCModule
public:
explicit HistorySidebarConfig(QWidget *parent = nullptr, const QVariantList &list = QVariantList());
void load();
void save();
void defaults();
void load() override;
void save() override;
void defaults() override;
QString quickHelp() const;
QString quickHelp() const override;
private Q_SLOTS:
void configChanged();
......
......@@ -35,9 +35,9 @@ Q_SIGNALS:
void urlsDropped(const QList<QUrl> &urls);
protected:
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dragMoveEvent(QDragMoveEvent *event);
virtual void dropEvent(QDropEvent *event);
virtual void dragEnterEvent(QDragEnterEvent *event) override;
virtual void dragMoveEvent(QDragMoveEvent *event) override;
virtual void dropEvent(QDropEvent *event) override;
};
#endif /* KONQMULTITABBAR_H */
......
......@@ -18,7 +18,6 @@
*/
#include "konqsidebarplugin.h"
#include <kdebug.h>
class KonqSidebarModulePrivate
{
......
......@@ -28,7 +28,6 @@
#include <kparts/browserextension.h>
#include <kio/job.h>
#include <kfileitem.h>
#include <kcomponentdata.h>
#ifndef KONQSIDEBARPLUGIN_EXPORT
# if defined(MAKE_KONQSIDEBARPLUGIN_LIB)
......
......@@ -23,14 +23,13 @@
#include <kio/deletejob.h>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kdebug.h>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <QDir>
#include <QUrl>
#include <QStandardPaths>
#include <KSharedConfig>
#include "sidebar_debug.h"
// Input data:
// Global dir: list of desktop files.
// Local dir: list of desktop files, for modules added or modified
......@@ -60,21 +59,21 @@ QStringList ModuleManager::modules() const
const QStringList entries_dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, relativeDataPath(), QStandardPaths::LocateDirectory);
if (entries_dirs.isEmpty()) { // Ooops
qWarning() << "No global directory found for" << relativeDataPath() << "Installation problem!";
qCWarning(SIDEBAR_LOG) << "No global directory found for" << relativeDataPath() << "Installation problem!";
return QStringList();
}
// We only list the most-global dir. Other levels use AddedModules.
QDir globalDir(entries_dirs.last());
//kDebug() << "Listing" << entries_dirs.last();
//qCDebug(SIDEBAR_LOG) << "Listing" << entries_dirs.last();
const QStringList globalDirEntries = globalDir.entryList(QDir::Files | QDir::NoDotAndDotDot);
Q_FOREACH (const QString &globalEntry, globalDirEntries) {
//kDebug() << " found" << globalEntry;
//qCDebug(SIDEBAR_LOG) << " found" << globalEntry;
if (!deletedModules.contains(globalEntry)) {
fileNames.append(globalEntry);
}
}
sortGlobalEntries(fileNames);
//kDebug() << "Adding local modules:" << addedModules;
//qCDebug(SIDEBAR_LOG) << "Adding local modules:" << addedModules;
Q_FOREACH (const QString &module, addedModules) {
if (!fileNames.contains(module)) {
fileNames.append(module);
......@@ -88,11 +87,17 @@ KService::List ModuleManager::availablePlugins() const
{
// For the "add" menu, we need all available plugins.
// We could use KServiceTypeTrader for that; not sure 2 files make a big performance difference though.
const QStringList files = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "konqsidebartng/plugins/*.desktop");
KService::List services;
Q_FOREACH (const QString &path, files) {
KDesktopFile df(path); // no merging. KService warns, and we don't need it.
services.append(KService::Ptr(new KService(&df)));
const QStringList pluginDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "konqsidebartng/plugins", QStandardPaths::LocateDirectory);
for (const QString &pluginDir : pluginDirs) {
QDir dir(pluginDir);
QStringList files = dir.entryList((QStringList() << "*.desktop"), QDir::Files);
for (const QString &file : files) {
KDesktopFile df(dir.absoluteFilePath(file)); // no merging. KService warns, and we don't need it.
services.append(KService::Ptr(new KService(&df)));
}
}
return services;
}
......@@ -114,7 +119,7 @@ void ModuleManager::rollbackToDefault()
const QStringList dirEntries = dir.entryList(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot);
Q_FOREACH (const QString &subdir, dirEntries) {
if (subdir != "add") {
kDebug() << "Deleting" << (loc + subdir);
qCDebug(SIDEBAR_LOG) << "Deleting" << (loc + subdir);
KIO::Job *job = KIO::del(QUrl::fromLocalFile(loc + subdir), KIO::HideProgressInfo);
job->exec();
}
......@@ -168,7 +173,7 @@ void ModuleManager::removeModule(const QString &fileName)
void ModuleManager::moduleAdded(const QString &fileName)
{
kDebug() << fileName;
qCDebug(SIDEBAR_LOG) << fileName;
QStringList deletedModules = m_config->readEntry("DeletedModules", QStringList());
QStringList addedModules = m_config->readEntry("AddedModules", QStringList());
if (!addedModules.contains(fileName)) {
......@@ -182,7 +187,7 @@ void ModuleManager::moduleAdded(const QString &fileName)
QString ModuleManager::addModuleFromTemplate(QString &templ)
{
if (!templ.contains("%1")) {
kWarning() << "Template filename should contain %1";
qCWarning(SIDEBAR_LOG) << "Template filename should contain %1";
}
QString filename = templ.arg(QString());
......@@ -216,7 +221,7 @@ void ModuleManager::sortGlobalEntries(QStringList &fileNames) const
const QString path = moduleDataPath(fileName);
if (QStandardPaths::locate(QStandardPaths::GenericDataLocation, path).isEmpty()) {
// doesn't exist anymore, skip it
kDebug() << "Skipping" << path;
qCDebug(SIDEBAR_LOG) << "Skipping" << path;
} else {
KSharedConfig::Ptr config = KSharedConfig::openConfig(path,
KConfig::NoGlobals,
......@@ -230,10 +235,10 @@ void ModuleManager::sortGlobalEntries(QStringList &fileNames) const
// Old local file still there; remove it
const QString localFile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + path;
QFile::rename(localFile, localFile + ".orig");
kDebug() << "Migration: moving" << localFile << "out of the way";
qCDebug(SIDEBAR_LOG) << "Migration: moving" << localFile << "out of the way";
}
}
}
fileNames = sorter.values();
kDebug() << fileNames;
qCDebug(SIDEBAR_LOG) << fileNames;
}
......@@ -20,52 +20,20 @@
#include "places_module.h"
#include <kfileplacesmodel.h>
#include <QIcon>
#include <KLocalizedString>
#include <kpluginfactory.h>
#include <QAction>
#include <QKeyEvent>
// #include <QAbstractScrollArea>
KonqPlacesCustomPlacesView::KonqPlacesCustomPlacesView(QWidget *parent)
: KFilePlacesView(parent)
, m_mouseButtons(Qt::NoButton)
, m_keyModifiers(Qt::NoModifier)
{
connect(this, SIGNAL(urlChanged(QUrl)),
this, SLOT(emitUrlChanged(QUrl)));
}
KonqPlacesCustomPlacesView::~KonqPlacesCustomPlacesView()
{
}
void KonqPlacesCustomPlacesView::keyPressEvent(QKeyEvent *event)
{
m_keyModifiers = event->modifiers();
KFilePlacesView::keyPressEvent(event);
}
#include <QGuiApplication>
void KonqPlacesCustomPlacesView::mousePressEvent(QMouseEvent *event)
{
m_mouseButtons = event->buttons();
KFilePlacesView::mousePressEvent(event);
}
#include <kfileplacesmodel.h>
#include <KLocalizedString>
#include <kpluginfactory.h>
void KonqPlacesCustomPlacesView::emitUrlChanged(const QUrl &url)
{
emit urlChanged(url, m_mouseButtons, m_keyModifiers);
}
KonqSideBarPlacesModule::KonqSideBarPlacesModule(QWidget *parent,
const KConfigGroup &configGroup)
: KonqSidebarModule(parent, configGroup)
{
m_placesView = new KonqPlacesCustomPlacesView(parent);
m_placesView = new KFilePlacesView(parent);
m_placesView->setModel(new KFilePlacesModel(m_placesView));
m_placesView->setShowAll(true);
m_placesView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
......@@ -75,12 +43,7 @@ KonqSideBarPlacesModule::KonqSideBarPlacesModule(QWidget *parent,
// m_placesView->setIconSize(QSize(16,16));
m_placesView->style()->pixelMetric(QStyle::PM_SmallIconSize); // this would best be done by detecting the size of icons for other widgets
connect(m_placesView, SIGNAL(urlChanged(QUrl,Qt::MouseButtons,Qt::KeyboardModifiers)),
this, SLOT(slotPlaceUrlChanged(QUrl,Qt::MouseButtons,Qt::KeyboardModifiers)));
}
KonqSideBarPlacesModule::~KonqSideBarPlacesModule()
{
connect(m_placesView, &KFilePlacesView::urlChanged, this, &KonqSideBarPlacesModule::slotPlaceUrlChanged);
}
QWidget *KonqSideBarPlacesModule::getWidget()
......@@ -88,8 +51,11 @@ QWidget *KonqSideBarPlacesModule::getWidget()
return m_placesView;
}
void KonqSideBarPlacesModule::slotPlaceUrlChanged(const QUrl &url, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
void KonqSideBarPlacesModule::slotPlaceUrlChanged(const QUrl &url)
{
const Qt::MouseButtons buttons = QGuiApplication::mouseButtons();
const Qt::KeyboardModifiers modifiers = QGuiApplication::keyboardModifiers();
if ((buttons & Qt::MidButton) != 0 || (modifiers & Qt::ControlModifier) != 0) {
emit createNewWindow(url);
} else {
......@@ -107,7 +73,7 @@ public:
virtual KonqSidebarModule *createModule(QWidget *parent,
const KConfigGroup &configGroup,
const QString &desktopname,
const QVariant &unused)
const QVariant &unused) override
{
Q_UNUSED(desktopname);
Q_UNUSED(unused);
......@@ -116,7 +82,7 @@ public:
virtual QList<QAction *> addNewActions(QObject *parent,
const QList<KConfigGroup> &existingModules,
const QVariant &unused)
const QVariant &unused) override
{
Q_UNUSED(existingModules);
Q_UNUSED(unused);
......@@ -127,7 +93,7 @@ public:
}
virtual QString templateNameForNewModule(const QVariant &actionData,
const QVariant &unused) const
const QVariant &unused) const override
{
Q_UNUSED(actionData);
Q_UNUSED(unused);
......@@ -137,7 +103,7 @@ public:
virtual bool createNewModule(const QVariant &actionData,
KConfigGroup &configGroup,
QWidget *parentWidget,
const QVariant &unused)
const QVariant &unused) override
{
Q_UNUSED(actionData);
Q_UNUSED(parentWidget);
......@@ -151,6 +117,5 @@ public:
};
K_PLUGIN_FACTORY(KonqSidebarPlacesPluginFactory, registerPlugin<KonqSidebarPlacesPlugin>();)
// K_EXPORT_PLUGIN(KonqSidebarPlacesPluginFactory())
#include "places_module.moc"
......@@ -25,30 +25,6 @@
#include <kfileplacesview.h>
// A custom file places view to know which mouse buttons and keyboard modifiers
// were pressed when activating an URL.
class KonqPlacesCustomPlacesView : public KFilePlacesView
{
Q_OBJECT
public:
explicit KonqPlacesCustomPlacesView(QWidget *parent = nullptr);
virtual ~KonqPlacesCustomPlacesView();
signals:
void urlChanged(const QUrl &url, Qt::MouseButtons buttons, Qt::KeyboardModifiers);
protected:
virtual void keyPressEvent(QKeyEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
private slots:
void emitUrlChanged(const QUrl &url);
private:
Qt::MouseButtons m_mouseButtons;
Qt::KeyboardModifiers m_keyModifiers;
};
class KonqSideBarPlacesModule : public KonqSidebarModule
{
......@@ -57,12 +33,12 @@ class KonqSideBarPlacesModule : public KonqSidebarModule
public:
KonqSideBarPlacesModule(QWidget *parent,
const KConfigGroup &configGroup);
virtual ~KonqSideBarPlacesModule();
virtual ~KonqSideBarPlacesModule() = default;
virtual QWidget *getWidget();
virtual QWidget *getWidget() override;
private slots:
void slotPlaceUrlChanged(const QUrl &url, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
void slotPlaceUrlChanged(const QUrl &url);
private:
KFilePlacesView *m_placesView;
......
......@@ -17,10 +17,10 @@
#include "sidebar_part.h"
#include <kaboutdata.h>
#include <QApplication>
#include <kparts/part.h>
#include <konq_events.h>
#include <kdebug.h>
#include <QApplication>
#include <kacceleratormanager.h>
#include <KLocalizedString>
......@@ -43,12 +43,9 @@ KonqSidebarPart::KonqSidebarPart(QWidget *parentWidget, QObject *parent, const Q
}
m_widget = new Sidebar_Widget(parentWidget, this, currentProfile);
m_extension = new KonqSidebarBrowserExtension(this, m_widget);
connect(m_widget, SIGNAL(started(KIO::Job*)),
this, SIGNAL(started(KIO::Job*)));
connect(m_widget, SIGNAL(completed()),
this, SIGNAL(completed()));
connect(m_extension, SIGNAL(addWebSideBar(QUrl,QString)),
m_widget, SLOT(addWebSideBar(QUrl,QString)));
connect(m_widget, &Sidebar_Widget::started, this, &KParts::ReadOnlyPart::started);
connect(m_widget, &Sidebar_Widget::completed, this, QOverload<>::of(&KParts::ReadOnlyPart::completed));
connect(m_extension, &KonqSidebarBrowserExtension::addWebSideBar, m_widget, &Sidebar_Widget::addWebSideBar);
KAcceleratorManager::setNoAccel(m_widget);
setWidget(m_widget);
}
......
......@@ -85,16 +85,16 @@ public:
*/
virtual ~KonqSidebarPart();
virtual bool openUrl(const QUrl &url);
virtual bool openUrl(const QUrl &url) override;
protected:
/**
* This must be implemented by each part
*/
KonqSidebarBrowserExtension *m_extension;