diff --git a/sources/awesome-widget/metadata.json b/sources/awesome-widget/metadata.json new file mode 100644 index 0000000..0f83643 --- /dev/null +++ b/sources/awesome-widget/metadata.json @@ -0,0 +1,29 @@ +{ + "KPlugin": { + "Authors": [ + { + "Email": "esalexeev@gmail.com", + "Name": "Evgeniy Alekseev aka arcanis" + } + ], + "Category": "System Information", + "Description": "A minimalistic Plasmoid", + "Description[en]": "A minimalistic Plasmoid", + "Description[es]": "Un script Plasmoïde minimaliste", + "Description[pt_BR]": "Um script Plasmoid", + "Description[ru]": "Минималистичный плазмоид", + "Description[uk]": "Мінімалістичний плазмоїд", + "EnabledByDefault": true, + "Icon": "utilities-system-monitor", + "Id": "org.kde.plasma.awesomewidget", + "License": "GPLv3", + "Name": "Awesome Widget", + "ServiceTypes": [ + "Plasma/Applet" + ], + "Version": "@PROJECT_VERSION@", + "Website": "https://arcanis.me/projects/awesome-widgets/" + }, + "X-Plasma-API": "declarativeappletscript", + "X-Plasma-MainScript": "ui/main.qml" +} diff --git a/sources/awesome-widget/package/contents/ui/qmldir b/sources/awesome-widget/package/contents/ui/qmldir index 2f19ff4..637924c 100644 --- a/sources/awesome-widget/package/contents/ui/qmldir +++ b/sources/awesome-widget/package/contents/ui/qmldir @@ -3,25 +3,25 @@ # common QML constants -singleton General 1.0 file:///usr/share/awesomewidgets/qml/General.qml +singleton General 1.0 file:///usr//awesomewidgets/qml/General.qml # custom QML UI classes -AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml -AWExtensions file:///usr/share/awesomewidgets/qml/AWExtensions.qml -AWInfoLabel file:///usr/share/awesomewidgets/qml/AWInfoLabel.qml -AWTagSelector file:///usr/share/awesomewidgets/qml/AWTagSelector.qml -AWTextEditor file:///usr/share/awesomewidgets/qml/AWTextEditor.qml -BugReport file:///usr/share/awesomewidgets/qml/BugReport.qml -ButtonSelector file:///usr/share/awesomewidgets/qml/ButtonSelector.qml -CheckBoxSelector file:///usr/share/awesomewidgets/qml/CheckBoxSelector.qml -ColorSelector file:///usr/share/awesomewidgets/qml/ColorSelector.qml -ComboBoxSelector file:///usr/share/awesomewidgets/qml/ComboBoxSelector.qml -ExportDialog file:///usr/share/awesomewidgets/qml/ExportDialog.qml -FontSelector file:///usr/share/awesomewidgets/qml/FontSelector.qml -HtmlDefaultFunctionsBar file:///usr/share/awesomewidgets/qml/HtmlDefaultFunctionsBar.qml -HtmlEditorButton file:///usr/share/awesomewidgets/qml/HtmlEditorButton.qml -HtmlEditorColor file:///usr/share/awesomewidgets/qml/HtmlEditorColor.qml -HtmlEditorFont file:///usr/share/awesomewidgets/qml/HtmlEditorFont.qml -ImportDialog file:///usr/share/awesomewidgets/qml/ImportDialog.qml -IntegerSelector file:///usr/share/awesomewidgets/qml/IntegerSelector.qml -LineSelector file:///usr/share/awesomewidgets/qml/LineSelector.qml +AboutTab file:///usr//awesomewidgets/qml/AboutTab.qml +AWExtensions file:///usr//awesomewidgets/qml/AWExtensions.qml +AWInfoLabel file:///usr//awesomewidgets/qml/AWInfoLabel.qml +AWTagSelector file:///usr//awesomewidgets/qml/AWTagSelector.qml +AWTextEditor file:///usr//awesomewidgets/qml/AWTextEditor.qml +BugReport file:///usr//awesomewidgets/qml/BugReport.qml +ButtonSelector file:///usr//awesomewidgets/qml/ButtonSelector.qml +CheckBoxSelector file:///usr//awesomewidgets/qml/CheckBoxSelector.qml +ColorSelector file:///usr//awesomewidgets/qml/ColorSelector.qml +ComboBoxSelector file:///usr//awesomewidgets/qml/ComboBoxSelector.qml +ExportDialog file:///usr//awesomewidgets/qml/ExportDialog.qml +FontSelector file:///usr//awesomewidgets/qml/FontSelector.qml +HtmlDefaultFunctionsBar file:///usr//awesomewidgets/qml/HtmlDefaultFunctionsBar.qml +HtmlEditorButton file:///usr//awesomewidgets/qml/HtmlEditorButton.qml +HtmlEditorColor file:///usr//awesomewidgets/qml/HtmlEditorColor.qml +HtmlEditorFont file:///usr//awesomewidgets/qml/HtmlEditorFont.qml +ImportDialog file:///usr//awesomewidgets/qml/ImportDialog.qml +IntegerSelector file:///usr//awesomewidgets/qml/IntegerSelector.qml +LineSelector file:///usr//awesomewidgets/qml/LineSelector.qml diff --git a/sources/awesome-widget/plugin/CMakeLists.txt b/sources/awesome-widget/plugin/CMakeLists.txt index 0011a9f..2fb27b5 100644 --- a/sources/awesome-widget/plugin/CMakeLists.txt +++ b/sources/awesome-widget/plugin/CMakeLists.txt @@ -7,7 +7,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../${PROJECT_LIBRARY}/ ${PROJECT_TRDPARTY_DIR} ${Qt_INCLUDE} - ${Kf5_INCLUDE} + ${Kf6_INCLUDE} ) file(GLOB SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp ${CMAKE_SOURCE_DIR}/*.cpp) @@ -16,8 +16,8 @@ file(GLOB SUBPROJECT_NOTIFY *.notifyrc) qt6_wrap_ui(SUBPROJECT_UI_HEADER ${SUBPROJECT_UI}) add_library(${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE} ${SUBPROJECT_UI_HEADER}) -target_link_libraries(${PLUGIN_NAME} ${PROJECT_LIBRARY} ${Qt_LIBRARIES} ${Kf5_LIBRARIES}) +target_link_libraries(${PLUGIN_NAME} ${PROJECT_LIBRARY} ${Qt_LIBRARIES} ${Kf6_LIBRARIES}) 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(FILES ${SUBPROJECT_NOTIFY} DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR}) diff --git a/sources/awesome-widget/plugin/awdataenginemapper.cpp b/sources/awesome-widget/plugin/awdataenginemapper.cpp index 9c2a9bd..d2fa3c3 100644 --- a/sources/awesome-widget/plugin/awdataenginemapper.cpp +++ b/sources/awesome-widget/plugin/awdataenginemapper.cpp @@ -17,7 +17,7 @@ #include "awdataenginemapper.h" -#include +#include #include "awdebug.h" #include "awformatterhelper.h" @@ -81,15 +81,15 @@ QStringList AWDataEngineMapper::registerSource(const QString &_source, const QSt qCDebug(LOG_AW) << "Source" << _source << "with units" << _units; // regular expressions - QRegExp cpuRegExp = QRegExp("cpu/cpu.*/TotalLoad"); - QRegExp cpuclRegExp = QRegExp("cpu/cpu.*/clock"); - QRegExp hddrRegExp = QRegExp("disk/.*/Rate/rblk"); - QRegExp hddwRegExp = QRegExp("disk/.*/Rate/wblk"); - QRegExp mountFillRegExp = QRegExp("partitions/.*/filllevel"); - QRegExp mountFreeRegExp = QRegExp("partitions/.*/freespace"); - QRegExp mountUsedRegExp = QRegExp("partitions/.*/usedspace"); - QRegExp netRegExp = QRegExp("network/interfaces/.*/(receiver|transmitter)/data$"); - QRegExp netTotalRegExp = QRegExp("network/interfaces/.*/(receiver|transmitter)/dataTotal$"); + auto cpuRegExp = QRegularExpression("cpu/cpu.*/TotalLoad"); + auto cpuclRegExp = QRegularExpression("cpu/cpu.*/clock"); + auto hddrRegExp = QRegularExpression("disk/.*/Rate/rblk"); + auto hddwRegExp = QRegularExpression("disk/.*/Rate/wblk"); + auto mountFillRegExp = QRegularExpression("partitions/.*/filllevel"); + auto mountFreeRegExp = QRegularExpression("partitions/.*/freespace"); + auto mountUsedRegExp = QRegularExpression("partitions/.*/usedspace"); + auto netRegExp = QRegularExpression("network/interfaces/.*/(receiver|transmitter)/data$"); + auto netTotalRegExp = QRegularExpression("network/interfaces/.*/(receiver|transmitter)/dataTotal$"); if (_source == "battery/ac") { // AC diff --git a/sources/awesome-widget/plugin/awkeycache.cpp b/sources/awesome-widget/plugin/awkeycache.cpp index d618cc2..f0985ca 100644 --- a/sources/awesome-widget/plugin/awkeycache.cpp +++ b/sources/awesome-widget/plugin/awkeycache.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -42,7 +43,7 @@ bool AWKeyCache::addKeyToCache(const QString &_type, const QString &_key) if (_type == "hdd") { QStringList allDevices = QDir("/dev").entryList(QDir::System, QDir::Name); - QStringList devices = allDevices.filter(QRegExp("^[hms]d[a-z]$")); + QStringList devices = allDevices.filter(QRegularExpression("^[hms]d[a-z]$")); for (auto &dev : devices) { QString device = QString("/dev/%1").arg(dev); if (cachedValues.contains(device)) @@ -93,7 +94,7 @@ QStringList AWKeyCache::getRequiredKeys(const QStringList &_keys, const QStringL // insert depending keys, refer to AWKeys::calculateValues() // hddtotmb* - for (auto &key : _allKeys.filter(QRegExp("^hddtotmb"))) { + for (auto &key : _allKeys.filter(QRegularExpression("^hddtotmb"))) { if (!used.contains(key)) continue; key.remove("hddtotmb"); @@ -101,7 +102,7 @@ QStringList AWKeyCache::getRequiredKeys(const QStringList &_keys, const QStringL used << QString("hddfreemb%1").arg(index) << QString("hddmb%1").arg(index); } // hddtotgb* - for (auto &key : _allKeys.filter(QRegExp("^hddtotgb"))) { + for (auto &key : _allKeys.filter(QRegularExpression("^hddtotgb"))) { if (!used.contains(key)) continue; key.remove("hddtotgb"); @@ -138,7 +139,7 @@ QStringList AWKeyCache::getRequiredKeys(const QStringList &_keys, const QStringL for (auto &key : netKeys) { if (!used.contains(key)) continue; - QStringList filt = _allKeys.filter(QRegExp(QString("^%1[0-9]{1,}").arg(key))); + QStringList filt = _allKeys.filter(QRegularExpression(QString("^%1[0-9]{1,}").arg(key))); for (auto &filtered : filt) used << filtered; } diff --git a/sources/awesome-widget/plugin/awkeyoperations.cpp b/sources/awesome-widget/plugin/awkeyoperations.cpp index b7ec39a..6f8819e 100644 --- a/sources/awesome-widget/plugin/awkeyoperations.cpp +++ b/sources/awesome-widget/plugin/awkeyoperations.cpp @@ -18,7 +18,7 @@ #include "awkeyoperations.h" #include -#include +#include #include #include "awcustomkeyshelper.h" @@ -206,7 +206,7 @@ QString AWKeyOperations::infoByKey(const QString &_key) const qCDebug(LOG_AW) << "Requested key" << _key; QString stripped = _key; - stripped.remove(QRegExp("\\d+")); + stripped.remove(QRegularExpression("\\d+")); QString output; if (_key.startsWith("bar")) { @@ -217,31 +217,31 @@ QString AWKeyOperations::infoByKey(const QString &_key) const AbstractExtItem *item = m_extScripts->itemByTag(_key, stripped); if (item) output = item->uniq(); - } else if (_key.contains(QRegExp("^hdd[rw]"))) { + } else if (_key.contains(QRegularExpression("^hdd[rw]"))) { QString index = _key; - index.remove(QRegExp("hdd[rw]")); + index.remove(QRegularExpression("hdd[rw]")); output = m_devices["disk"][index.toInt()]; - } else if (_key.contains(QRegExp("^hdd([0-9]|mb|gb|freemb|freegb|totmb|totgb)"))) { + } else if (_key.contains(QRegularExpression("^hdd([0-9]|mb|gb|freemb|freegb|totmb|totgb)"))) { QString index = _key; - index.remove(QRegExp("^hdd(|mb|gb|freemb|freegb|totmb|totgb)")); + index.remove(QRegularExpression("^hdd(|mb|gb|freemb|freegb|totmb|totgb)")); output = m_devices["mount"][index.toInt()]; } else if (_key.startsWith("hddtemp")) { QString index = _key; index.remove("hddtemp"); output = m_devices["hdd"][index.toInt()]; - } else if (_key.contains(QRegExp("^(down|up)[0-9]"))) { + } else if (_key.contains(QRegularExpression("^(down|up)[0-9]"))) { QString index = _key; - index.remove(QRegExp("^(down|up)")); + index.remove(QRegularExpression("^(down|up)")); output = m_devices["net"][index.toInt()]; } else if (_key.startsWith("pkgcount")) { AbstractExtItem *item = m_extUpgrade->itemByTag(_key, stripped); if (item) output = item->uniq(); - } else if (_key.contains(QRegExp("(^|perc)(ask|bid|price)(chg|)"))) { + } else if (_key.contains(QRegularExpression("(^|perc)(ask|bid|price)(chg|)"))) { AbstractExtItem *item = m_extQuotes->itemByTag(_key, stripped); if (item) output = item->uniq(); - } else if (_key.contains(QRegExp("(weather|weatherId|humidity|pressure|temperature)"))) { + } else if (_key.contains(QRegularExpression("(weather|weatherId|humidity|pressure|temperature)"))) { AbstractExtItem *item = m_extWeather->itemByTag(_key, stripped); if (item) output = item->uniq(); @@ -280,7 +280,7 @@ void AWKeyOperations::editItem(const QString &_type) qCDebug(LOG_AW) << "Item type" << _type; if (_type == "graphicalitem") { - QStringList keys = dictKeys().filter(QRegExp("^(cpu(?!cl).*|gpu$|mem$|swap$|hdd[0-9].*|bat.*)")); + QStringList keys = dictKeys().filter(QRegularExpression("^(cpu(?!cl).*|gpu$|mem$|swap$|hdd[0-9].*|bat.*)")); keys.sort(); m_graphicalItems->setConfigArgs(keys); return m_graphicalItems->editItems(); @@ -302,8 +302,8 @@ void AWKeyOperations::addDevice(const QString &_source) { qCDebug(LOG_AW) << "Source" << _source; - QRegExp diskRegexp = QRegExp("disk/(?:md|sd|hd)[a-z|0-9]_.*/Rate/(?:rblk)"); - QRegExp mountRegexp = QRegExp("partitions/.*/filllevel"); + auto diskRegexp = QRegularExpression("disk/(?:md|sd|hd)[a-z|0-9]_.*/Rate/(?:rblk)"); + auto mountRegexp = QRegularExpression("partitions/.*/filllevel"); if (_source.contains(diskRegexp)) { QString device = _source; diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index 922f8b6..1582ab6 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -148,7 +148,7 @@ QStringList AWKeys::dictKeys(const bool _sorted, const QString &_regexp) const if (_sorted) allKeys.sort(); - return allKeys.filter(QRegExp(_regexp)); + return allKeys.filter(QRegularExpression(_regexp)); } diff --git a/sources/awesome-widget/plugin/awpatternfunctions.cpp b/sources/awesome-widget/plugin/awpatternfunctions.cpp index 51695ef..d93c16a 100644 --- a/sources/awesome-widget/plugin/awpatternfunctions.cpp +++ b/sources/awesome-widget/plugin/awpatternfunctions.cpp @@ -130,7 +130,7 @@ QString AWPatternFunctions::insertAllKeys(QString _code, const QStringList &_key QList found = AWPatternFunctions::findFunctionCalls("aw_all", _code); for (auto &function : found) { QString separator = function.args.isEmpty() ? "," : function.args.at(0); - QStringList required = _keys.filter(QRegExp(function.body)); + QStringList required = _keys.filter(QRegularExpression(function.body)); std::for_each(required.begin(), required.end(), [](QString &value) { value = QString("%1: $%1").arg(value); }); _code.replace(function.what, required.join(separator)); @@ -146,7 +146,7 @@ QString AWPatternFunctions::insertKeyCount(QString _code, const QStringList &_ke QList found = AWPatternFunctions::findFunctionCalls("aw_count", _code); for (auto &function : found) { - int count = _keys.filter(QRegExp(function.body)).count(); + int count = _keys.filter(QRegularExpression(function.body)).count(); _code.replace(function.what, QString::number(count)); } @@ -162,7 +162,7 @@ QString AWPatternFunctions::insertKeyNames(QString _code, const QStringList &_ke QList found = AWPatternFunctions::findFunctionCalls("aw_names", _code); for (auto &function : found) { QString separator = function.args.isEmpty() ? "," : function.args.at(0); - QStringList required = _keys.filter(QRegExp(function.body)); + QStringList required = _keys.filter(QRegularExpression(function.body)); _code.replace(function.what, required.join(separator)); } @@ -178,7 +178,7 @@ QString AWPatternFunctions::insertKeys(QString _code, const QStringList &_keys) QList found = AWPatternFunctions::findFunctionCalls("aw_keys", _code); for (auto &function : found) { QString separator = function.args.isEmpty() ? "," : function.args.at(0); - QStringList required = _keys.filter(QRegExp(function.body)); + QStringList required = _keys.filter(QRegularExpression(function.body)); std::for_each(required.begin(), required.end(), [](QString &value) { value = QString("$%1").arg(value); }); _code.replace(function.what, required.join(separator)); diff --git a/sources/awesomewidgets/CMakeLists.txt b/sources/awesomewidgets/CMakeLists.txt index 5d991ab..881ec58 100644 --- a/sources/awesomewidgets/CMakeLists.txt +++ b/sources/awesomewidgets/CMakeLists.txt @@ -7,7 +7,7 @@ include_directories( ${CMAKE_BINARY_DIR} ${PROJECT_TRDPARTY_DIR} ${Qt_INCLUDE} - ${Kf5_INCLUDE} + ${Kf6_INCLUDE} ) file(GLOB SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/qreplytimeout/*.cpp ${CMAKE_SOURCE_DIR}/*.cpp) @@ -30,7 +30,7 @@ configure_file(${SUBPROJECT_WEATHER_JSON_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPR qt6_wrap_ui(SUBPROJECT_UI_HEADER ${SUBPROJECT_UI}) add_library(${SUBPROJECT} STATIC ${SUBPROJECT_SOURCE} ${SUBPROJECT_HEADER} ${SUBPROJECT_UI_HEADER}) -target_link_libraries(${SUBPROJECT} ${Qt_LIBRARIES} ${Kf5_LIBRARIES}) +target_link_libraries(${SUBPROJECT} ${Qt_LIBRARIES} ${Kf6_LIBRARIES}) # install install(DIRECTORY ${SUBPROJECT_CONFIGS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}) @@ -41,5 +41,5 @@ install(DIRECTORY ${SUBPROJECT_SCRIPTS} DESTINATION ${DATA_INSTALL_DIR}/${PROJEC install(DIRECTORY ${SUBPROJECT_REQUESTS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}) install(DIRECTORY ${SUBPROJECT_UPGRADE} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}) install(DIRECTORY ${SUBPROJECT_WEATHER} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}) -install(FILES ${SUBPROJECT_INI} DESTINATION ${KDE_INSTALL_FULL_CONFDIR}) +install(FILES ${SUBPROJECT_INI} DESTINATION ${KDE_INSTALL_CONFDIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_WEATHER_JSON} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/weather) diff --git a/sources/awesomewidgets/abstractextitem.cpp b/sources/awesomewidgets/abstractextitem.cpp index ab6ad2f..247650c 100644 --- a/sources/awesomewidgets/abstractextitem.cpp +++ b/sources/awesomewidgets/abstractextitem.cpp @@ -99,7 +99,7 @@ QString AbstractExtItem::writtableConfig() const { QString path = m_fileName; QString name = QFileInfo(path).fileName(); - path.remove(path.count() - name.count() - 1, name.count() + 1); + path.remove(path.length() - name.length() - 1, name.length() + 1); QString dir = QFileInfo(path).fileName(); return QString("%1/awesomewidgets/%2/%3") diff --git a/sources/awesomewidgets/awabstractformatter.h b/sources/awesomewidgets/awabstractformatter.h index 4da1bfc..99785c2 100644 --- a/sources/awesomewidgets/awabstractformatter.h +++ b/sources/awesomewidgets/awabstractformatter.h @@ -18,6 +18,8 @@ #ifndef AWABSTRACTFORMATTER_H #define AWABSTRACTFORMATTER_H +#include + #include "abstractextitem.h" diff --git a/sources/awesomewidgets/awjsonformatter.cpp b/sources/awesomewidgets/awjsonformatter.cpp index e0b1366..27f3413 100644 --- a/sources/awesomewidgets/awjsonformatter.cpp +++ b/sources/awesomewidgets/awjsonformatter.cpp @@ -53,7 +53,7 @@ QString AWJsonFormatter::convert(const QVariant &_value) const qCDebug(LOG_LIB) << "Convert value" << _value; // check if _value is string and parse first if required - QJsonDocument json = _value.type() == QVariant::String ? QJsonDocument::fromJson(_value.toString().toUtf8()) + QJsonDocument json = _value.userType() == QMetaType::QString ? QJsonDocument::fromJson(_value.toString().toUtf8()) : QJsonDocument::fromVariant(_value); QVariant converted = json.toVariant(); for (auto &element : m_splittedPath) @@ -147,9 +147,9 @@ QVariant AWJsonFormatter::getFromJson(const QVariant &_value, const QVariant &_e { qCDebug(LOG_LIB) << "Looking for element" << _element << "in" << _value; - if (_element.type() == QVariant::String) { + if (_element.userType() == QMetaType::QString) { return getFromMap(_value, _element.toString()); - } else if (_element.type() == QVariant::Int) { + } else if (_element.userType() == QMetaType::Int) { return getFromList(_value, _element.toInt()); } else { qCWarning(LOG_LIB) << "Unknown type" << _element.typeName(); diff --git a/sources/awesomewidgets/awlistformatter.cpp b/sources/awesomewidgets/awlistformatter.cpp index de15406..10d0e91 100644 --- a/sources/awesomewidgets/awlistformatter.cpp +++ b/sources/awesomewidgets/awlistformatter.cpp @@ -97,7 +97,7 @@ void AWListFormatter::setFilter(const QString &_filter) qCDebug(LOG_LIB) << "Filter" << _filter; m_filter = _filter; - m_regex = QRegExp(m_filter); + m_regex = QRegularExpression(m_filter); } diff --git a/sources/awesomewidgets/awlistformatter.h b/sources/awesomewidgets/awlistformatter.h index 665e54b..1732303 100644 --- a/sources/awesomewidgets/awlistformatter.h +++ b/sources/awesomewidgets/awlistformatter.h @@ -58,7 +58,7 @@ private: QString m_filter = ""; QString m_separator = ""; bool m_sorted = false; - QRegExp m_regex; + QRegularExpression m_regex; }; diff --git a/sources/awesomewidgets/extnetworkrequest.cpp b/sources/awesomewidgets/extnetworkrequest.cpp index c218b43..f496c16 100644 --- a/sources/awesomewidgets/extnetworkrequest.cpp +++ b/sources/awesomewidgets/extnetworkrequest.cpp @@ -20,9 +20,7 @@ #include -#include #include -#include #include @@ -174,7 +172,7 @@ void ExtNetworkRequest::networkReplyReceived(QNetworkReply *_reply) } m_isRunning = false; - m_values[tag("response")] = QTextCodec::codecForMib(106)->toUnicode(_reply->readAll()).trimmed(); + m_values[tag("response")] = QString::fromUtf8(_reply->readAll()).trimmed(); emit(dataReceived(m_values)); } diff --git a/sources/awesomewidgets/extscript.cpp b/sources/awesomewidgets/extscript.cpp index 007822f..27cfec8 100644 --- a/sources/awesomewidgets/extscript.cpp +++ b/sources/awesomewidgets/extscript.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include "awdebug.h" @@ -325,9 +324,9 @@ void ExtScript::startProcess() void ExtScript::updateValue() { qCInfo(LOG_LIB) << "Cmd returns" << m_process->exitCode(); - QString qdebug = QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardError()).trimmed(); + QString qdebug = QString::fromUtf8(m_process->readAllStandardError()).trimmed(); qCInfo(LOG_LIB) << "Error" << qdebug; - QString qoutput = QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardOutput()).trimmed(); + QString qoutput = QString::fromUtf8(m_process->readAllStandardOutput()).trimmed(); qCInfo(LOG_LIB) << "Output" << qoutput; QString strValue; diff --git a/sources/awesomewidgets/extupgrade.cpp b/sources/awesomewidgets/extupgrade.cpp index 433ec14..7f81025 100644 --- a/sources/awesomewidgets/extupgrade.cpp +++ b/sources/awesomewidgets/extupgrade.cpp @@ -21,7 +21,6 @@ #include #include -#include #include "awdebug.h" @@ -214,10 +213,10 @@ void ExtUpgrade::updateValue() qCInfo(LOG_LIB) << "Cmd returns" << m_process->exitCode(); qCInfo(LOG_LIB) << "Error" << m_process->readAllStandardError(); - QString qoutput = QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardOutput()).trimmed(); + QString qoutput = QString::fromUtf8(m_process->readAllStandardOutput()).trimmed(); m_values[tag("pkgcount")] = [this](const QString &output) { return filter().isEmpty() ? output.split('\n', Qt::SkipEmptyParts).count() - null() - : output.split('\n', Qt::SkipEmptyParts).filter(QRegExp(filter())).count(); + : output.split('\n', Qt::SkipEmptyParts).filter(QRegularExpression(filter())).count(); }(qoutput); emit(dataReceived(m_values)); diff --git a/sources/awesomewidgets/owmweatherprovider.cpp b/sources/awesomewidgets/owmweatherprovider.cpp index 91a849d..70d9126 100644 --- a/sources/awesomewidgets/owmweatherprovider.cpp +++ b/sources/awesomewidgets/owmweatherprovider.cpp @@ -99,7 +99,7 @@ QVariantHash OWMWeatherProvider::parseSingleJson(const QVariantMap &_json) const } // timestamp - output[tag("timestamp")] = QDateTime::fromTime_t(_json["dt"].toUInt()).toUTC(); + output[tag("timestamp")] = QDateTime::fromSecsSinceEpoch(_json["dt"].toUInt()).toUTC(); return output; } diff --git a/sources/awesomewidgets/stooqquotesprovider.cpp b/sources/awesomewidgets/stooqquotesprovider.cpp index 591d927..036adbf 100644 --- a/sources/awesomewidgets/stooqquotesprovider.cpp +++ b/sources/awesomewidgets/stooqquotesprovider.cpp @@ -17,7 +17,6 @@ #include "stooqquotesprovider.h" -#include #include #include "awdebug.h" @@ -55,7 +54,7 @@ QVariantHash StooqQuotesProvider::parse(const QByteArray &_source, const QVarian QVariantHash values; - QStringList sourceValues = QTextCodec::codecForMib(106)->toUnicode(_source).trimmed().split(','); + QStringList sourceValues = QString::fromUtf8(_source).trimmed().split(','); if (sourceValues.count() != 2) { qCWarning(LOG_LIB) << "Parse error" << sourceValues; return values; diff --git a/sources/desktop-panel/metadata.json b/sources/desktop-panel/metadata.json new file mode 100644 index 0000000..efd12be --- /dev/null +++ b/sources/desktop-panel/metadata.json @@ -0,0 +1,29 @@ +{ + "KPlugin": { + "Authors": [ + { + "Email": "esalexeev@gmail.com", + "Name": "Evgeniy Alekseev aka arcanis" + } + ], + "Category": "System Information", + "Description": "A minimalistic Plasmoid", + "Description[en]": "A minimalistic Plasmoid", + "Description[es]": "Un script Plasmoïde minimaliste", + "Description[pt_BR]": "Um script Plasmoid", + "Description[ru]": "Минималистичный плазмоид", + "Description[uk]": "Мінімалістичний плазмоїд", + "EnabledByDefault": true, + "Icon": "utilities-system-monitor", + "Id": "org.kde.plasma.desktoppanel", + "License": "GPLv3", + "Name": "Desktop Panel", + "ServiceTypes": [ + "Plasma/Applet" + ], + "Version": "@PROJECT_VERSION@", + "Website": "https://arcanis.me/projects/awesome-widgets/" + }, + "X-Plasma-API": "declarativeappletscript", + "X-Plasma-MainScript": "ui/main.qml" +} diff --git a/sources/desktop-panel/package/contents/ui/qmldir b/sources/desktop-panel/package/contents/ui/qmldir index 2f19ff4..637924c 100644 --- a/sources/desktop-panel/package/contents/ui/qmldir +++ b/sources/desktop-panel/package/contents/ui/qmldir @@ -3,25 +3,25 @@ # common QML constants -singleton General 1.0 file:///usr/share/awesomewidgets/qml/General.qml +singleton General 1.0 file:///usr//awesomewidgets/qml/General.qml # custom QML UI classes -AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml -AWExtensions file:///usr/share/awesomewidgets/qml/AWExtensions.qml -AWInfoLabel file:///usr/share/awesomewidgets/qml/AWInfoLabel.qml -AWTagSelector file:///usr/share/awesomewidgets/qml/AWTagSelector.qml -AWTextEditor file:///usr/share/awesomewidgets/qml/AWTextEditor.qml -BugReport file:///usr/share/awesomewidgets/qml/BugReport.qml -ButtonSelector file:///usr/share/awesomewidgets/qml/ButtonSelector.qml -CheckBoxSelector file:///usr/share/awesomewidgets/qml/CheckBoxSelector.qml -ColorSelector file:///usr/share/awesomewidgets/qml/ColorSelector.qml -ComboBoxSelector file:///usr/share/awesomewidgets/qml/ComboBoxSelector.qml -ExportDialog file:///usr/share/awesomewidgets/qml/ExportDialog.qml -FontSelector file:///usr/share/awesomewidgets/qml/FontSelector.qml -HtmlDefaultFunctionsBar file:///usr/share/awesomewidgets/qml/HtmlDefaultFunctionsBar.qml -HtmlEditorButton file:///usr/share/awesomewidgets/qml/HtmlEditorButton.qml -HtmlEditorColor file:///usr/share/awesomewidgets/qml/HtmlEditorColor.qml -HtmlEditorFont file:///usr/share/awesomewidgets/qml/HtmlEditorFont.qml -ImportDialog file:///usr/share/awesomewidgets/qml/ImportDialog.qml -IntegerSelector file:///usr/share/awesomewidgets/qml/IntegerSelector.qml -LineSelector file:///usr/share/awesomewidgets/qml/LineSelector.qml +AboutTab file:///usr//awesomewidgets/qml/AboutTab.qml +AWExtensions file:///usr//awesomewidgets/qml/AWExtensions.qml +AWInfoLabel file:///usr//awesomewidgets/qml/AWInfoLabel.qml +AWTagSelector file:///usr//awesomewidgets/qml/AWTagSelector.qml +AWTextEditor file:///usr//awesomewidgets/qml/AWTextEditor.qml +BugReport file:///usr//awesomewidgets/qml/BugReport.qml +ButtonSelector file:///usr//awesomewidgets/qml/ButtonSelector.qml +CheckBoxSelector file:///usr//awesomewidgets/qml/CheckBoxSelector.qml +ColorSelector file:///usr//awesomewidgets/qml/ColorSelector.qml +ComboBoxSelector file:///usr//awesomewidgets/qml/ComboBoxSelector.qml +ExportDialog file:///usr//awesomewidgets/qml/ExportDialog.qml +FontSelector file:///usr//awesomewidgets/qml/FontSelector.qml +HtmlDefaultFunctionsBar file:///usr//awesomewidgets/qml/HtmlDefaultFunctionsBar.qml +HtmlEditorButton file:///usr//awesomewidgets/qml/HtmlEditorButton.qml +HtmlEditorColor file:///usr//awesomewidgets/qml/HtmlEditorColor.qml +HtmlEditorFont file:///usr//awesomewidgets/qml/HtmlEditorFont.qml +ImportDialog file:///usr//awesomewidgets/qml/ImportDialog.qml +IntegerSelector file:///usr//awesomewidgets/qml/IntegerSelector.qml +LineSelector file:///usr//awesomewidgets/qml/LineSelector.qml diff --git a/sources/desktop-panel/plugin/CMakeLists.txt b/sources/desktop-panel/plugin/CMakeLists.txt index 34d3aad..25cf51f 100644 --- a/sources/desktop-panel/plugin/CMakeLists.txt +++ b/sources/desktop-panel/plugin/CMakeLists.txt @@ -6,15 +6,15 @@ include_directories( ${CMAKE_BINARY_DIR} ${PROJECT_TRDPARTY_DIR} ${Qt_INCLUDE} - ${Kf5_INCLUDE} + ${Kf6_INCLUDE} ) file(GLOB SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp ${CMAKE_SOURCE_DIR}/*.cpp) file(GLOB SUBPROJECT_NOTIFY *.notifyrc) add_library(${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE}) -target_link_libraries(${PLUGIN_NAME} ${Qt_LIBRARIES} ${Kf5_LIBRARIES}) +target_link_libraries(${PLUGIN_NAME} ${Qt_LIBRARIES} ${Kf6_LIBRARIES}) 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}) +install(FILES ${SUBPROJECT_NOTIFY} DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR}) diff --git a/sources/desktop-panel/plugin/dpadds.cpp b/sources/desktop-panel/plugin/dpadds.cpp index 2815425..e3632ef 100644 --- a/sources/desktop-panel/plugin/dpadds.cpp +++ b/sources/desktop-panel/plugin/dpadds.cpp @@ -92,7 +92,7 @@ QStringList DPAdds::dictKeys(const bool _sorted, const QString &_regexp) if (_sorted) allKeys.sort(); - return allKeys.filter(QRegExp(_regexp)); + return allKeys.filter(QRegularExpression(_regexp)); } diff --git a/sources/extsysmon/CMakeLists.txt b/sources/extsysmon/CMakeLists.txt index f078f0b..e7162d6 100644 --- a/sources/extsysmon/CMakeLists.txt +++ b/sources/extsysmon/CMakeLists.txt @@ -9,7 +9,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../${PROJECT_MONITORSOURCES}/ ${PROJECT_TRDPARTY_DIR} ${Qt_INCLUDE} - ${Kf5_INCLUDE} + ${Kf6_INCLUDE} ) file(GLOB SUBPROJECT_DESKTOP_IN *.desktop) @@ -25,11 +25,9 @@ configure_file(${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT add_library(${SUBPROJECT} MODULE ${SUBPROJECT_SOURCE} ${SUBPROJECT_HEADER}) target_link_libraries(${SUBPROJECT} ${PROJECT_LIBRARY} ${PROJECT_MONITORSOURCES} - ${Qt_LIBRARIES} ${Kf5_LIBRARIES}) -kcoreaddons_desktop_to_json(${SUBPROJECT} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} - SERVICE_TYPES plasma-dataengine.desktop) + ${Qt_LIBRARIES} ${Kf6_LIBRARIES}) # install install(TARGETS ${SUBPROJECT} DESTINATION ${PLUGIN_INSTALL_DIR}/plasma/dataengine) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR}) -install(FILES ${SUBPROJECT_CONF} DESTINATION ${CONFIG_INSTALL_DIR}) +#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR}) +install(FILES ${SUBPROJECT_CONF} DESTINATION ${KDE_INSTALL_CONFDIR}) diff --git a/sources/extsysmon/extsysmon.cpp b/sources/extsysmon/extsysmon.cpp index 68b5e02..e745b44 100644 --- a/sources/extsysmon/extsysmon.cpp +++ b/sources/extsysmon/extsysmon.cpp @@ -18,6 +18,7 @@ #include "extsysmon.h" #include +#include #include #include @@ -127,7 +128,7 @@ QHash ExtendedSysMon::updateConfiguration(QHash +#include class ExtSysMonAggregator; diff --git a/sources/extsysmon/plasma-dataengine-extsysmon.json b/sources/extsysmon/plasma-dataengine-extsysmon.json new file mode 100644 index 0000000..9e5441e --- /dev/null +++ b/sources/extsysmon/plasma-dataengine-extsysmon.json @@ -0,0 +1,20 @@ +{ + "KPlugin": { + "Authors": [ + { + "Email": "esalexeev@gmail.com", + "Name": "Evgeniy Alekseev aka arcanis" + } + ], + "Category": "System Information", + "Description": "Adds some additional functions to System DataEngine", + "Icon": "utilities-system-monitor", + "Id": "extsysmon", + "License": "GPL3", + "Name": "Extended SystemMonitor", + "ServiceTypes": [ + "Plasma/DataEngine" + ], + "Version": "@PROJECT_VERSION@" + } +} diff --git a/sources/extsysmonsources/CMakeLists.txt b/sources/extsysmonsources/CMakeLists.txt index b5940f7..b3fd1c7 100644 --- a/sources/extsysmonsources/CMakeLists.txt +++ b/sources/extsysmonsources/CMakeLists.txt @@ -8,11 +8,11 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../${PROJECT_LIBRARY}/ ${PROJECT_TRDPARTY_DIR} ${Qt_INCLUDE} - ${Kf5_INCLUDE} + ${Kf6_INCLUDE} ) file(GLOB SUBPROJECT_SOURCE *.cpp) file(GLOB SUBPROJECT_HEADER *.h) add_library(${SUBPROJECT} STATIC ${SUBPROJECT_SOURCE} ${SUBPROJECT_HEADER}) -target_link_libraries(${SUBPROJECT} ${PROJECT_LIBRARY} ${Qt_LIBRARIES} ${Kf5_LIBRARIES}) +target_link_libraries(${SUBPROJECT} ${PROJECT_LIBRARY} ${Qt_LIBRARIES} ${Kf6_LIBRARIES}) diff --git a/sources/extsysmonsources/abstractextsysmonsource.h b/sources/extsysmonsources/abstractextsysmonsource.h index cfe1366..72e6467 100644 --- a/sources/extsysmonsources/abstractextsysmonsource.h +++ b/sources/extsysmonsources/abstractextsysmonsource.h @@ -19,7 +19,7 @@ #define ABSTRACTEXTSYSMONSOURCE_H #include -#include +#include #include @@ -38,9 +38,8 @@ public: // used by extensions static int index(const QString &_source) { - QRegExp rx("\\d+"); - rx.indexIn(_source); - return rx.cap().toInt(); + QRegularExpression rx("\\d+"); + return rx.match(_source).captured().toInt(); } signals: diff --git a/sources/extsysmonsources/gpuloadsource.cpp b/sources/extsysmonsources/gpuloadsource.cpp index 74078df..8a2fb95 100644 --- a/sources/extsysmonsources/gpuloadsource.cpp +++ b/sources/extsysmonsources/gpuloadsource.cpp @@ -20,7 +20,6 @@ #include #include -#include #include "awdebug.h" @@ -124,9 +123,9 @@ QStringList GPULoadSource::sources() const void GPULoadSource::updateValue() { qCInfo(LOG_ESS) << "Cmd returns" << m_process->exitCode(); - QString qdebug = QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardError()).trimmed(); + QString qdebug = QString::fromUtf8(m_process->readAllStandardError()).trimmed(); qCInfo(LOG_ESS) << "Error" << qdebug; - QString qoutput = QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardOutput()).trimmed(); + QString qoutput = QString::fromUtf8(m_process->readAllStandardOutput()).trimmed(); qCInfo(LOG_ESS) << "Output" << qoutput; if (m_device == "nvidia") { diff --git a/sources/extsysmonsources/gputempsource.cpp b/sources/extsysmonsources/gputempsource.cpp index de13ff4..021a1d5 100644 --- a/sources/extsysmonsources/gputempsource.cpp +++ b/sources/extsysmonsources/gputempsource.cpp @@ -20,7 +20,6 @@ #include #include -#include #include "awdebug.h" @@ -103,9 +102,9 @@ QStringList GPUTemperatureSource::sources() const void GPUTemperatureSource::updateValue() { qCInfo(LOG_ESS) << "Cmd returns" << m_process->exitCode(); - QString qdebug = QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardError()).trimmed(); + QString qdebug = QString::fromUtf8(m_process->readAllStandardError()).trimmed(); qCInfo(LOG_ESS) << "Error" << qdebug; - QString qoutput = QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardOutput()).trimmed(); + QString qoutput = QString::fromUtf8(m_process->readAllStandardOutput()).trimmed(); qCInfo(LOG_ESS) << "Output" << qoutput; if (m_device == "nvidia") { diff --git a/sources/extsysmonsources/hddtempsource.cpp b/sources/extsysmonsources/hddtempsource.cpp index 322ffd1..6e4402f 100644 --- a/sources/extsysmonsources/hddtempsource.cpp +++ b/sources/extsysmonsources/hddtempsource.cpp @@ -20,7 +20,6 @@ #include #include -#include #include "awdebug.h" @@ -61,7 +60,7 @@ HDDTemperatureSource::~HDDTemperatureSource() QStringList HDDTemperatureSource::allHdd() { QStringList allDevices = QDir("/dev").entryList(QDir::System, QDir::Name); - QStringList devices = allDevices.filter(QRegExp("^[hms]d[a-z]$")); + QStringList devices = allDevices.filter(QRegularExpression("^[hms]d[a-z]$")); for (int i = 0; i < devices.count(); i++) devices[i] = QString("/dev/%1").arg(devices.at(i)); @@ -120,9 +119,9 @@ void HDDTemperatureSource::updateValue(const QString &_device) qCDebug(LOG_ESS) << "Called with device" << _device; qCInfo(LOG_ESS) << "Cmd returns" << m_processes[_device]->exitCode(); - QString qdebug = QTextCodec::codecForMib(106)->toUnicode(m_processes[_device]->readAllStandardError()).trimmed(); + QString qdebug = QString::fromUtf8(m_processes[_device]->readAllStandardError()).trimmed(); qCInfo(LOG_ESS) << "Error" << qdebug; - QString qoutput = QTextCodec::codecForMib(106)->toUnicode(m_processes[_device]->readAllStandardOutput()).trimmed(); + QString qoutput = QString::fromUtf8(m_processes[_device]->readAllStandardOutput()).trimmed(); qCInfo(LOG_ESS) << "Output" << qoutput; // parse diff --git a/sources/extsysmonsources/networksource.cpp b/sources/extsysmonsources/networksource.cpp index e56c7b5..b2a94cb 100644 --- a/sources/extsysmonsources/networksource.cpp +++ b/sources/extsysmonsources/networksource.cpp @@ -20,7 +20,6 @@ #include #include -#include #include "awdebug.h" @@ -101,9 +100,9 @@ QStringList NetworkSource::sources() const void NetworkSource::updateSsid() { qCInfo(LOG_ESS) << "Cmd returns" << m_process->exitCode(); - QString qdebug = QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardError()).trimmed(); + QString qdebug = QString::fromUtf8(m_process->readAllStandardError()).trimmed(); qCInfo(LOG_ESS) << "Error" << qdebug; - QString qoutput = QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardOutput()).trimmed(); + QString qoutput = QString::fromUtf8(m_process->readAllStandardOutput()).trimmed(); qCInfo(LOG_ESS) << "Output" << qoutput; m_values["network/current/ssid"] = qoutput; diff --git a/sources/extsysmonsources/playersource.cpp b/sources/extsysmonsources/playersource.cpp index b56d07e..529de9d 100644 --- a/sources/extsysmonsources/playersource.cpp +++ b/sources/extsysmonsources/playersource.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include "awdebug.h" @@ -219,7 +218,7 @@ QString PlayerSource::buildString(const QString &_current, const QString &_value qCDebug(LOG_ESS) << "Current value" << _current << "received" << _value << "will be stripped after" << _s; int index = _value.indexOf(_current); - if ((_current.isEmpty()) || ((index + _s + 1) > _value.count())) + if ((_current.isEmpty()) || ((index + _s + 1) > _value.length())) return QString("%1").arg(_value.left(_s), -_s, QLatin1Char(' ')); else return QString("%1").arg(_value.mid(index + 1, _s), -_s, QLatin1Char(' ')); @@ -230,8 +229,8 @@ QString PlayerSource::stripString(const QString &_value, const int _s) { qCDebug(LOG_ESS) << "New value" << _value << "will be stripped after" << _s; - return _value.count() > _s ? QString("%1\u2026").arg(_value.left(_s - 1)) - : _value.leftJustified(_s, QLatin1Char(' ')); + return _value.length() > _s ? QString("%1\u2026").arg(_value.left(_s - 1)) + : _value.leftJustified(_s, QLatin1Char(' ')); } @@ -249,7 +248,7 @@ void PlayerSource::mpdSocketConnected() void PlayerSource::mpdSocketReadyRead() { - QString qoutput = QTextCodec::codecForMib(106)->toUnicode(m_mpdSocket.readAll()).trimmed(); + QString qoutput = QString::fromUtf8(m_mpdSocket.readAll()).trimmed(); qCInfo(LOG_ESS) << "Output" << qoutput; // parse diff --git a/sources/extsysmonsources/processessource.cpp b/sources/extsysmonsources/processessource.cpp index 9d434e0..35c1a67 100644 --- a/sources/extsysmonsources/processessource.cpp +++ b/sources/extsysmonsources/processessource.cpp @@ -80,7 +80,7 @@ QVariantMap ProcessesSource::initialData(const QString &_source) const void ProcessesSource::run() { QStringList allDirectories = QDir("/proc").entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); - QStringList directories = allDirectories.filter(QRegExp("(\\d+)")); + QStringList directories = allDirectories.filter(QRegularExpression("(\\d+)")); QStringList running; for (auto &dir : directories) { diff --git a/sources/libraries.cmake b/sources/libraries.cmake index d4ed2b4..59e5730 100644 --- a/sources/libraries.cmake +++ b/sources/libraries.cmake @@ -25,6 +25,5 @@ find_package(Plasma REQUIRED) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings) -set(Kf6_INCLUDE ${I18n_INCLUDE_DIR} ${Notifications_INCLUDE_DIR} ${Plasma_INCLUDE_DIR}) +set(Kf6_INCLUDE ${KDE_INSTALL_FULL_INCLUDEDIR_KF}) set(Kf6_LIBRARIES KF6::I18n KF6::Notifications KF6::WindowSystem PW::LibTaskManager) - diff --git a/sources/test/CMakeLists.txt b/sources/test/CMakeLists.txt index d0318c2..ffe3962 100644 --- a/sources/test/CMakeLists.txt +++ b/sources/test/CMakeLists.txt @@ -13,16 +13,16 @@ include_directories( ${PROJECT_TRDPARTY_DIR} ${Qt_INCLUDE} ${Qt5Test_INCLUDE_DIRS} - ${Kf5_INCLUDE} + ${Kf6_INCLUDE} ) # library set(AWTESTLIBRARY_HEADERS awtestlibrary.h) set(AWTESTLIBRARY_SOURCES awtestlibrary.cpp) add_library(${SUBPROJECT}-awtest STATIC ${AWTESTLIBRARY_SOURCES} ${AWTESTLIBRARY_HEADERS}) -target_link_libraries(${SUBPROJECT}-awtest ${Qt_LIBRARIES} ${Qt5Test_LIBRARIES} ${Kf5_LIBRARIES}) +target_link_libraries(${SUBPROJECT}-awtest ${Qt_LIBRARIES} ${Qt5Test_LIBRARIES} ${Kf6_LIBRARIES}) set(LIBRARY_TEST_SET ${SUBPROJECT}-awtest ${PROJECT_LIBRARY} ${PROJECT_MONITORSOURCES} - ${Qt_LIBRARIES} ${Kf5_LIBRARIES} ${Qt5Test_LIBRARIES}) + ${Qt_LIBRARIES} ${Kf6_LIBRARIES} ${Qt5Test_LIBRARIES}) # modules set(TEST_MODULES diff --git a/sources/test/testawpatternfunctions.cpp b/sources/test/testawpatternfunctions.cpp index 80fc975..bb74038 100644 --- a/sources/test/testawpatternfunctions.cpp +++ b/sources/test/testawpatternfunctions.cpp @@ -18,6 +18,7 @@ #include "testawpatternfunctions.h" +#include #include #include "awpatternfunctions.h" @@ -57,7 +58,7 @@ void TestAWPatternFunctions::test_findKeys() QStringList allKeys; for (int i = 0; i < count; i++) { auto key = AWTestLibrary::randomString(1, 20); - while (allKeys.indexOf(QRegExp(QString("^%1.*").arg(key))) != -1) + while (allKeys.indexOf(QRegularExpression(QString("^%1.*").arg(key))) != -1) key = AWTestLibrary::randomString(1, 20); allKeys.append(key); }