diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) set(QT_MIN_VERSION "5.6.1") -set(KF5_MIN_VERSION "5.18.0") +set(KF5_MIN_VERSION "5.24.0") set(INSTALL_SDDM_THEME TRUE) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Widgets Quick QuickWidgets Concurrent Test Script Network) find_package(ECM 1.8.0 REQUIRED NO_MODULE) diff --git a/runners/activities/activityrunner.cpp b/runners/activities/activityrunner.cpp --- a/runners/activities/activityrunner.cpp +++ b/runners/activities/activityrunner.cpp @@ -158,7 +158,7 @@ Plasma::QueryMatch match(this); match.setData(activity.id()); match.setType(Plasma::QueryMatch::ExactMatch); - match.setIcon(activity.icon().isEmpty() ? QIcon::fromTheme(QStringLiteral("preferences-activities")) : QIcon::fromTheme(activity.icon())); + match.setIconName(activity.icon().isEmpty() ? QStringLiteral("preferences-activities") : activity.icon()); match.setText(i18n("Switch to \"%1\"", activity.name())); match.setRelevance(0.7 + ((activity.state() == KActivities::Info::Running || activity.state() == KActivities::Info::Starting) ? 0.1 : 0)); diff --git a/runners/baloo/baloosearchrunner.cpp b/runners/baloo/baloosearchrunner.cpp --- a/runners/baloo/baloosearchrunner.cpp +++ b/runners/baloo/baloosearchrunner.cpp @@ -115,7 +115,7 @@ const QUrl url = QUrl::fromLocalFile(localUrl); QString iconName = mimeDb.mimeTypeForFile(localUrl).iconName(); - match.setIcon(QIcon::fromTheme(iconName)); + match.setIconName(iconName); match.setId(it.filePath()); match.setText(url.fileName()); match.setData(url); diff --git a/runners/calculator/calculatorrunner.h b/runners/calculator/calculatorrunner.h --- a/runners/calculator/calculatorrunner.h +++ b/runners/calculator/calculatorrunner.h @@ -42,6 +42,8 @@ void match(Plasma::RunnerContext &context) override; protected Q_SLOTS: + void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) override; + QList actionsForMatch(const Plasma::QueryMatch &match) override; QMimeData * mimeDataForMatch(const Plasma::QueryMatch &match) override; private: diff --git a/runners/calculator/calculatorrunner.cpp b/runners/calculator/calculatorrunner.cpp --- a/runners/calculator/calculatorrunner.cpp +++ b/runners/calculator/calculatorrunner.cpp @@ -215,7 +215,7 @@ if (cmd.toLower() == QLatin1String("universe") || cmd.toLower() == QLatin1String("life")) { Plasma::QueryMatch match(this); match.setType(Plasma::QueryMatch::InformationalMatch); - match.setIcon(QIcon::fromTheme(QStringLiteral("accessories-calculator"))); + match.setIconName(QStringLiteral("accessories-calculator")); match.setText(QStringLiteral("42")); match.setData("42"); match.setId(term); @@ -264,7 +264,7 @@ Plasma::QueryMatch match(this); match.setType(Plasma::QueryMatch::InformationalMatch); - match.setIcon(QIcon::fromTheme(QStringLiteral("accessories-calculator"))); + match.setIconName(QStringLiteral("accessories-calculator")); match.setText(result); match.setData(result); match.setId(term); diff --git a/runners/kill/killrunner.cpp b/runners/kill/killrunner.cpp --- a/runners/kill/killrunner.cpp +++ b/runners/kill/killrunner.cpp @@ -141,7 +141,7 @@ Plasma::QueryMatch match(this); match.setText(i18n("Terminate %1", name)); match.setSubtext(i18n("Process ID: %1\nRunning as user: %2", QString::number(pid), user)); - match.setIcon(QIcon::fromTheme(QStringLiteral("application-exit"))); + match.setIconName(QStringLiteral("application-exit")); match.setData(data); match.setId(name); diff --git a/runners/locations/locationrunner.cpp b/runners/locations/locationrunner.cpp --- a/runners/locations/locationrunner.cpp +++ b/runners/locations/locationrunner.cpp @@ -61,9 +61,9 @@ match.setText(i18n("Open %1", term)); if (type == Plasma::RunnerContext::File) { - match.setIcon(QIcon::fromTheme(KIO::iconNameForUrl(QUrl(term)))); + match.setIconName(KIO::iconNameForUrl(QUrl(term))); } else { - match.setIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"))); + match.setIconName(QStringLiteral("system-file-manager")); } match.setRelevance(1); @@ -81,7 +81,7 @@ Plasma::QueryMatch match(this); match.setType(Plasma::QueryMatch::ExactMatch); match.setText(i18n("Open %1", term)); - match.setIcon(QIcon::fromTheme(QStringLiteral("system-help"))); + match.setIconName(QStringLiteral("system-help")); match.setRelevance(1); match.setType(Plasma::QueryMatch::ExactMatch); match.setId(QStringLiteral("help")); @@ -101,7 +101,7 @@ Plasma::QueryMatch match(this); match.setText(i18n("Go to %1", url.toDisplayString())); - match.setIcon(QIcon::fromTheme(KProtocolInfo::icon(url.scheme()))); + match.setIconName(KProtocolInfo::icon(url.scheme())); match.setData(url.url()); if (KProtocolInfo::isHelperProtocol(url.scheme())) { diff --git a/runners/powerdevil/PowerDevilRunner.cpp b/runners/powerdevil/PowerDevilRunner.cpp --- a/runners/powerdevil/PowerDevilRunner.cpp +++ b/runners/powerdevil/PowerDevilRunner.cpp @@ -197,7 +197,7 @@ } Plasma::QueryMatch match(this); match.setType(Plasma::QueryMatch::ExactMatch); - match.setIcon(QIcon::fromTheme(m_profileIcon[i.key()])); + match.setIconName(m_profileIcon[i.key()]); match.setText(i18n("Set Profile to '%1'", i.value())); match.setData(i.key()); match.setRelevance(1); @@ -217,7 +217,7 @@ int brightness = qBound(0, b, 100); Plasma::QueryMatch match(this); match.setType(Plasma::QueryMatch::ExactMatch); - match.setIcon(QIcon::fromTheme(QStringLiteral("preferences-system-power-management"))); + match.setIconName(QStringLiteral("preferences-system-power-management")); match.setText(i18n("Set Brightness to %1", brightness)); match.setData(brightness); match.setRelevance(1); @@ -227,15 +227,15 @@ } else { Plasma::QueryMatch match1(this); match1.setType(Plasma::QueryMatch::ExactMatch); - match1.setIcon(QIcon::fromTheme(QStringLiteral("preferences-system-power-management"))); + match1.setIconName(QStringLiteral("preferences-system-power-management")); match1.setText(i18n("Dim screen totally")); match1.setRelevance(1); match1.setId(QStringLiteral("DimTotal")); matches.append(match1); Plasma::QueryMatch match2(this); match2.setType(Plasma::QueryMatch::ExactMatch); - match2.setIcon(QIcon::fromTheme(QStringLiteral("preferences-system-power-management"))); + match2.setIconName(QStringLiteral("preferences-system-power-management")); match2.setText(i18n("Dim screen by half")); match2.setRelevance(1); match2.setId(QStringLiteral("DimHalf")); @@ -272,12 +272,12 @@ switch ((Solid::PowerManagement::SleepState)value) { case Solid::PowerManagement::SuspendState: case Solid::PowerManagement::StandbyState: - match.setIcon(QIcon::fromTheme(QStringLiteral("system-suspend"))); + match.setIconName(QStringLiteral("system-suspend")); match.setText(i18n("Suspend to RAM")); match.setRelevance(1); break; case Solid::PowerManagement::HibernateState: - match.setIcon(QIcon::fromTheme(QStringLiteral("system-suspend-hibernate"))); + match.setIconName(QStringLiteral("system-suspend-hibernate")); match.setText(i18n("Suspend to Disk")); match.setRelevance(0.99); break; diff --git a/runners/recentdocuments/recentdocuments.h b/runners/recentdocuments/recentdocuments.h --- a/runners/recentdocuments/recentdocuments.h +++ b/runners/recentdocuments/recentdocuments.h @@ -41,7 +41,6 @@ void loadRecentDocuments(); private: - QIcon m_icon; QStringList m_recentdocuments; }; diff --git a/runners/recentdocuments/recentdocuments.cpp b/runners/recentdocuments/recentdocuments.cpp --- a/runners/recentdocuments/recentdocuments.cpp +++ b/runners/recentdocuments/recentdocuments.cpp @@ -36,7 +36,6 @@ { Q_UNUSED(args); setObjectName( QStringLiteral("Recent Documents" )); - m_icon = QIcon::fromTheme(QStringLiteral("document-open-recent")); loadRecentDocuments(); // listen for changes to the list of recent documents KDirWatch *recentDocWatch = new KDirWatch(this); @@ -53,7 +52,6 @@ void RecentDocuments::loadRecentDocuments() { - //qDebug() << "Refreshing recent documents."; m_recentdocuments = KRecentDocument::recentDocuments(); } @@ -79,10 +77,11 @@ Plasma::QueryMatch match(this); match.setType(Plasma::QueryMatch::PossibleMatch); match.setRelevance(1.0); - match.setIcon(QIcon::fromTheme(config.readIcon())); + match.setIconName(config.readIcon()); match.setData(config.readUrl()); match.setText(config.readName()); match.setSubtext(i18n("Recent Document")); + context.addMatch(match); } } diff --git a/runners/services/servicerunner.cpp b/runners/services/servicerunner.cpp --- a/runners/services/servicerunner.cpp +++ b/runners/services/servicerunner.cpp @@ -253,9 +253,9 @@ Plasma::QueryMatch match(this); match.setType(Plasma::QueryMatch::HelperMatch); if (!action.icon().isEmpty()) { - match.setIcon(QIcon::fromTheme(action.icon())); + match.setIconName(action.icon()); } else { - match.setIcon(QIcon::fromTheme(service->icon())); + match.setIconName(service->icon()); } match.setText(i18nc("Jump list search result, %1 is action (eg. open new tab), %2 is application (eg. browser)", "%1 - %2", action.text(), service->name())); @@ -310,7 +310,7 @@ } if (!service->icon().isEmpty()) { - match.setIcon(QIcon::fromTheme(service->icon())); + match.setIconName(service->icon()); } } diff --git a/runners/sessions/sessionrunner.cpp b/runners/sessions/sessionrunner.cpp --- a/runners/sessions/sessionrunner.cpp +++ b/runners/sessions/sessionrunner.cpp @@ -84,33 +84,33 @@ term.compare(i18n("log out"), Qt::CaseInsensitive) == 0) { Plasma::QueryMatch match(this); match.setText(i18nc("log out command","Logout")); - match.setIcon(QIcon::fromTheme(QStringLiteral("system-log-out"))); + match.setIconName(QStringLiteral("system-log-out")); match.setData(LogoutAction); match.setType(Plasma::QueryMatch::ExactMatch); match.setRelevance(0.9); matches << match; } else if (term.compare(i18nc("restart computer command", "restart"), Qt::CaseInsensitive) == 0 || term.compare(i18nc("restart computer command", "reboot"), Qt::CaseInsensitive) == 0) { Plasma::QueryMatch match(this); match.setText(i18n("Restart the computer")); - match.setIcon(QIcon::fromTheme(QStringLiteral("system-reboot"))); + match.setIconName(QStringLiteral("system-reboot")); match.setData(RestartAction); match.setType(Plasma::QueryMatch::ExactMatch); match.setRelevance(0.9); matches << match; } else if (term.compare(i18nc("shutdown computer command","shutdown"), Qt::CaseInsensitive) == 0) { Plasma::QueryMatch match(this); match.setText(i18n("Shutdown the computer")); - match.setIcon(QIcon::fromTheme(QStringLiteral("system-shutdown"))); + match.setIconName(QStringLiteral("system-shutdown")); match.setData(ShutdownAction); match.setType(Plasma::QueryMatch::ExactMatch); match.setRelevance(0.9); matches << match; } else if (term.compare(i18nc("lock screen command","lock"), Qt::CaseInsensitive) == 0) { if (KAuthorized::authorizeKAction(QStringLiteral("lock_screen"))) { Plasma::QueryMatch match(this); match.setText(i18n("Lock the screen")); - match.setIcon(QIcon::fromTheme(QStringLiteral("system-lock-screen"))); + match.setIconName(QStringLiteral("system-lock-screen")); match.setData(LockAction); match.setType(Plasma::QueryMatch::ExactMatch); match.setRelevance(0.9); @@ -161,7 +161,7 @@ dm.numReserve() >= 0) { Plasma::QueryMatch match(this); match.setType(Plasma::QueryMatch::ExactMatch); - match.setIcon(QIcon::fromTheme(QStringLiteral("system-switch-user"))); + match.setIconName(QStringLiteral("system-switch-user")); match.setText(i18n("New Session")); matches << match; } @@ -198,7 +198,7 @@ Plasma::QueryMatch match(this); match.setType(type); match.setRelevance(relevance); - match.setIcon(QIcon::fromTheme(QStringLiteral("user-identity"))); + match.setIconName(QStringLiteral("user-identity")); match.setText(name); match.setData(QString::number(session.vt)); matches << match; diff --git a/runners/shell/shellrunner.cpp b/runners/shell/shellrunner.cpp --- a/runners/shell/shellrunner.cpp +++ b/runners/shell/shellrunner.cpp @@ -66,7 +66,7 @@ Plasma::QueryMatch match(this); match.setId(term); match.setType(Plasma::QueryMatch::ExactMatch); - match.setIcon(QIcon::fromTheme(QStringLiteral("system-run"))); + match.setIconName(QStringLiteral("system-run")); match.setText(i18n("Run %1", term)); match.setRelevance(0.7); context.addMatch(match); diff --git a/runners/webshortcuts/webshortcutrunner.h b/runners/webshortcuts/webshortcutrunner.h --- a/runners/webshortcuts/webshortcutrunner.h +++ b/runners/webshortcuts/webshortcutrunner.h @@ -41,7 +41,6 @@ void resetState(); private: - QIcon m_icon; Plasma::QueryMatch m_match; bool m_filterBeforeRun; diff --git a/runners/webshortcuts/webshortcutrunner.cpp b/runners/webshortcuts/webshortcutrunner.cpp --- a/runners/webshortcuts/webshortcutrunner.cpp +++ b/runners/webshortcuts/webshortcutrunner.cpp @@ -33,8 +33,6 @@ setObjectName( QLatin1String("Web Shortcut" )); setIgnoredTypes(Plasma::RunnerContext::Directory | Plasma::RunnerContext::File | Plasma::RunnerContext::Executable); - m_icon = QIcon::fromTheme(QStringLiteral("internet-web-browser")); - m_match.setType(Plasma::QueryMatch::ExactMatch); m_match.setRelevance(0.9); @@ -134,7 +132,7 @@ m_match.setData(filterData.uri().url()); m_match.setId("WebShortcut:" + key); - m_match.setIcon(QIcon::fromTheme(filterData.iconName())); + m_match.setIconName(filterData.iconName()); m_match.setText(i18n("Search %1 for %2", m_lastProvider, filterData.searchTerm())); context.addMatch(m_match); } diff --git a/runners/windowedwidgets/windowedwidgetsrunner.cpp b/runners/windowedwidgets/windowedwidgetsrunner.cpp --- a/runners/windowedwidgets/windowedwidgetsrunner.cpp +++ b/runners/windowedwidgets/windowedwidgetsrunner.cpp @@ -120,7 +120,7 @@ } if (!service->icon().isEmpty()) { - match.setIcon(QIcon::fromTheme(service->icon())); + match.setIconName(service->icon()); } } diff --git a/runners/windows/windowsrunner.cpp b/runners/windows/windowsrunner.cpp --- a/runners/windows/windowsrunner.cpp +++ b/runners/windows/windowsrunner.cpp @@ -399,7 +399,7 @@ match.setType(Plasma::QueryMatch::ExactMatch); match.setData(desktop); match.setId("desktop-" + QString::number(desktop)); - match.setIcon(QIcon::fromTheme(QStringLiteral("user-desktop"))); + match.setIconName(QStringLiteral("user-desktop")); QString desktopName; if (desktop <= m_desktopNames.size()) { desktopName = m_desktopNames[desktop - 1];