X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/fda88516e9c32ed93cb4fe47a3a9a9bf2aecc456..1d590aa7d50bcf955e3356a09dcaa88e1989aa3a:/src/settings/services/servicessettingspage.cpp diff --git a/src/settings/services/servicessettingspage.cpp b/src/settings/services/servicessettingspage.cpp index 9adca9baf..be43ae656 100644 --- a/src/settings/services/servicessettingspage.cpp +++ b/src/settings/services/servicessettingspage.cpp @@ -22,15 +22,14 @@ #include "dolphin_generalsettings.h" #include "dolphin_versioncontrolsettings.h" -#include #include #include #include #include -#include +#include #include #include -#include +#include #include #include #include @@ -50,9 +49,9 @@ namespace { const bool ShowDeleteDefault = false; - const char* VersionControlServicePrefix = "_version_control_"; - const char* DeleteService = "_delete"; - const char* CopyToMoveToService ="_copy_to_move_to"; + const char VersionControlServicePrefix[] = "_version_control_"; + const char DeleteService[] = "_delete"; + const char CopyToMoveToService[] ="_copy_to_move_to"; } ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) : @@ -79,12 +78,12 @@ ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) : m_listView->setModel(m_sortModel); m_listView->setItemDelegate(delegate); m_listView->setVerticalScrollMode(QListView::ScrollPerPixel); - connect(m_listView, SIGNAL(clicked(QModelIndex)), this, SIGNAL(changed())); + connect(m_listView, &QListView::clicked, this, &ServicesSettingsPage::changed); KNS3::Button* downloadButton = new KNS3::Button(i18nc("@action:button", "Download New Services..."), "servicemenu.knsrc", this); - connect(downloadButton, SIGNAL(dialogFinished(KNS3::Entry::List)), this, SLOT(loadServices())); + connect(downloadButton, &KNS3::Button::dialogFinished, this, &ServicesSettingsPage::loadServices); topLayout->addWidget(label); topLayout->addWidget(m_listView); @@ -195,7 +194,7 @@ void ServicesSettingsPage::loadServices() // Load generic services const KService::List entries = KServiceTypeTrader::self()->query("KonqPopupMenu/Plugin"); - foreach (const KSharedPtr& service, entries) { + foreach (const KService::Ptr& service, entries) { const QString file = KStandardDirs::locate("services", service->entryPath()); const QList serviceActions = KDesktopFileActions::userDefinedServices(file, true); @@ -221,18 +220,10 @@ void ServicesSettingsPage::loadServices() // Load service plugins that implement the KFileItemActionPlugin interface const KService::List pluginServices = KServiceTypeTrader::self()->query("KFileItemAction/Plugin"); - foreach (const KSharedPtr& service, pluginServices) { + foreach (const KService::Ptr& service, pluginServices) { const QString desktopEntryName = service->desktopEntryName(); if (!isInServicesList(desktopEntryName)) { - bool checked; - - KAbstractFileItemActionPlugin* abstractPlugin = service->createInstance(); - if (abstractPlugin) { - checked = showGroup.readEntry(desktopEntryName, abstractPlugin->enabledByDefault()); - } else { - checked = showGroup.readEntry(desktopEntryName, true); - } - + const bool checked = showGroup.readEntry(desktopEntryName, true); addRow(service->icon(), service->name(), desktopEntryName, checked); } } @@ -282,4 +273,3 @@ void ServicesSettingsPage::addRow(const QString& icon, m_serviceModel->setData(index, checked, Qt::CheckStateRole); } -#include "servicessettingspage.moc"