diff --git a/applets/systemtray/systemtray.h b/applets/systemtray/systemtray.h --- a/applets/systemtray/systemtray.h +++ b/applets/systemtray/systemtray.h @@ -22,6 +22,8 @@ #define SYSTEMTRAY_H #include +#include + #include class QDBusPendingCallWatcher; @@ -114,7 +116,7 @@ void initDBusActivatables(); QStringList m_defaultPlasmoids; QHash m_systrayApplets; - QHash m_dbusActivatableTasks; + QHash m_dbusActivatableTasks; QStringList m_allowedPlasmoids; PlasmoidModel *m_availablePlasmoidsModel; diff --git a/applets/systemtray/systemtray.cpp b/applets/systemtray/systemtray.cpp --- a/applets/systemtray/systemtray.cpp +++ b/applets/systemtray/systemtray.cpp @@ -85,7 +85,9 @@ const QString dbusactivation = info.value(QStringLiteral("X-Plasma-DBusActivationService")); if (!dbusactivation.isEmpty()) { qCDebug(SYSTEM_TRAY) << "ST Found DBus-able Applet: " << info.pluginId() << dbusactivation; - m_dbusActivatableTasks[info.pluginId()] = dbusactivation; + QRegExp rx(dbusactivation); + rx.setPatternSyntax(QRegExp::Wildcard); + m_dbusActivatableTasks[info.pluginId()] = rx; } } } @@ -541,9 +543,7 @@ continue; } - const QString &pattern = it.value(); - QRegExp rx(pattern); - rx.setPatternSyntax(QRegExp::Wildcard); + const auto &rx = it.value(); if (rx.exactMatch(service)) { //qCDebug(SYSTEM_TRAY) << "ST : DBus service " << m_dbusActivatableTasks[plugin] << "appeared. Loading " << plugin; newTask(plugin); @@ -562,9 +562,7 @@ continue; } - const QString &pattern = it.value(); - QRegExp rx(pattern); - rx.setPatternSyntax(QRegExp::Wildcard); + const auto &rx = it.value(); if (rx.exactMatch(service)) { m_dbusServiceCounts[plugin]--; Q_ASSERT(m_dbusServiceCounts[plugin] >= 0);