From cf5d713d2e0a9e0be2d88fd0768e810f5dafbe1f Mon Sep 17 00:00:00 2001 From: arcan1s Date: Wed, 15 Jul 2015 19:34:19 +0300 Subject: [PATCH 1/3] Revert "drop key definition on startup since it blocks several plasmoid" This reverts commit 4e78e0e1dd7104c957a4dac2dcd5142b6982b263. --- .../package/contents/ui/main.qml | 4 +- sources/awesome-widget/plugin/awkeys.cpp | 58 +++++++++++++++---- sources/awesome-widget/plugin/awkeys.h | 11 +++- 3 files changed, 58 insertions(+), 15 deletions(-) diff --git a/sources/awesome-widget/package/contents/ui/main.qml b/sources/awesome-widget/package/contents/ui/main.qml index ca0aa5c..2f0ce46 100644 --- a/sources/awesome-widget/package/contents/ui/main.qml +++ b/sources/awesome-widget/package/contents/ui/main.qml @@ -181,7 +181,7 @@ Item { onNeedUpdate: { if (debug) console.log("[main::onNeedUpdate]") - text.text = AWKeys.parsePattern(plasmoid.configuration.text) + text.text = AWKeys.parsePattern() tooltip.text = AWKeys.toolTipImage() sizeUpdate() @@ -211,7 +211,7 @@ Item { if (debug) console.log("[main::onUserConfiguringChanged]") // init submodule - AWKeys.initKeys() + AWKeys.initKeys(plasmoid.configuration.text) AWKeys.initTooltip(tooltipSettings) AWKeys.setPopupEnabled(plasmoid.configuration.notify) AWKeys.setWrapNewLines(plasmoid.configuration.wrapNewLines) diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index fac6a44..b733d54 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -86,7 +86,7 @@ AWKeys::~AWKeys() } -void AWKeys::initKeys() +void AWKeys::initKeys(const QString currentPattern) { if (debug) qDebug() << PDEBUG; @@ -96,8 +96,11 @@ void AWKeys::initKeys() extUpgrade.clear(); graphicalItems.clear(); keys.clear(); + foundBars.clear(); + foundKeys.clear(); // init + pattern = currentPattern; extQuotes = getExtQuotes(); extScripts = getExtScripts(); extUpgrade = getExtUpgrade(); @@ -143,19 +146,17 @@ bool AWKeys::isDebugEnabled() } -QString AWKeys::parsePattern(const QString currentPattern) +QString AWKeys::parsePattern() { if (debug) qDebug() << PDEBUG; - if (keys.isEmpty()) return currentPattern; + if (keys.isEmpty()) return pattern; - QString parsed = currentPattern; + QString parsed = pattern; parsed.replace(QString("$$"), QString("$\\$\\")); - for (int i=0; iimage(valueByKey(keys[i]).toFloat())); - else - parsed.replace(QString("$%1").arg(keys[i]), htmlValue(keys[i])); - } + for (int i=0; iimage(valueByKey(foundBars[i]).toFloat())); parsed.replace(QString("$\\$\\"), QString("$$")); // wrap new lines if required if (wrapNewLines) parsed.replace(QString("\n"), QString("
")); @@ -848,6 +849,8 @@ void AWKeys::reinitKeys() if (debug) qDebug() << PDEBUG; keys = dictKeys(); + foundBars = findGraphicalItems(); + foundKeys = findKeys(); } @@ -1322,6 +1325,41 @@ float AWKeys::temperature(const float temp, const QString units) } +QStringList AWKeys::findGraphicalItems() +{ + if (debug) qDebug() << PDEBUG; + + QStringList orderedKeys; + for (int i=0; iname() + graphicalItems[i]->bar()); + orderedKeys.sort(); + + QStringList selectedKeys; + for (int i=orderedKeys.count()-1; i>=0; i--) + if (pattern.contains(QString("$%1").arg(orderedKeys[i]))) { + if (debug) qDebug() << PDEBUG << ":" << "Found key" << orderedKeys[i]; + selectedKeys.append(orderedKeys[i]); + } + + return selectedKeys; +} + + +QStringList AWKeys::findKeys() +{ + QStringList selectedKeys; + for (int i=0; i AWKeys::getExtQuotes() { if (debug) qDebug() << PDEBUG; diff --git a/sources/awesome-widget/plugin/awkeys.h b/sources/awesome-widget/plugin/awkeys.h index d71af67..2fa7b32 100644 --- a/sources/awesome-widget/plugin/awkeys.h +++ b/sources/awesome-widget/plugin/awkeys.h @@ -51,12 +51,12 @@ public: AWKeys(QObject *parent = nullptr); ~AWKeys(); - Q_INVOKABLE void initKeys(); + Q_INVOKABLE void initKeys(const QString currentPattern); Q_INVOKABLE void initTooltip(const QVariantMap tooltipParams); Q_INVOKABLE void setPopupEnabled(const bool popup = false); Q_INVOKABLE void setWrapNewLines(const bool wrap = false); Q_INVOKABLE bool isDebugEnabled(); - Q_INVOKABLE QString parsePattern(const QString currentPattern); + Q_INVOKABLE QString parsePattern(); Q_INVOKABLE QString toolTipImage(); Q_INVOKABLE QSize toolTipSize(); // keys @@ -93,6 +93,9 @@ private: QString htmlValue(QString key); int numberCpus(); float temperature(const float temp, const QString units); + // find methods + QStringList findGraphicalItems(); + QStringList findKeys(); // get methods QList getExtQuotes(); QList getExtScripts(); @@ -117,8 +120,10 @@ private: QList extQuotes; QList extScripts; QList extUpgrade; + QStringList foundBars, foundKeys, keys; + QString pattern; QMap values; - QStringList keys, diskDevices, hddDevices, mountDevices, networkDevices, tempDevices; + QStringList diskDevices, hddDevices, mountDevices, networkDevices, tempDevices; }; From 903a1a454d439ccc62c1bbf503fde8ff720fc510 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Wed, 15 Jul 2015 19:49:54 +0300 Subject: [PATCH 2/3] move plugin back to private --- sources/awesome-widget/package/contents/ui/about.qml | 2 +- sources/awesome-widget/package/contents/ui/advanced.qml | 2 +- sources/awesome-widget/package/contents/ui/appearance.qml | 2 +- sources/awesome-widget/package/contents/ui/dataengine.qml | 2 +- sources/awesome-widget/package/contents/ui/main.qml | 2 +- sources/awesome-widget/package/contents/ui/tooltip.qml | 2 +- sources/awesome-widget/package/contents/ui/widget.qml | 2 +- sources/awesome-widget/plugin/CMakeLists.txt | 4 ++-- sources/awesome-widget/plugin/awesomewidget.cpp | 2 +- sources/awesome-widget/plugin/qmldir | 2 +- sources/desktop-panel/package/contents/ui/about.qml | 2 +- sources/desktop-panel/package/contents/ui/activeapp.qml | 2 +- sources/desktop-panel/package/contents/ui/advanced.qml | 2 +- sources/desktop-panel/package/contents/ui/inactiveapp.qml | 2 +- sources/desktop-panel/package/contents/ui/main.qml | 2 +- sources/desktop-panel/package/contents/ui/widget.qml | 2 +- sources/desktop-panel/plugin/CMakeLists.txt | 4 ++-- sources/desktop-panel/plugin/desktoppanel.cpp | 2 +- sources/desktop-panel/plugin/qmldir | 2 +- 19 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sources/awesome-widget/package/contents/ui/about.qml b/sources/awesome-widget/package/contents/ui/about.qml index 92c4dd0..28e33dc 100644 --- a/sources/awesome-widget/package/contents/ui/about.qml +++ b/sources/awesome-widget/package/contents/ui/about.qml @@ -19,7 +19,7 @@ import QtQuick 2.0 import QtQuick.Controls 1.3 as QtControls import QtQuick.Layouts 1.0 as QtLayouts -import org.kde.plasma.awesomewidget 1.0 +import org.kde.plasma.private.awesomewidget 1.0 Item { diff --git a/sources/awesome-widget/package/contents/ui/advanced.qml b/sources/awesome-widget/package/contents/ui/advanced.qml index acd4c64..c4d01ee 100644 --- a/sources/awesome-widget/package/contents/ui/advanced.qml +++ b/sources/awesome-widget/package/contents/ui/advanced.qml @@ -18,7 +18,7 @@ import QtQuick 2.0 import QtQuick.Controls 1.3 as QtControls -import org.kde.plasma.awesomewidget 1.0 +import org.kde.plasma.private.awesomewidget 1.0 Item { diff --git a/sources/awesome-widget/package/contents/ui/appearance.qml b/sources/awesome-widget/package/contents/ui/appearance.qml index b1c28df..9fc2619 100644 --- a/sources/awesome-widget/package/contents/ui/appearance.qml +++ b/sources/awesome-widget/package/contents/ui/appearance.qml @@ -20,7 +20,7 @@ import QtQuick.Controls 1.3 as QtControls import QtQuick.Controls.Styles 1.3 as QtStyles import QtQuick.Dialogs 1.1 as QtDialogs -import org.kde.plasma.awesomewidget 1.0 +import org.kde.plasma.private.awesomewidget 1.0 Item { diff --git a/sources/awesome-widget/package/contents/ui/dataengine.qml b/sources/awesome-widget/package/contents/ui/dataengine.qml index e25d76f..7a681f4 100644 --- a/sources/awesome-widget/package/contents/ui/dataengine.qml +++ b/sources/awesome-widget/package/contents/ui/dataengine.qml @@ -21,7 +21,7 @@ import QtQuick.Dialogs 1.1 as QtDialogs import QtQuick.Layouts 1.0 as QtLayouts import QtQuick.Controls.Styles 1.3 as QtStyles -import org.kde.plasma.awesomewidget 1.0 +import org.kde.plasma.private.awesomewidget 1.0 Item { diff --git a/sources/awesome-widget/package/contents/ui/main.qml b/sources/awesome-widget/package/contents/ui/main.qml index 2f0ce46..8e4e98d 100644 --- a/sources/awesome-widget/package/contents/ui/main.qml +++ b/sources/awesome-widget/package/contents/ui/main.qml @@ -22,7 +22,7 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.awesomewidget 1.0 +import org.kde.plasma.private.awesomewidget 1.0 import "." diff --git a/sources/awesome-widget/package/contents/ui/tooltip.qml b/sources/awesome-widget/package/contents/ui/tooltip.qml index a59aa00..bca8235 100644 --- a/sources/awesome-widget/package/contents/ui/tooltip.qml +++ b/sources/awesome-widget/package/contents/ui/tooltip.qml @@ -20,7 +20,7 @@ import QtQuick.Controls 1.3 as QtControls import QtQuick.Controls.Styles 1.3 as QtStyles import QtQuick.Dialogs 1.1 as QtDialogs -import org.kde.plasma.awesomewidget 1.0 +import org.kde.plasma.private.awesomewidget 1.0 Item { diff --git a/sources/awesome-widget/package/contents/ui/widget.qml b/sources/awesome-widget/package/contents/ui/widget.qml index a7b73c9..0e66439 100644 --- a/sources/awesome-widget/package/contents/ui/widget.qml +++ b/sources/awesome-widget/package/contents/ui/widget.qml @@ -19,7 +19,7 @@ import QtQuick 2.0 import QtQuick.Controls 1.3 as QtControls import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.awesomewidget 1.0 +import org.kde.plasma.private.awesomewidget 1.0 Item { diff --git a/sources/awesome-widget/plugin/CMakeLists.txt b/sources/awesome-widget/plugin/CMakeLists.txt index 5219ca8..1ef4af0 100644 --- a/sources/awesome-widget/plugin/CMakeLists.txt +++ b/sources/awesome-widget/plugin/CMakeLists.txt @@ -32,7 +32,7 @@ qt5_wrap_ui (SUBPROJECT_UI_HEADER ${SUBPROJECT_UI}) add_library (${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE} ${SUBPROJECT_UI_HEADER}) target_link_libraries (${PLUGIN_NAME} ${Qt_LIBRARIES} ${Kf5_LIBRARIES}) -install (TARGETS ${PLUGIN_NAME} DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/awesomewidget) -install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/awesomewidget) +install (TARGETS ${PLUGIN_NAME} DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/awesomewidget) +install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/awesomewidget) install (FILES ${SUBPROJECT_NOTIFY} DESTINATION ${KNOTIFYRC_INSTALL_DIR}) install (DIRECTORY ${SUBPROJECT_DESKTOP} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}) diff --git a/sources/awesome-widget/plugin/awesomewidget.cpp b/sources/awesome-widget/plugin/awesomewidget.cpp index 4c70f56..5166107 100644 --- a/sources/awesome-widget/plugin/awesomewidget.cpp +++ b/sources/awesome-widget/plugin/awesomewidget.cpp @@ -43,7 +43,7 @@ static QObject *awkeys_singletontype_provider(QQmlEngine *engine, QJSEngine *scr void AWPlugin::registerTypes(const char *uri) { - Q_ASSERT(uri == QLatin1String("org.kde.plasma.awesomewidget")); + Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.awesomewidget")); qmlRegisterSingletonType(uri, 1, 0, "AWActions", awactions_singletontype_provider); qmlRegisterSingletonType(uri, 1, 0, "AWKeys", awkeys_singletontype_provider); diff --git a/sources/awesome-widget/plugin/qmldir b/sources/awesome-widget/plugin/qmldir index 76288c8..8a3ed27 100644 --- a/sources/awesome-widget/plugin/qmldir +++ b/sources/awesome-widget/plugin/qmldir @@ -1,3 +1,3 @@ -module org.kde.plasma.awesomewidget +module org.kde.plasma.private.awesomewidget plugin awplugin diff --git a/sources/desktop-panel/package/contents/ui/about.qml b/sources/desktop-panel/package/contents/ui/about.qml index ad3201b..b4ec945 100644 --- a/sources/desktop-panel/package/contents/ui/about.qml +++ b/sources/desktop-panel/package/contents/ui/about.qml @@ -19,7 +19,7 @@ import QtQuick 2.0 import QtQuick.Controls 1.3 as QtControls import QtQuick.Layouts 1.0 as QtLayouts -import org.kde.plasma.desktoppanel 1.0 +import org.kde.plasma.private.desktoppanel 1.0 Item { diff --git a/sources/desktop-panel/package/contents/ui/activeapp.qml b/sources/desktop-panel/package/contents/ui/activeapp.qml index 04855f1..e894571 100644 --- a/sources/desktop-panel/package/contents/ui/activeapp.qml +++ b/sources/desktop-panel/package/contents/ui/activeapp.qml @@ -20,7 +20,7 @@ import QtQuick.Controls 1.3 as QtControls import QtQuick.Controls.Styles 1.3 as QtStyles import QtQuick.Dialogs 1.1 as QtDialogs -import org.kde.plasma.desktoppanel 1.0 +import org.kde.plasma.private.desktoppanel 1.0 Item { diff --git a/sources/desktop-panel/package/contents/ui/advanced.qml b/sources/desktop-panel/package/contents/ui/advanced.qml index 3425ac5..a8023be 100644 --- a/sources/desktop-panel/package/contents/ui/advanced.qml +++ b/sources/desktop-panel/package/contents/ui/advanced.qml @@ -20,7 +20,7 @@ import QtQuick.Controls 1.3 as QtControls import QtQuick.Controls.Styles 1.3 as QtStyles import QtQuick.Dialogs 1.1 as QtDialogs -import org.kde.plasma.desktoppanel 1.0 +import org.kde.plasma.private.desktoppanel 1.0 Item { diff --git a/sources/desktop-panel/package/contents/ui/inactiveapp.qml b/sources/desktop-panel/package/contents/ui/inactiveapp.qml index 0333632..3086751 100644 --- a/sources/desktop-panel/package/contents/ui/inactiveapp.qml +++ b/sources/desktop-panel/package/contents/ui/inactiveapp.qml @@ -20,7 +20,7 @@ import QtQuick.Controls 1.3 as QtControls import QtQuick.Controls.Styles 1.3 as QtStyles import QtQuick.Dialogs 1.1 as QtDialogs -import org.kde.plasma.desktoppanel 1.0 +import org.kde.plasma.private.desktoppanel 1.0 Item { diff --git a/sources/desktop-panel/package/contents/ui/main.qml b/sources/desktop-panel/package/contents/ui/main.qml index 3fb48c4..d4d3219 100644 --- a/sources/desktop-panel/package/contents/ui/main.qml +++ b/sources/desktop-panel/package/contents/ui/main.qml @@ -22,7 +22,7 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.desktoppanel 1.0 +import org.kde.plasma.private.desktoppanel 1.0 import "." diff --git a/sources/desktop-panel/package/contents/ui/widget.qml b/sources/desktop-panel/package/contents/ui/widget.qml index 27616be..7d4dd13 100644 --- a/sources/desktop-panel/package/contents/ui/widget.qml +++ b/sources/desktop-panel/package/contents/ui/widget.qml @@ -18,7 +18,7 @@ import QtQuick 2.0 import QtQuick.Controls 1.3 as QtControls -import org.kde.plasma.desktoppanel 1.0 +import org.kde.plasma.private.desktoppanel 1.0 Item { diff --git a/sources/desktop-panel/plugin/CMakeLists.txt b/sources/desktop-panel/plugin/CMakeLists.txt index db2ccb1..b8bd506 100644 --- a/sources/desktop-panel/plugin/CMakeLists.txt +++ b/sources/desktop-panel/plugin/CMakeLists.txt @@ -28,6 +28,6 @@ file (GLOB SUBPROJECT_NOTIFY *.notifyrc) add_library (${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE}) target_link_libraries (${PLUGIN_NAME} ${Qt_LIBRARIES} ${Kf5_LIBRARIES}) -install (TARGETS ${PLUGIN_NAME} DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/desktoppanel) -install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/desktoppanel) +install (TARGETS ${PLUGIN_NAME} DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/desktoppanel) +install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/desktoppanel) install (FILES ${SUBPROJECT_NOTIFY} DESTINATION ${KNOTIFYRC_INSTALL_DIR}) diff --git a/sources/desktop-panel/plugin/desktoppanel.cpp b/sources/desktop-panel/plugin/desktoppanel.cpp index 3ec3cb6..2e40bf0 100644 --- a/sources/desktop-panel/plugin/desktoppanel.cpp +++ b/sources/desktop-panel/plugin/desktoppanel.cpp @@ -33,7 +33,7 @@ static QObject *dpadds_singletontype_provider(QQmlEngine *engine, QJSEngine *scr void DPPlugin::registerTypes(const char *uri) { - Q_ASSERT(uri == QLatin1String("org.kde.plasma.desktoppanel")); + Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.desktoppanel")); qmlRegisterSingletonType(uri, 1, 0, "DPAdds", dpadds_singletontype_provider); } diff --git a/sources/desktop-panel/plugin/qmldir b/sources/desktop-panel/plugin/qmldir index 312f4a7..b49440a 100644 --- a/sources/desktop-panel/plugin/qmldir +++ b/sources/desktop-panel/plugin/qmldir @@ -1,3 +1,3 @@ -module org.kde.plasma.desktoppanel +module org.kde.plasma.private.desktoppanel plugin dpplugin From cd36c4ed68659a5fd2653afe3d7e2d6cf5e77790 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Sat, 11 Jul 2015 15:04:53 +0300 Subject: [PATCH 3/3] drop key definition on startup since it blocks several plasmoid instances (refer to #57) --- .../package/contents/ui/main.qml | 4 +- sources/awesome-widget/plugin/awkeys.cpp | 58 ++++--------------- sources/awesome-widget/plugin/awkeys.h | 11 +--- 3 files changed, 15 insertions(+), 58 deletions(-) diff --git a/sources/awesome-widget/package/contents/ui/main.qml b/sources/awesome-widget/package/contents/ui/main.qml index 8e4e98d..7764f07 100644 --- a/sources/awesome-widget/package/contents/ui/main.qml +++ b/sources/awesome-widget/package/contents/ui/main.qml @@ -181,7 +181,7 @@ Item { onNeedUpdate: { if (debug) console.log("[main::onNeedUpdate]") - text.text = AWKeys.parsePattern() + text.text = AWKeys.parsePattern(plasmoid.configuration.text) tooltip.text = AWKeys.toolTipImage() sizeUpdate() @@ -211,7 +211,7 @@ Item { if (debug) console.log("[main::onUserConfiguringChanged]") // init submodule - AWKeys.initKeys(plasmoid.configuration.text) + AWKeys.initKeys() AWKeys.initTooltip(tooltipSettings) AWKeys.setPopupEnabled(plasmoid.configuration.notify) AWKeys.setWrapNewLines(plasmoid.configuration.wrapNewLines) diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index b733d54..fac6a44 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -86,7 +86,7 @@ AWKeys::~AWKeys() } -void AWKeys::initKeys(const QString currentPattern) +void AWKeys::initKeys() { if (debug) qDebug() << PDEBUG; @@ -96,11 +96,8 @@ void AWKeys::initKeys(const QString currentPattern) extUpgrade.clear(); graphicalItems.clear(); keys.clear(); - foundBars.clear(); - foundKeys.clear(); // init - pattern = currentPattern; extQuotes = getExtQuotes(); extScripts = getExtScripts(); extUpgrade = getExtUpgrade(); @@ -146,17 +143,19 @@ bool AWKeys::isDebugEnabled() } -QString AWKeys::parsePattern() +QString AWKeys::parsePattern(const QString currentPattern) { if (debug) qDebug() << PDEBUG; - if (keys.isEmpty()) return pattern; + if (keys.isEmpty()) return currentPattern; - QString parsed = pattern; + QString parsed = currentPattern; parsed.replace(QString("$$"), QString("$\\$\\")); - for (int i=0; iimage(valueByKey(foundBars[i]).toFloat())); + for (int i=0; iimage(valueByKey(keys[i]).toFloat())); + else + parsed.replace(QString("$%1").arg(keys[i]), htmlValue(keys[i])); + } parsed.replace(QString("$\\$\\"), QString("$$")); // wrap new lines if required if (wrapNewLines) parsed.replace(QString("\n"), QString("
")); @@ -849,8 +848,6 @@ void AWKeys::reinitKeys() if (debug) qDebug() << PDEBUG; keys = dictKeys(); - foundBars = findGraphicalItems(); - foundKeys = findKeys(); } @@ -1325,41 +1322,6 @@ float AWKeys::temperature(const float temp, const QString units) } -QStringList AWKeys::findGraphicalItems() -{ - if (debug) qDebug() << PDEBUG; - - QStringList orderedKeys; - for (int i=0; iname() + graphicalItems[i]->bar()); - orderedKeys.sort(); - - QStringList selectedKeys; - for (int i=orderedKeys.count()-1; i>=0; i--) - if (pattern.contains(QString("$%1").arg(orderedKeys[i]))) { - if (debug) qDebug() << PDEBUG << ":" << "Found key" << orderedKeys[i]; - selectedKeys.append(orderedKeys[i]); - } - - return selectedKeys; -} - - -QStringList AWKeys::findKeys() -{ - QStringList selectedKeys; - for (int i=0; i AWKeys::getExtQuotes() { if (debug) qDebug() << PDEBUG; diff --git a/sources/awesome-widget/plugin/awkeys.h b/sources/awesome-widget/plugin/awkeys.h index 2fa7b32..d71af67 100644 --- a/sources/awesome-widget/plugin/awkeys.h +++ b/sources/awesome-widget/plugin/awkeys.h @@ -51,12 +51,12 @@ public: AWKeys(QObject *parent = nullptr); ~AWKeys(); - Q_INVOKABLE void initKeys(const QString currentPattern); + Q_INVOKABLE void initKeys(); Q_INVOKABLE void initTooltip(const QVariantMap tooltipParams); Q_INVOKABLE void setPopupEnabled(const bool popup = false); Q_INVOKABLE void setWrapNewLines(const bool wrap = false); Q_INVOKABLE bool isDebugEnabled(); - Q_INVOKABLE QString parsePattern(); + Q_INVOKABLE QString parsePattern(const QString currentPattern); Q_INVOKABLE QString toolTipImage(); Q_INVOKABLE QSize toolTipSize(); // keys @@ -93,9 +93,6 @@ private: QString htmlValue(QString key); int numberCpus(); float temperature(const float temp, const QString units); - // find methods - QStringList findGraphicalItems(); - QStringList findKeys(); // get methods QList getExtQuotes(); QList getExtScripts(); @@ -120,10 +117,8 @@ private: QList extQuotes; QList extScripts; QList extUpgrade; - QStringList foundBars, foundKeys, keys; - QString pattern; QMap values; - QStringList diskDevices, hddDevices, mountDevices, networkDevices, tempDevices; + QStringList keys, diskDevices, hddDevices, mountDevices, networkDevices, tempDevices; };