X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d2f8c4f0641ec4218ee5c7d32b2e3b5319a27f32..628a2bbb64d08e5aff524b264847699a1f55a611:/src/settings/contextmenu/contextmenusettingspage.cpp diff --git a/src/settings/contextmenu/contextmenusettingspage.cpp b/src/settings/contextmenu/contextmenusettingspage.cpp index acf80d195..974ddb531 100644 --- a/src/settings/contextmenu/contextmenusettingspage.cpp +++ b/src/settings/contextmenu/contextmenusettingspage.cpp @@ -24,14 +24,10 @@ #include #include #include +#include #include -#include -#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 91, 0) #include -#else -#include -#endif #include #include @@ -97,11 +93,7 @@ ContextMenuSettingsPage::ContextMenuSettingsPage(QWidget* parent, topLayout->addWidget(m_listView); #ifndef Q_OS_WIN -#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 91, 0) using NewStuffButton = KNSWidgets::Button; -#else - using NewStuffButton = KNS3::Button; -#endif // KNEWSTUFF_VERSION auto *downloadButton = new NewStuffButton(i18nc("@action:button", "Download New Services..."), QStringLiteral("servicemenu.knsrc"), this); @@ -208,14 +200,22 @@ void ContextMenuSettingsPage::applySettings() VersionControlSettings::self()->save(); if (!laterSelected) { +#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) + KMessageBox::ButtonCode promptRestart = KMessageBox::questionTwoActions(window(), +#else KMessageBox::ButtonCode promptRestart = KMessageBox::questionYesNo(window(), +#endif i18nc("@info", "Dolphin must be restarted to apply the " "updated version control system settings."), i18nc("@info", "Restart now?"), KGuiItem(QApplication::translate("KStandardGuiItem", "&Restart"), QStringLiteral("dialog-restart")), KGuiItem(QApplication::translate("KStandardGuiItem", "&Later"), QStringLiteral("dialog-later")) ); +#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) + if (promptRestart == KMessageBox::ButtonCode::PrimaryAction) { +#else if (promptRestart == KMessageBox::ButtonCode::Yes) { +#endif Dolphin::openNewWindow(); qApp->quit(); } else { @@ -326,7 +326,7 @@ void ContextMenuSettingsPage::loadServices() #endif // Load JSON-based plugins that implement the KFileItemActionPlugin interface - const auto jsonPlugins = KPluginMetaData::findPlugins(QStringLiteral("kf5/kfileitemaction")); + const auto jsonPlugins = KPluginMetaData::findPlugins(QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR)) + QStringLiteral("/kfileitemaction")); for (const auto &jsonMetadata : jsonPlugins) { const QString desktopEntryName = jsonMetadata.pluginId();