diff options
Diffstat (limited to 'src/settings')
25 files changed, 151 insertions, 153 deletions
diff --git a/src/settings/additionalinfodialog.cpp b/src/settings/additionalinfodialog.cpp index 0de639540..db9258ae8 100644 --- a/src/settings/additionalinfodialog.cpp +++ b/src/settings/additionalinfodialog.cpp @@ -81,7 +81,7 @@ AdditionalInfoDialog::AdditionalInfoDialog(QWidget* parent, const KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"), "AdditionalInfoDialog"); restoreDialogSize(dialogConfig); - connect(this, SIGNAL(okClicked()), this, SLOT(slotOk())); + connect(this, &AdditionalInfoDialog::okClicked, this, &AdditionalInfoDialog::slotOk); } AdditionalInfoDialog::~AdditionalInfoDialog() diff --git a/src/settings/applyviewpropsjob.cpp b/src/settings/applyviewpropsjob.cpp index 4bc77caee..9849216d2 100644 --- a/src/settings/applyviewpropsjob.cpp +++ b/src/settings/applyviewpropsjob.cpp @@ -38,8 +38,8 @@ ApplyViewPropsJob::ApplyViewPropsJob(const KUrl& dir, m_viewProps->setSortOrder(viewProps.sortOrder()); KIO::ListJob* listJob = KIO::listRecursive(dir, KIO::HideProgressInfo); - connect(listJob, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), - SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList))); + connect(listJob, &KIO::ListJob::entries, + this, &ApplyViewPropsJob::slotEntries); addSubjob(listJob); } diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp index 609e2ab92..f248335e9 100644 --- a/src/settings/dolphinsettingsdialog.cpp +++ b/src/settings/dolphinsettingsdialog.cpp @@ -34,6 +34,9 @@ #include <KMessageBox> #include <KIcon> +#include <QPushButton> +#include <QDialogButtonBox> + DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) : KPageDialog(parent), m_pages() @@ -43,55 +46,62 @@ DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) : setMinimumSize(QSize(512, minSize.height())); setFaceType(List); - setCaption(i18nc("@title:window", "Dolphin Preferences")); - setButtons(Ok | Apply | Cancel | Default); - enableButtonApply(false); - setDefaultButton(Ok); + setWindowTitle(i18nc("@title:window", "Dolphin Preferences")); + QDialogButtonBox* box = new QDialogButtonBox(QDialogButtonBox::Ok + | QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults); + box->button(QDialogButtonBox::Apply)->setEnabled(false); + box->button(QDialogButtonBox::Ok)->setDefault(true); + setButtonBox(box); + + connect(box->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings); + connect(box->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings); + connect(box->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, this, &DolphinSettingsDialog::restoreDefaults); // Startup StartupSettingsPage* startupSettingsPage = new StartupSettingsPage(url, this); KPageWidgetItem* startupSettingsFrame = addPage(startupSettingsPage, i18nc("@title:group", "Startup")); startupSettingsFrame->setIcon(KIcon("go-home")); - connect(startupSettingsPage, SIGNAL(changed()), this, SLOT(enableApply())); + connect(startupSettingsPage, &StartupSettingsPage::changed, this, &DolphinSettingsDialog::enableApply); // View Modes ViewSettingsPage* viewSettingsPage = new ViewSettingsPage(this); KPageWidgetItem* viewSettingsFrame = addPage(viewSettingsPage, i18nc("@title:group", "View Modes")); viewSettingsFrame->setIcon(KIcon("view-choose")); - connect(viewSettingsPage, SIGNAL(changed()), this, SLOT(enableApply())); + connect(viewSettingsPage, &ViewSettingsPage::changed, this, &DolphinSettingsDialog::enableApply); // Navigation NavigationSettingsPage* navigationSettingsPage = new NavigationSettingsPage(this); KPageWidgetItem* navigationSettingsFrame = addPage(navigationSettingsPage, i18nc("@title:group", "Navigation")); navigationSettingsFrame->setIcon(KIcon("input-mouse")); - connect(navigationSettingsPage, SIGNAL(changed()), this, SLOT(enableApply())); + connect(navigationSettingsPage, &NavigationSettingsPage::changed, this, &DolphinSettingsDialog::enableApply); // Services ServicesSettingsPage* servicesSettingsPage = new ServicesSettingsPage(this); KPageWidgetItem* servicesSettingsFrame = addPage(servicesSettingsPage, i18nc("@title:group", "Services")); servicesSettingsFrame->setIcon(KIcon("services")); - connect(servicesSettingsPage, SIGNAL(changed()), this, SLOT(enableApply())); + connect(servicesSettingsPage, &ServicesSettingsPage::changed, this, &DolphinSettingsDialog::enableApply); // Trash TrashSettingsPage* trashSettingsPage = new TrashSettingsPage(this); KPageWidgetItem* trashSettingsFrame = addPage(trashSettingsPage, i18nc("@title:group", "Trash")); trashSettingsFrame->setIcon(KIcon("user-trash")); - connect(trashSettingsPage, SIGNAL(changed()), this, SLOT(enableApply())); + connect(trashSettingsPage, &TrashSettingsPage::changed, this, &DolphinSettingsDialog::enableApply); // General GeneralSettingsPage* generalSettingsPage = new GeneralSettingsPage(url, this); KPageWidgetItem* generalSettingsFrame = addPage(generalSettingsPage, i18nc("@title:group General settings", "General")); generalSettingsFrame->setIcon(KIcon("system-run")); - connect(generalSettingsPage, SIGNAL(changed()), this, SLOT(enableApply())); + connect(generalSettingsPage, &GeneralSettingsPage::changed, this, &DolphinSettingsDialog::enableApply); const KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"), "SettingsDialog"); - restoreDialogSize(dialogConfig); +#pragma message("TODO: port") + //restoreDialogSize(dialogConfig); m_pages.append(startupSettingsPage); m_pages.append(viewSettingsPage); @@ -104,23 +114,13 @@ DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) : DolphinSettingsDialog::~DolphinSettingsDialog() { KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"), "SettingsDialog"); - saveDialogSize(dialogConfig); -} - -void DolphinSettingsDialog::slotButtonClicked(int button) -{ - if ((button == Ok) || (button == Apply)) { - applySettings(); - } else if (button == Default) { - restoreDefaults(); - } - - KPageDialog::slotButtonClicked(button); +#pragma message("TODO: port") + //saveDialogSize(dialogConfig); } void DolphinSettingsDialog::enableApply() { - enableButtonApply(true); + buttonBox()->button(QDialogButtonBox::Apply)->setEnabled(true); } void DolphinSettingsDialog::applySettings() @@ -138,8 +138,7 @@ void DolphinSettingsDialog::applySettings() settings->setModifiedStartupSettings(false); settings->writeConfig(); } - - enableButtonApply(false); + buttonBox()->button(QDialogButtonBox::Apply)->setEnabled(false); } void DolphinSettingsDialog::restoreDefaults() diff --git a/src/settings/dolphinsettingsdialog.h b/src/settings/dolphinsettingsdialog.h index 2de195017..56d924c7d 100644 --- a/src/settings/dolphinsettingsdialog.h +++ b/src/settings/dolphinsettingsdialog.h @@ -42,15 +42,9 @@ public: signals: void settingsChanged(); -protected slots: - /** @see KDialog::slotButtonClicked() */ - virtual void slotButtonClicked(int button); - private slots: /** Enables the Apply button. */ void enableApply(); - -private: void applySettings(); void restoreDefaults(); diff --git a/src/settings/general/behaviorsettingspage.cpp b/src/settings/general/behaviorsettingspage.cpp index cbbde1d7c..7633b824f 100644 --- a/src/settings/general/behaviorsettingspage.cpp +++ b/src/settings/general/behaviorsettingspage.cpp @@ -79,12 +79,12 @@ BehaviorSettingsPage::BehaviorSettingsPage(const KUrl& url, QWidget* parent) : loadSettings(); - connect(m_localViewProps, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(m_globalViewProps, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(m_showToolTips, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(m_showSelectionToggle, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(m_naturalSorting, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(m_renameInline, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); + connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); + connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); + connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); + connect(m_naturalSorting, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); + connect(m_renameInline, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); } BehaviorSettingsPage::~BehaviorSettingsPage() @@ -115,7 +115,7 @@ void BehaviorSettingsPage::applySettings() const bool naturalSorting = m_naturalSorting->isChecked(); if (KGlobalSettings::naturalSorting() != naturalSorting) { - KConfigGroup group(KGlobal::config(), "KDE"); + KConfigGroup group(KSharedConfig::openConfig(), "KDE"); group.writeEntry("NaturalSorting", naturalSorting, KConfig::Persistent | KConfig::Global); KGlobalSettings::emitChange(KGlobalSettings::NaturalSortingChanged); } diff --git a/src/settings/general/configurepreviewplugindialog.cpp b/src/settings/general/configurepreviewplugindialog.cpp index 3ca08dfd0..090b415e0 100644 --- a/src/settings/general/configurepreviewplugindialog.cpp +++ b/src/settings/general/configurepreviewplugindialog.cpp @@ -27,6 +27,7 @@ #include <QApplication> #include <QDir> #include <QVBoxLayout> +#include <QUrl> ConfigurePreviewPluginDialog::ConfigurePreviewPluginDialog(const QString& pluginName, const QString& desktopEntryName, @@ -59,7 +60,7 @@ ConfigurePreviewPluginDialog::ConfigurePreviewPluginDialog(const QString& plugin setMainWidget(mainWidget); - connect(this, SIGNAL(okClicked()), this, SLOT(slotOk())); + connect(this, &ConfigurePreviewPluginDialog::okClicked, this, &ConfigurePreviewPluginDialog::slotOk); } ConfigurePreviewPluginDialog::~ConfigurePreviewPluginDialog() @@ -73,7 +74,7 @@ void ConfigurePreviewPluginDialog::slotOk() // for a specific MIME-type should be regenerated. As this is not available yet we // delete the whole thumbnails directory. QApplication::changeOverrideCursor(Qt::BusyCursor); - KIO::NetAccess::del(QString(QDir::homePath() + "/.thumbnails/"), this); + KIO::NetAccess::del(QUrl::fromLocalFile(QDir::homePath() + "/.thumbnails/"), this); QApplication::restoreOverrideCursor(); } diff --git a/src/settings/general/confirmationssettingspage.cpp b/src/settings/general/confirmationssettingspage.cpp index ab23a1908..c74efedc2 100644 --- a/src/settings/general/confirmationssettingspage.cpp +++ b/src/settings/general/confirmationssettingspage.cpp @@ -68,9 +68,9 @@ ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget* parent) : loadSettings(); - connect(m_confirmMoveToTrash, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(m_confirmDelete, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(m_confirmClosingMultipleTabs, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + connect(m_confirmMoveToTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); + connect(m_confirmDelete, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); + connect(m_confirmClosingMultipleTabs, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); } ConfirmationsSettingsPage::~ConfirmationsSettingsPage() diff --git a/src/settings/general/generalsettingspage.cpp b/src/settings/general/generalsettingspage.cpp index 18e152880..8a8adf84f 100644 --- a/src/settings/general/generalsettingspage.cpp +++ b/src/settings/general/generalsettingspage.cpp @@ -46,22 +46,22 @@ GeneralSettingsPage::GeneralSettingsPage(const KUrl& url, QWidget* parent) : // initialize 'Behavior' tab BehaviorSettingsPage* behaviorPage = new BehaviorSettingsPage(url, tabWidget); tabWidget->addTab(behaviorPage, i18nc("@title:tab Behavior settings", "Behavior")); - connect(behaviorPage, SIGNAL(changed()), this, SIGNAL(changed())); + connect(behaviorPage, &BehaviorSettingsPage::changed, this, &GeneralSettingsPage::changed); // initialize 'Previews' tab PreviewsSettingsPage* previewsPage = new PreviewsSettingsPage(tabWidget); tabWidget->addTab(previewsPage, i18nc("@title:tab Previews settings", "Previews")); - connect(previewsPage, SIGNAL(changed()), this, SIGNAL(changed())); + connect(previewsPage, &PreviewsSettingsPage::changed, this, &GeneralSettingsPage::changed); // initialize 'Context Menu' tab ConfirmationsSettingsPage* confirmationsPage = new ConfirmationsSettingsPage(tabWidget); tabWidget->addTab(confirmationsPage, i18nc("@title:tab Confirmations settings", "Confirmations")); - connect(confirmationsPage, SIGNAL(changed()), this, SIGNAL(changed())); + connect(confirmationsPage, &ConfirmationsSettingsPage::changed, this, &GeneralSettingsPage::changed); // initialize 'Status Bar' tab StatusBarSettingsPage* statusBarPage = new StatusBarSettingsPage(tabWidget); tabWidget->addTab(statusBarPage, i18nc("@title:tab Status Bar settings", "Status Bar")); - connect(statusBarPage, SIGNAL(changed()), this, SIGNAL(changed())); + connect(statusBarPage, &StatusBarSettingsPage::changed, this, &GeneralSettingsPage::changed); m_pages.append(behaviorPage); m_pages.append(previewsPage); diff --git a/src/settings/general/previewssettingspage.cpp b/src/settings/general/previewssettingspage.cpp index 38b61b996..5085173a7 100644 --- a/src/settings/general/previewssettingspage.cpp +++ b/src/settings/general/previewssettingspage.cpp @@ -65,8 +65,8 @@ PreviewsSettingsPage::PreviewsSettingsPage(QWidget* parent) : m_listView = new QListView(this); ServiceItemDelegate* delegate = new ServiceItemDelegate(m_listView, m_listView); - connect(delegate, SIGNAL(requestServiceConfiguration(QModelIndex)), - this, SLOT(configureService(QModelIndex))); + connect(delegate, &ServiceItemDelegate::requestServiceConfiguration, + this, &PreviewsSettingsPage::configureService); ServiceModel* serviceModel = new ServiceModel(this); QSortFilterProxyModel* proxyModel = new QSortFilterProxyModel(this); @@ -95,8 +95,8 @@ PreviewsSettingsPage::PreviewsSettingsPage(QWidget* parent) : loadSettings(); - connect(m_listView, SIGNAL(clicked(QModelIndex)), this, SIGNAL(changed())); - connect(m_remoteFileSizeBox, SIGNAL(valueChanged(int)), this, SIGNAL(changed())); + connect(m_listView, &QListView::clicked, this, &PreviewsSettingsPage::changed); + connect(m_remoteFileSizeBox, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged), this, &PreviewsSettingsPage::changed); } PreviewsSettingsPage::~PreviewsSettingsPage() @@ -159,7 +159,7 @@ void PreviewsSettingsPage::loadPreviewPlugins() QAbstractItemModel* model = m_listView->model(); const KService::List plugins = KServiceTypeTrader::self()->query(QLatin1String("ThumbCreator")); - foreach (const KSharedPtr<KService>& service, plugins) { + foreach (const KService::Ptr& service, plugins) { const bool configurable = service->property("Configurable", QVariant::Bool).toBool(); const bool show = m_enabledPreviewPlugins.contains(service->desktopEntryName()); diff --git a/src/settings/general/statusbarsettingspage.cpp b/src/settings/general/statusbarsettingspage.cpp index 48622ac4c..e9a9a3573 100644 --- a/src/settings/general/statusbarsettingspage.cpp +++ b/src/settings/general/statusbarsettingspage.cpp @@ -43,8 +43,8 @@ StatusBarSettingsPage::StatusBarSettingsPage(QWidget* parent) : loadSettings(); - connect(m_showZoomSlider, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(m_showSpaceInfo, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + connect(m_showZoomSlider, &QCheckBox::toggled, this, &StatusBarSettingsPage::changed); + connect(m_showSpaceInfo, &QCheckBox::toggled, this, &StatusBarSettingsPage::changed); } StatusBarSettingsPage::~StatusBarSettingsPage() diff --git a/src/settings/kcm/kcmdolphingeneral.cpp b/src/settings/kcm/kcmdolphingeneral.cpp index 26cb580f0..84b66e956 100644 --- a/src/settings/kcm/kcmdolphingeneral.cpp +++ b/src/settings/kcm/kcmdolphingeneral.cpp @@ -24,6 +24,7 @@ #include <KLocale> #include <KPluginFactory> #include <KPluginLoader> +#include <KGlobal> #include <settings/general/behaviorsettingspage.h> #include <settings/general/previewssettingspage.h> @@ -36,7 +37,7 @@ K_PLUGIN_FACTORY(KCMDolphinGeneralConfigFactory, registerPlugin<DolphinGeneralCo K_EXPORT_PLUGIN(KCMDolphinGeneralConfigFactory("kcmdolphingeneral")) DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget* parent, const QVariantList& args) : - KCModule(KCMDolphinGeneralConfigFactory::componentData(), parent), + KCModule(parent), m_pages() { Q_UNUSED(args); @@ -54,17 +55,17 @@ DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget* parent, const QV // initialize 'Behavior' tab BehaviorSettingsPage* behaviorPage = new BehaviorSettingsPage(QDir::homePath(), tabWidget); tabWidget->addTab(behaviorPage, i18nc("@title:tab Behavior settings", "Behavior")); - connect(behaviorPage, SIGNAL(changed()), this, SLOT(changed())); + connect(behaviorPage, &BehaviorSettingsPage::changed, this, static_cast<void(DolphinGeneralConfigModule::*)()>(&DolphinGeneralConfigModule::changed)); // initialize 'Previews' tab PreviewsSettingsPage* previewsPage = new PreviewsSettingsPage(tabWidget); tabWidget->addTab(previewsPage, i18nc("@title:tab Previews settings", "Previews")); - connect(previewsPage, SIGNAL(changed()), this, SLOT(changed())); + connect(previewsPage, &PreviewsSettingsPage::changed, this, static_cast<void(DolphinGeneralConfigModule::*)()>(&DolphinGeneralConfigModule::changed)); // initialize 'Confirmations' tab ConfirmationsSettingsPage* confirmationsPage = new ConfirmationsSettingsPage(tabWidget); tabWidget->addTab(confirmationsPage, i18nc("@title:tab Confirmations settings", "Confirmations")); - connect(confirmationsPage, SIGNAL(changed()), this, SLOT(changed())); + connect(confirmationsPage, &ConfirmationsSettingsPage::changed, this, static_cast<void(DolphinGeneralConfigModule::*)()>(&DolphinGeneralConfigModule::changed)); m_pages.append(behaviorPage); m_pages.append(previewsPage); diff --git a/src/settings/kcm/kcmdolphinnavigation.cpp b/src/settings/kcm/kcmdolphinnavigation.cpp index 36345a515..8096bc24a 100644 --- a/src/settings/kcm/kcmdolphinnavigation.cpp +++ b/src/settings/kcm/kcmdolphinnavigation.cpp @@ -24,6 +24,7 @@ #include <KLocale> #include <KPluginFactory> #include <KPluginLoader> +#include <KGlobal> #include <settings/navigation/navigationsettingspage.h> @@ -33,7 +34,7 @@ K_PLUGIN_FACTORY(KCMDolphinNavigationConfigFactory, registerPlugin<DolphinNaviga K_EXPORT_PLUGIN(KCMDolphinNavigationConfigFactory("kcmdolphinnavigation")) DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, const QVariantList& args) : - KCModule(KCMDolphinNavigationConfigFactory::componentData(), parent), + KCModule(parent), m_navigation(0) { Q_UNUSED(args); @@ -47,7 +48,7 @@ DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, co topLayout->setSpacing(KDialog::spacingHint()); m_navigation = new NavigationSettingsPage(this); - connect(m_navigation, SIGNAL(changed()), this, SLOT(changed())); + connect(m_navigation, &NavigationSettingsPage::changed, this, static_cast<void(DolphinNavigationConfigModule::*)()>(&DolphinNavigationConfigModule::changed)); topLayout->addWidget(m_navigation, 0, 0); } diff --git a/src/settings/kcm/kcmdolphinservices.cpp b/src/settings/kcm/kcmdolphinservices.cpp index 6d8c76192..87778dd81 100644 --- a/src/settings/kcm/kcmdolphinservices.cpp +++ b/src/settings/kcm/kcmdolphinservices.cpp @@ -24,6 +24,7 @@ #include <KLocale> #include <KPluginFactory> #include <KPluginLoader> +#include <KGlobal> #include <settings/services/servicessettingspage.h> @@ -33,7 +34,7 @@ K_PLUGIN_FACTORY(KCMDolphinServicesConfigFactory, registerPlugin<DolphinServices K_EXPORT_PLUGIN(KCMDolphinServicesConfigFactory("kcmdolphinservices")) DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const QVariantList& args) : - KCModule(KCMDolphinServicesConfigFactory::componentData(), parent), + KCModule(parent), m_services(0) { Q_UNUSED(args); @@ -47,7 +48,7 @@ DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const topLayout->setSpacing(KDialog::spacingHint()); m_services = new ServicesSettingsPage(this); - connect(m_services, SIGNAL(changed()), this, SLOT(changed())); + connect(m_services, &ServicesSettingsPage::changed, this, static_cast<void(DolphinServicesConfigModule::*)()>(&DolphinServicesConfigModule::changed)); topLayout->addWidget(m_services, 0, 0); } diff --git a/src/settings/kcm/kcmdolphinviewmodes.cpp b/src/settings/kcm/kcmdolphinviewmodes.cpp index a7a9db36d..44a551544 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.cpp +++ b/src/settings/kcm/kcmdolphinviewmodes.cpp @@ -25,6 +25,7 @@ #include <KPluginFactory> #include <KPluginLoader> #include <KIcon> +#include <KGlobal> #include <settings/viewmodes/viewsettingstab.h> @@ -38,7 +39,7 @@ K_PLUGIN_FACTORY(KCMDolphinViewModesConfigFactory, registerPlugin<DolphinViewMod K_EXPORT_PLUGIN(KCMDolphinViewModesConfigFactory("kcmdolphinviewmodes")) DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, const QVariantList& args) : - KCModule(KCMDolphinViewModesConfigFactory::componentData(), parent), + KCModule(parent), m_tabs() { Q_UNUSED(args); @@ -56,17 +57,17 @@ DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, cons // Initialize 'Icons' tab ViewSettingsTab* iconsTab = new ViewSettingsTab(ViewSettingsTab::IconsMode, tabWidget); tabWidget->addTab(iconsTab, KIcon("view-list-icons"), i18nc("@title:tab", "Icons")); - connect(iconsTab, SIGNAL(changed()), this, SLOT(viewModeChanged())); + connect(iconsTab, &ViewSettingsTab::changed, this, &DolphinViewModesConfigModule::viewModeChanged); // Initialize 'Compact' tab ViewSettingsTab* compactTab = new ViewSettingsTab(ViewSettingsTab::CompactMode, tabWidget); tabWidget->addTab(compactTab, KIcon("view-list-details"), i18nc("@title:tab", "Compact")); - connect(compactTab, SIGNAL(changed()), this, SLOT(viewModeChanged())); + connect(compactTab, &ViewSettingsTab::changed, this, &DolphinViewModesConfigModule::viewModeChanged); // Initialize 'Details' tab ViewSettingsTab* detailsTab = new ViewSettingsTab(ViewSettingsTab::DetailsMode, tabWidget); tabWidget->addTab(detailsTab, KIcon("view-list-tree"), i18nc("@title:tab", "Details")); - connect(detailsTab, SIGNAL(changed()), this, SLOT(viewModeChanged())); + connect(detailsTab, &ViewSettingsTab::changed, this, &DolphinViewModesConfigModule::viewModeChanged); m_tabs.append(iconsTab); m_tabs.append(compactTab); diff --git a/src/settings/navigation/navigationsettingspage.cpp b/src/settings/navigation/navigationsettingspage.cpp index 8076d705d..32f437d96 100644 --- a/src/settings/navigation/navigationsettingspage.cpp +++ b/src/settings/navigation/navigationsettingspage.cpp @@ -68,10 +68,10 @@ NavigationSettingsPage::NavigationSettingsPage(QWidget* parent) : loadSettings(); - connect(m_singleClick, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(m_doubleClick, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(m_openArchivesAsFolder, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(m_autoExpandFolders, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + connect(m_singleClick, &QRadioButton::toggled, this, &NavigationSettingsPage::changed); + connect(m_doubleClick, &QRadioButton::toggled, this, &NavigationSettingsPage::changed); + connect(m_openArchivesAsFolder, &QCheckBox::toggled, this, &NavigationSettingsPage::changed); + connect(m_autoExpandFolders, &QCheckBox::toggled, this, &NavigationSettingsPage::changed); } NavigationSettingsPage::~NavigationSettingsPage() diff --git a/src/settings/serviceitemdelegate.cpp b/src/settings/serviceitemdelegate.cpp index 7538e038b..5b8b582fe 100644 --- a/src/settings/serviceitemdelegate.cpp +++ b/src/settings/serviceitemdelegate.cpp @@ -66,16 +66,16 @@ void ServiceItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o painter->restore(); } -QList<QWidget*> ServiceItemDelegate::createItemWidgets() const +QList<QWidget*> ServiceItemDelegate::createItemWidgets(const QModelIndex&) const { QCheckBox* checkBox = new QCheckBox(); QPalette palette = checkBox->palette(); palette.setColor(QPalette::WindowText, palette.color(QPalette::Text)); checkBox->setPalette(palette); - connect(checkBox, SIGNAL(clicked(bool)), this, SLOT(slotCheckBoxClicked(bool))); + connect(checkBox, &QCheckBox::clicked, this, &ServiceItemDelegate::slotCheckBoxClicked); KPushButton* configureButton = new KPushButton(); - connect(configureButton, SIGNAL(clicked()), this, SLOT(slotConfigureButtonClicked())); + connect(configureButton, &KPushButton::clicked, this, &ServiceItemDelegate::slotConfigureButtonClicked); return QList<QWidget*>() << checkBox << configureButton; } diff --git a/src/settings/serviceitemdelegate.h b/src/settings/serviceitemdelegate.h index ea9681a5a..958d0dc57 100644 --- a/src/settings/serviceitemdelegate.h +++ b/src/settings/serviceitemdelegate.h @@ -42,7 +42,7 @@ public: virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; - virtual QList<QWidget*> createItemWidgets() const; + virtual QList<QWidget*> createItemWidgets(const QModelIndex&) const Q_DECL_OVERRIDE; virtual void updateItemWidgets(const QList<QWidget*> widgets, const QStyleOptionViewItem& option, diff --git a/src/settings/services/servicessettingspage.cpp b/src/settings/services/servicessettingspage.cpp index 48e816be7..4110d1f5e 100644 --- a/src/settings/services/servicessettingspage.cpp +++ b/src/settings/services/servicessettingspage.cpp @@ -29,7 +29,7 @@ #include <KIcon> #include <KLocale> #include <KMessageBox> -#include <knewstuff3/knewstuffbutton.h> +#include <KNS3/Button> #include <KService> #include <KServiceTypeTrader> #include <KStandardDirs> @@ -78,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); @@ -194,7 +194,7 @@ void ServicesSettingsPage::loadServices() // Load generic services const KService::List entries = KServiceTypeTrader::self()->query("KonqPopupMenu/Plugin"); - foreach (const KSharedPtr<KService>& service, entries) { + foreach (const KService::Ptr& service, entries) { const QString file = KStandardDirs::locate("services", service->entryPath()); const QList<KServiceAction> serviceActions = KDesktopFileActions::userDefinedServices(file, true); @@ -220,7 +220,7 @@ void ServicesSettingsPage::loadServices() // Load service plugins that implement the KFileItemActionPlugin interface const KService::List pluginServices = KServiceTypeTrader::self()->query("KFileItemAction/Plugin"); - foreach (const KSharedPtr<KService>& service, pluginServices) { + foreach (const KService::Ptr& service, pluginServices) { const QString desktopEntryName = service->desktopEntryName(); if (!isInServicesList(desktopEntryName)) { const bool checked = showGroup.readEntry(desktopEntryName, true); diff --git a/src/settings/startup/startupsettingspage.cpp b/src/settings/startup/startupsettingspage.cpp index 693826318..7f8c2d5f5 100644 --- a/src/settings/startup/startupsettingspage.cpp +++ b/src/settings/startup/startupsettingspage.cpp @@ -64,24 +64,24 @@ StartupSettingsPage::StartupSettingsPage(const KUrl& url, QWidget* parent) : m_homeUrl = new KLineEdit(homeUrlBox); m_homeUrl->setClearButtonShown(true); - QPushButton* selectHomeUrlButton = new QPushButton(KIcon("folder-open"), QString(), homeUrlBox); + QPushButton* selectHomeUrlButton = new QPushButton(QIcon::fromTheme("folder-open"), QString(), homeUrlBox); #ifndef QT_NO_ACCESSIBILITY selectHomeUrlButton->setAccessibleName(i18nc("@action:button", "Select Home Location")); #endif - connect(selectHomeUrlButton, SIGNAL(clicked()), - this, SLOT(selectHomeUrl())); + connect(selectHomeUrlButton, &QPushButton::clicked, + this, &StartupSettingsPage::selectHomeUrl); KHBox* buttonBox = new KHBox(homeBox); buttonBox->setSpacing(spacing); QPushButton* useCurrentButton = new QPushButton(i18nc("@action:button", "Use Current Location"), buttonBox); - connect(useCurrentButton, SIGNAL(clicked()), - this, SLOT(useCurrentLocation())); + connect(useCurrentButton, &QPushButton::clicked, + this, &StartupSettingsPage::useCurrentLocation); QPushButton* useDefaultButton = new QPushButton(i18nc("@action:button", "Use Default Location"), buttonBox); - connect(useDefaultButton, SIGNAL(clicked()), - this, SLOT(useDefaultLocation())); + connect(useDefaultButton, &QPushButton::clicked, + this, &StartupSettingsPage::useDefaultLocation); QVBoxLayout* homeBoxLayout = new QVBoxLayout(homeBox); homeBoxLayout->addWidget(homeUrlBox); @@ -102,11 +102,11 @@ StartupSettingsPage::StartupSettingsPage(const KUrl& url, QWidget* parent) : loadSettings(); - connect(m_homeUrl, SIGNAL(textChanged(QString)), this, SLOT(slotSettingsChanged())); - connect(m_splitView, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged())); - connect(m_editableUrl, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged())); - connect(m_showFullPath, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged())); - connect(m_filterBar, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged())); + connect(m_homeUrl, &KLineEdit::textChanged, this, &StartupSettingsPage::slotSettingsChanged); + connect(m_splitView, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); + connect(m_editableUrl, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); + connect(m_showFullPath, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); + connect(m_filterBar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); } StartupSettingsPage::~StartupSettingsPage() diff --git a/src/settings/trash/trashsettingspage.cpp b/src/settings/trash/trashsettingspage.cpp index cd699856c..d42ae8f0c 100644 --- a/src/settings/trash/trashsettingspage.cpp +++ b/src/settings/trash/trashsettingspage.cpp @@ -45,7 +45,7 @@ TrashSettingsPage::TrashSettingsPage(QWidget* parent) : loadSettings(); - connect(m_proxy, SIGNAL(changed(bool)), this, SIGNAL(changed())); + connect(m_proxy, static_cast<void(KCModuleProxy::*)(bool)>(&KCModuleProxy::changed), this, &TrashSettingsPage::changed); } TrashSettingsPage::~TrashSettingsPage() diff --git a/src/settings/viewmodes/dolphinfontrequester.cpp b/src/settings/viewmodes/dolphinfontrequester.cpp index 6cb7b9929..fe5184a56 100644 --- a/src/settings/viewmodes/dolphinfontrequester.cpp +++ b/src/settings/viewmodes/dolphinfontrequester.cpp @@ -41,12 +41,12 @@ DolphinFontRequester::DolphinFontRequester(QWidget* parent) : m_modeCombo = new KComboBox(this); m_modeCombo->addItem(i18nc("@item:inlistbox Font", "System Font")); m_modeCombo->addItem(i18nc("@item:inlistbox Font", "Custom Font")); - connect(m_modeCombo, SIGNAL(activated(int)), - this, SLOT(changeMode(int))); + connect(m_modeCombo, static_cast<void(KComboBox::*)(int)>(&KComboBox::activated), + this, &DolphinFontRequester::changeMode); m_chooseFontButton = new QPushButton(i18nc("@action:button Choose font", "Choose..."), this); - connect(m_chooseFontButton, SIGNAL(clicked()), - this, SLOT(openFontDialog())); + connect(m_chooseFontButton, &QPushButton::clicked, + this, &DolphinFontRequester::openFontDialog); changeMode(m_modeCombo->currentIndex()); diff --git a/src/settings/viewmodes/viewsettingspage.cpp b/src/settings/viewmodes/viewsettingspage.cpp index 4f8a3f00d..dfce43b4d 100644 --- a/src/settings/viewmodes/viewsettingspage.cpp +++ b/src/settings/viewmodes/viewsettingspage.cpp @@ -42,18 +42,18 @@ ViewSettingsPage::ViewSettingsPage(QWidget* parent) : // Initialize 'Icons' tab ViewSettingsTab* iconsTab = new ViewSettingsTab(ViewSettingsTab::IconsMode, tabWidget); - tabWidget->addTab(iconsTab, KIcon("view-list-icons"), i18nc("@title:tab", "Icons")); - connect(iconsTab, SIGNAL(changed()), this, SIGNAL(changed())); + tabWidget->addTab(iconsTab, QIcon::fromTheme("view-list-icons"), i18nc("@title:tab", "Icons")); + connect(iconsTab, &ViewSettingsTab::changed, this, &ViewSettingsPage::changed); // Initialize 'Compact' tab ViewSettingsTab* compactTab = new ViewSettingsTab(ViewSettingsTab::CompactMode, tabWidget); - tabWidget->addTab(compactTab, KIcon("view-list-details"), i18nc("@title:tab", "Compact")); - connect(compactTab, SIGNAL(changed()), this, SIGNAL(changed())); + tabWidget->addTab(compactTab, QIcon::fromTheme("view-list-details"), i18nc("@title:tab", "Compact")); + connect(compactTab, &ViewSettingsTab::changed, this, &ViewSettingsPage::changed); // Initialize 'Details' tab ViewSettingsTab* detailsTab = new ViewSettingsTab(ViewSettingsTab::DetailsMode, tabWidget); - tabWidget->addTab(detailsTab, KIcon("view-list-tree"), i18nc("@title:tab", "Details")); - connect(detailsTab, SIGNAL(changed()), this, SIGNAL(changed())); + tabWidget->addTab(detailsTab, QIcon::fromTheme("view-list-tree"), i18nc("@title:tab", "Details")); + connect(detailsTab, &ViewSettingsTab::changed, this, &ViewSettingsPage::changed); m_tabs.append(iconsTab); m_tabs.append(compactTab); diff --git a/src/settings/viewmodes/viewsettingstab.cpp b/src/settings/viewmodes/viewsettingstab.cpp index bc124516d..70238e82f 100644 --- a/src/settings/viewmodes/viewsettingstab.cpp +++ b/src/settings/viewmodes/viewsettingstab.cpp @@ -61,16 +61,16 @@ ViewSettingsTab::ViewSettingsTab(Mode mode, QWidget* parent) : m_defaultSizeSlider->setPageStep(1); m_defaultSizeSlider->setTickPosition(QSlider::TicksBelow); m_defaultSizeSlider->setRange(minRange, maxRange); - connect(m_defaultSizeSlider, SIGNAL(valueChanged(int)), - this, SLOT(slotDefaultSliderMoved(int))); + connect(m_defaultSizeSlider, &QSlider::valueChanged, + this, &ViewSettingsTab::slotDefaultSliderMoved); QLabel* previewLabel = new QLabel(i18nc("@label:listbox", "Preview:"), this); m_previewSizeSlider = new QSlider(Qt::Horizontal, this); m_previewSizeSlider->setPageStep(1); m_previewSizeSlider->setTickPosition(QSlider::TicksBelow); m_previewSizeSlider->setRange(minRange, maxRange); - connect(m_previewSizeSlider, SIGNAL(valueChanged(int)), - this, SLOT(slotPreviewSliderMoved(int))); + connect(m_previewSizeSlider, &QSlider::valueChanged, + this, &ViewSettingsTab::slotPreviewSliderMoved); QGridLayout* layout = new QGridLayout(iconSizeGroup); layout->addWidget(defaultLabel, 0, 0, Qt::AlignRight); @@ -138,20 +138,20 @@ ViewSettingsTab::ViewSettingsTab(Mode mode, QWidget* parent) : loadSettings(); - connect(m_defaultSizeSlider, SIGNAL(valueChanged(int)), this, SIGNAL(changed())); - connect(m_previewSizeSlider, SIGNAL(valueChanged(int)), this, SIGNAL(changed())); - connect(m_fontRequester, SIGNAL(changed()), this, SIGNAL(changed())); + connect(m_defaultSizeSlider, &QSlider::valueChanged, this, &ViewSettingsTab::changed); + connect(m_previewSizeSlider, &QSlider::valueChanged, this, &ViewSettingsTab::changed); + connect(m_fontRequester, &DolphinFontRequester::changed, this, &ViewSettingsTab::changed); switch (m_mode) { case IconsMode: - connect(m_widthBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed())); - connect(m_maxLinesBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed())); + connect(m_widthBox, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &ViewSettingsTab::changed); + connect(m_maxLinesBox, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &ViewSettingsTab::changed); break; case CompactMode: - connect(m_widthBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed())); + connect(m_widthBox, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &ViewSettingsTab::changed); break; case DetailsMode: - connect(m_expandableFolders, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + connect(m_expandableFolders, &QCheckBox::toggled, this, &ViewSettingsTab::changed); break; default: break; diff --git a/src/settings/viewpropertiesdialog.cpp b/src/settings/viewpropertiesdialog.cpp index 574f8e18e..593d1c4a8 100644 --- a/src/settings/viewpropertiesdialog.cpp +++ b/src/settings/viewpropertiesdialog.cpp @@ -92,9 +92,9 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : QLabel* viewModeLabel = new QLabel(i18nc("@label:listbox", "View mode:"), propsGrid); m_viewMode = new KComboBox(propsGrid); - m_viewMode->addItem(KIcon("view-list-icons"), i18nc("@item:inlistbox", "Icons"), DolphinView::IconsView); - m_viewMode->addItem(KIcon("view-list-details"), i18nc("@item:inlistbox", "Compact"), DolphinView::CompactView); - m_viewMode->addItem(KIcon("view-list-tree"), i18nc("@item:inlistbox", "Details"), DolphinView::DetailsView); + m_viewMode->addItem(QIcon::fromTheme("view-list-icons"), i18nc("@item:inlistbox", "Icons"), DolphinView::IconsView); + m_viewMode->addItem(QIcon::fromTheme("view-list-details"), i18nc("@item:inlistbox", "Compact"), DolphinView::CompactView); + m_viewMode->addItem(QIcon::fromTheme("view-list-tree"), i18nc("@item:inlistbox", "Details"), DolphinView::DetailsView); QLabel* sortingLabel = new QLabel(i18nc("@label:listbox", "Sorting:"), propsGrid); QWidget* sortingBox = new QWidget(propsGrid); @@ -138,25 +138,25 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : topLayout->addWidget(propsBox); - connect(m_viewMode, SIGNAL(currentIndexChanged(int)), - this, SLOT(slotViewModeChanged(int))); - connect(m_sorting, SIGNAL(currentIndexChanged(int)), - this, SLOT(slotSortingChanged(int))); - connect(m_sortOrder, SIGNAL(currentIndexChanged(int)), - this, SLOT(slotSortOrderChanged(int))); - connect(m_additionalInfo, SIGNAL(clicked()), - this, SLOT(configureAdditionalInfo())); - connect(m_sortFoldersFirst, SIGNAL(clicked()), - this, SLOT(slotSortFoldersFirstChanged())); - connect(m_previewsShown, SIGNAL(clicked()), - this, SLOT(slotShowPreviewChanged())); - connect(m_showInGroups, SIGNAL(clicked()), - this, SLOT(slotGroupedSortingChanged())); - connect(m_showHiddenFiles, SIGNAL(clicked()), - this, SLOT(slotShowHiddenFilesChanged())); + connect(m_viewMode, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), + this, &ViewPropertiesDialog::slotViewModeChanged); + connect(m_sorting, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), + this, &ViewPropertiesDialog::slotSortingChanged); + connect(m_sortOrder, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), + this, &ViewPropertiesDialog::slotSortOrderChanged); + connect(m_additionalInfo, &QPushButton::clicked, + this, &ViewPropertiesDialog::configureAdditionalInfo); + connect(m_sortFoldersFirst, &QCheckBox::clicked, + this, &ViewPropertiesDialog::slotSortFoldersFirstChanged); + connect(m_previewsShown, &QCheckBox::clicked, + this, &ViewPropertiesDialog::slotShowPreviewChanged); + connect(m_showInGroups, &QCheckBox::clicked, + this, &ViewPropertiesDialog::slotGroupedSortingChanged); + connect(m_showHiddenFiles, &QCheckBox::clicked, + this, &ViewPropertiesDialog::slotShowHiddenFilesChanged); - connect(this, SIGNAL(okClicked()), this, SLOT(slotOk())); - connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply())); + connect(this, &ViewPropertiesDialog::okClicked, this, &ViewPropertiesDialog::slotOk); + connect(this, &ViewPropertiesDialog::applyClicked, this, &ViewPropertiesDialog::slotApply); // Only show the following settings if the view properties are remembered // for each directory: @@ -187,14 +187,14 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : topLayout->addWidget(applyBox); topLayout->addWidget(m_useAsDefault); - connect(m_applyToCurrentFolder, SIGNAL(clicked(bool)), - this, SLOT(markAsDirty(bool))); - connect(m_applyToSubFolders, SIGNAL(clicked(bool)), - this, SLOT(markAsDirty(bool))); - connect(m_applyToAllFolders, SIGNAL(clicked(bool)), - this, SLOT(markAsDirty(bool))); - connect(m_useAsDefault, SIGNAL(clicked(bool)), - this, SLOT(markAsDirty(bool))); + connect(m_applyToCurrentFolder, &QRadioButton::clicked, + this, &ViewPropertiesDialog::markAsDirty); + connect(m_applyToSubFolders, &QRadioButton::clicked, + this, &ViewPropertiesDialog::markAsDirty); + connect(m_applyToAllFolders, &QRadioButton::clicked, + this, &ViewPropertiesDialog::markAsDirty); + connect(m_useAsDefault, &QCheckBox::clicked, + this, &ViewPropertiesDialog::markAsDirty); } main->setLayout(topLayout); diff --git a/src/settings/viewpropsprogressinfo.cpp b/src/settings/viewpropsprogressinfo.cpp index 9b7797d02..a4a45da26 100644 --- a/src/settings/viewpropsprogressinfo.cpp +++ b/src/settings/viewpropsprogressinfo.cpp @@ -75,18 +75,18 @@ ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent, // allows to give a progress indication for the user when applying the view // properties later. m_dirSizeJob = KIO::directorySize(dir); - connect(m_dirSizeJob, SIGNAL(result(KJob*)), - this, SLOT(applyViewProperties())); + connect(m_dirSizeJob, &KIO::DirectorySizeJob::result, + this, &ViewPropsProgressInfo::applyViewProperties); // The directory size job cannot emit any progress signal, as it is not aware // about the total number of directories. Therefor a timer is triggered, which // periodically updates the current directory count. m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), - this, SLOT(updateProgress())); + connect(m_timer, &QTimer::timeout, + this, &ViewPropsProgressInfo::updateProgress); m_timer->start(300); - connect(this, SIGNAL(cancelClicked()), this, SLOT(cancelApplying())); + connect(this, &ViewPropsProgressInfo::cancelClicked, this, &ViewPropsProgressInfo::cancelApplying); } ViewPropsProgressInfo::~ViewPropsProgressInfo() @@ -128,8 +128,8 @@ void ViewPropsProgressInfo::applyViewProperties() m_dirSizeJob = 0; m_applyViewPropsJob = new ApplyViewPropsJob(m_dir, *m_viewProps); - connect(m_applyViewPropsJob, SIGNAL(result(KJob*)), - this, SLOT(close())); + connect(m_applyViewPropsJob, &ApplyViewPropsJob::result, + this, &ViewPropsProgressInfo::close); } void ViewPropsProgressInfo::cancelApplying() |
