From 0c443e9278e060865443c2c17d4feb0c0030fd7f Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Fri, 8 Jan 2021 10:43:37 +0300 Subject: [PATCH 1/3] do not use nodiscard for slots (#147) --- .docker/Dockerfile-ubuntu-amd64 | 12 +- .docker/Dockerfile-ubuntu-i386 | 12 -- .docker/build-ubuntu.sh | 4 +- patches/qt5.5-qstringlist-and-qinfo.patch | 33 ----- patches/qt5.6-qversionnumber.patch | 139 ------------------ sources/awesome-widget/plugin/awdbusadaptor.h | 10 +- sources/awesomewidgets/abstractextitem.h | 2 +- 7 files changed, 15 insertions(+), 197 deletions(-) delete mode 100644 .docker/Dockerfile-ubuntu-i386 delete mode 100644 patches/qt5.5-qstringlist-and-qinfo.patch delete mode 100644 patches/qt5.6-qversionnumber.patch diff --git a/.docker/Dockerfile-ubuntu-amd64 b/.docker/Dockerfile-ubuntu-amd64 index 4b955a97..adf9dfa9 100644 --- a/.docker/Dockerfile-ubuntu-amd64 +++ b/.docker/Dockerfile-ubuntu-amd64 @@ -1,12 +1,14 @@ -FROM ubuntu:bionic +FROM ubuntu:focal + +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update # toolchain -RUN apt-get install -y cmake extra-cmake-modules g++ git gettext +RUN apt-get install -yq cmake extra-cmake-modules g++ git gettext # kf5 and qt5 libraries -RUN apt-get install -y libkf5i18n-dev libkf5notifications-dev libkf5service-dev \ - libkf5windowsystem-dev plasma-framework-dev qtbase5-dev qtdeclarative5-dev \ +RUN apt-get install -yq libkf5i18n-dev libkf5notifications-dev libkf5service-dev \ + libkf5windowsystem-dev libkf5plasma-dev qtbase5-dev qtdeclarative5-dev \ plasma-framework # required by tests -RUN apt-get install -y xvfb +RUN apt-get install -yq xvfb diff --git a/.docker/Dockerfile-ubuntu-i386 b/.docker/Dockerfile-ubuntu-i386 deleted file mode 100644 index a88060dd..00000000 --- a/.docker/Dockerfile-ubuntu-i386 +++ /dev/null @@ -1,12 +0,0 @@ -FROM multiarch/ubuntu-core:i386-bionic - -RUN apt-get update -# toolchain -RUN apt-get install -y cmake extra-cmake-modules g++ git gettext -# kf5 and qt5 libraries -RUN apt-get install -y libkf5i18n-dev libkf5notifications-dev libkf5service-dev \ - libkf5windowsystem-dev plasma-framework-dev qtbase5-dev qtdeclarative5-dev \ - plasma-framework - -# required by tests -RUN apt-get install -y xvfb diff --git a/.docker/build-ubuntu.sh b/.docker/build-ubuntu.sh index 68ec9f8a..66a3a51c 100755 --- a/.docker/build-ubuntu.sh +++ b/.docker/build-ubuntu.sh @@ -6,8 +6,8 @@ rm -rf build-ubuntu mkdir build-ubuntu # patches -git apply patches/qt5.6-qversionnumber.patch -git apply patches/qt5.5-qstringlist-and-qinfo.patch +#git apply patches/qt5.6-qversionnumber.patch +#git apply patches/qt5.5-qstringlist-and-qinfo.patch # build cd build-ubuntu diff --git a/patches/qt5.5-qstringlist-and-qinfo.patch b/patches/qt5.5-qstringlist-and-qinfo.patch deleted file mode 100644 index c350a888..00000000 --- a/patches/qt5.5-qstringlist-and-qinfo.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/sources/awdebug.h b/sources/awdebug.h -index 8447c65..4eef49a 100644 ---- a/sources/awdebug.h -+++ b/sources/awdebug.h -@@ -23,10 +23,15 @@ - - #include "version.h" - -+#ifndef qCInfo -+#define qCInfo qCDebug -+#endif -+ -+ - namespace AWDebug - { - const char LOG_FORMAT[] = "[%{time " -- "process}][%{if-debug}DD%{endif}%{if-info}II%{endif}%" -+ "process}][%{if-debug}DD%{endif}%" - "{if-warning}WW%{endif}%{if-critical}CC%{endif}%{if-" - "fatal}FF%{endif}][%{category}][%{function}] " - "%{message}"; -diff --git a/sources/awesome-widget/plugin/awkeysaggregator.h b/sources/awesome-widget/plugin/awkeysaggregator.h -index d6d5d1a..ee301df 100644 ---- a/sources/awesome-widget/plugin/awkeysaggregator.h -+++ b/sources/awesome-widget/plugin/awkeysaggregator.h -@@ -21,6 +21,7 @@ - - #include - #include -+#include - - - class AWFormatterHelper; diff --git a/patches/qt5.6-qversionnumber.patch b/patches/qt5.6-qversionnumber.patch deleted file mode 100644 index 90e4785a..00000000 --- a/patches/qt5.6-qversionnumber.patch +++ /dev/null @@ -1,139 +0,0 @@ -diff --git a/sources/awesome-widget/plugin/awupdatehelper.cpp b/sources/awesome-widget/plugin/awupdatehelper.cpp -index f6b5338..b5a3163 100644 ---- a/sources/awesome-widget/plugin/awupdatehelper.cpp -+++ b/sources/awesome-widget/plugin/awupdatehelper.cpp -@@ -35,7 +35,7 @@ AWUpdateHelper::AWUpdateHelper(QObject *_parent) - { - qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - -- m_foundVersion = QVersionNumber::fromString(VERSION); -+ m_foundVersion = VERSION; - m_genericConfig = QString("%1/awesomewidgets/general.ini") - .arg(QStandardPaths::writableLocation( - QStandardPaths::GenericDataLocation)); -@@ -67,8 +67,7 @@ void AWUpdateHelper::checkUpdates(const bool _showAnyway) - bool AWUpdateHelper::checkVersion() - { - QSettings settings(m_genericConfig, QSettings::IniFormat); -- QVersionNumber version = QVersionNumber::fromString( -- settings.value("Version", QString(VERSION)).toString()); -+ QString version = settings.value("Version", VERSION).toString(); - // update version - settings.setValue("Version", QString(VERSION)); - settings.sync(); -@@ -91,12 +90,11 @@ bool AWUpdateHelper::checkVersion() - } - - --void AWUpdateHelper::showInfo(const QVersionNumber &_version) -+void AWUpdateHelper::showInfo(const QString &_version) - { - qCDebug(LOG_AW) << "Version" << _version; - -- QString text -- = i18n("You are using the actual version %1", _version.toString()); -+ QString text = i18n("You are using the actual version %1", _version); - if (!QString(COMMIT_SHA).isEmpty()) - text += QString(" (%1)").arg(QString(COMMIT_SHA)); - return genMessageBox(i18n("No new version found"), text, QMessageBox::Ok) -@@ -104,7 +102,7 @@ void AWUpdateHelper::showInfo(const QVersionNumber &_version) - } - - --void AWUpdateHelper::showUpdates(const QVersionNumber &_version) -+void AWUpdateHelper::showUpdates(const QString &_version) - { - qCDebug(LOG_AW) << "Version" << _version; - -@@ -113,7 +111,7 @@ void AWUpdateHelper::showUpdates(const QVersionNumber &_version) - text += QString(COMMIT_SHA).isEmpty() - ? "\n" - : QString(" (%1)\n").arg(QString(COMMIT_SHA)); -- text += i18n("New version : %1", _version.toString()) + "\n\n"; -+ text += i18n("New version : %1", _version) + "\n\n"; - text += i18n("Click \"Ok\" to download"); - - genMessageBox(i18n("There are updates"), text, -@@ -130,8 +128,7 @@ void AWUpdateHelper::userReplyOnUpdates(QAbstractButton *_button) - - switch (ret) { - case QMessageBox::AcceptRole: -- QDesktopServices::openUrl(QString(RELEASES) -- + m_foundVersion.toString()); -+ QDesktopServices::openUrl(QString(RELEASES) + m_foundVersion); - break; - case QMessageBox::RejectRole: - default: -@@ -162,14 +159,23 @@ void AWUpdateHelper::versionReplyRecieved(QNetworkReply *_reply, - QVariantMap firstRelease = jsonDoc.toVariant().toList().first().toMap(); - QString version = firstRelease["tag_name"].toString(); - version.remove("V."); -- m_foundVersion = QVersionNumber::fromString(version); -+ m_foundVersion = version; - qCInfo(LOG_AW) << "Update found version to" << m_foundVersion; - -- QVersionNumber oldVersion = QVersionNumber::fromString(VERSION); -- if (oldVersion < m_foundVersion) -- return showUpdates(m_foundVersion); -+ // FIXME: possible there is a better way to check versions -+ int old_major = QString(VERSION).split(QChar('.')).at(0).toInt(); -+ int old_minor = QString(VERSION).split(QChar('.')).at(1).toInt(); -+ int old_patch = QString(VERSION).split(QChar('.')).at(2).toInt(); -+ int new_major = version.split(QChar('.')).at(0).toInt(); -+ int new_minor = version.split(QChar('.')).at(1).toInt(); -+ int new_patch = version.split(QChar('.')).at(2).toInt(); -+ if ((old_major < new_major) -+ || ((old_major == new_major) && (old_minor < new_minor)) -+ || ((old_major == new_major) && (old_minor == new_minor) -+ && (old_patch < new_patch))) -+ return showUpdates(version); - else if (_showAnyway) -- return showInfo(m_foundVersion); -+ return showInfo(version); - } - - -diff --git a/sources/awesome-widget/plugin/awupdatehelper.h b/sources/awesome-widget/plugin/awupdatehelper.h -index cfd26e7..b311be2 100644 ---- a/sources/awesome-widget/plugin/awupdatehelper.h -+++ b/sources/awesome-widget/plugin/awupdatehelper.h -@@ -21,7 +21,6 @@ - - #include - #include --#include - - - class QNetworkReply; -@@ -37,15 +36,15 @@ public: - bool checkVersion(); - - private slots: -- void showInfo(const QVersionNumber &_version); -- void showUpdates(const QVersionNumber &_version); -+ void showInfo(const QString &_version); -+ void showUpdates(const QString &_version); - void userReplyOnUpdates(QAbstractButton *_button); - void versionReplyRecieved(QNetworkReply *_reply, const bool _showAnyway); - - private: - QMessageBox *genMessageBox(const QString &_title, const QString &_body, - const QMessageBox::StandardButtons _buttons); -- QVersionNumber m_foundVersion; -+ QString m_foundVersion; - QString m_genericConfig; - }; - -diff --git a/sources/libraries.cmake b/sources/libraries.cmake -index 6f171a6..004b39f 100644 ---- a/sources/libraries.cmake -+++ b/sources/libraries.cmake -@@ -2,7 +2,7 @@ - find_package(Gettext REQUIRED) - - # main qt libraries --find_package(Qt5 5.6.0 REQUIRED COMPONENTS Core DBus Network Qml Test Widgets) -+find_package(Qt5 5.5.0 REQUIRED COMPONENTS Core DBus Network Qml Test Widgets) - add_definitions( - ${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS} ${Qt5Network_DEFINITIONS} - ${Qt5Qml_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} diff --git a/sources/awesome-widget/plugin/awdbusadaptor.h b/sources/awesome-widget/plugin/awdbusadaptor.h index 2f55f485..464451e3 100644 --- a/sources/awesome-widget/plugin/awdbusadaptor.h +++ b/sources/awesome-widget/plugin/awdbusadaptor.h @@ -37,11 +37,11 @@ class AWDBusAdaptor : public QDBusAbstractAdaptor public slots: // get methods - [[nodiscard]] QStringList ActiveServices() const; - [[nodiscard]] QString Info(const QString &key) const; - [[nodiscard]] QStringList Keys(const QString ®exp) const; - [[nodiscard]] QString Value(const QString &key) const; - [[nodiscard]] qlonglong WhoAmI() const; + QStringList ActiveServices() const; + QString Info(const QString &key) const; + QStringList Keys(const QString ®exp) const; + QString Value(const QString &key) const; + qlonglong WhoAmI() const; // set methods void SetLogLevel(const QString &what, int level); void SetLogLevel(const QString &what, const QString &level, bool enabled); diff --git a/sources/awesomewidgets/abstractextitem.h b/sources/awesomewidgets/abstractextitem.h index 91fe6208..e01fe250 100644 --- a/sources/awesomewidgets/abstractextitem.h +++ b/sources/awesomewidgets/abstractextitem.h @@ -79,7 +79,7 @@ public slots: virtual void readConfiguration(); virtual QVariantHash run() = 0; virtual int showConfiguration(const QVariant &_args) = 0; - [[nodiscard]] virtual bool tryDelete() const; + virtual bool tryDelete() const; virtual void writeConfiguration() const; private slots: From 883659272ddd8f4d3cc1fc2235a5361086179501 Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Fri, 8 Jan 2021 11:17:11 +0300 Subject: [PATCH 2/3] add patch for qt < 5.14 --- .docker/build-ubuntu-package.sh | 3 +- .docker/build-ubuntu.sh | 3 +- patches/qt5.14-splitbehavior-and-qset.patch | 255 ++++++++++++++++++++ 3 files changed, 257 insertions(+), 4 deletions(-) create mode 100644 patches/qt5.14-splitbehavior-and-qset.patch diff --git a/.docker/build-ubuntu-package.sh b/.docker/build-ubuntu-package.sh index 8cf23729..e3a29d2f 100755 --- a/.docker/build-ubuntu-package.sh +++ b/.docker/build-ubuntu-package.sh @@ -6,8 +6,7 @@ rm -rf build-ubuntu mkdir build-ubuntu # patches -#git apply patches/qt5.6-qversionnumber.patch -#git apply patches/qt5.5-qstringlist-and-qinfo.patch +git apply patches/qt5.14-splitbehavior-and-qset.patch # build cd build-ubuntu diff --git a/.docker/build-ubuntu.sh b/.docker/build-ubuntu.sh index 66a3a51c..9b5e97a9 100755 --- a/.docker/build-ubuntu.sh +++ b/.docker/build-ubuntu.sh @@ -6,8 +6,7 @@ rm -rf build-ubuntu mkdir build-ubuntu # patches -#git apply patches/qt5.6-qversionnumber.patch -#git apply patches/qt5.5-qstringlist-and-qinfo.patch +git apply patches/qt5.14-splitbehavior-and-qset.patch # build cd build-ubuntu diff --git a/patches/qt5.14-splitbehavior-and-qset.patch b/patches/qt5.14-splitbehavior-and-qset.patch new file mode 100644 index 00000000..c2103034 --- /dev/null +++ b/patches/qt5.14-splitbehavior-and-qset.patch @@ -0,0 +1,255 @@ +diff --git a/.docker/build-ubuntu.sh b/.docker/build-ubuntu.sh +index 9b5e97a..b953425 100755 +--- a/.docker/build-ubuntu.sh ++++ b/.docker/build-ubuntu.sh +@@ -6,7 +6,7 @@ rm -rf build-ubuntu + mkdir build-ubuntu + + # patches +-git apply patches/qt5.14-splitbehavior-and-qset.patch ++#git apply patches/qt5.14-splitbehavior-and-qset.patch + + # build + cd build-ubuntu +diff --git a/sources/awdebug.cpp b/sources/awdebug.cpp +index 7135db6..a2870ec 100644 +--- a/sources/awdebug.cpp ++++ b/sources/awdebug.cpp +@@ -67,7 +67,7 @@ QString AWDebug::getAboutText(const QString &_type) + translator = QString("
  • %1
  • ").arg(translator); + text = i18n("Translators:") + "
      " + translatorList.join("") + "
    "; + } else if (_type == "3rdparty") { +- QStringList trdPartyList = QString(TRDPARTY_LICENSE).split(';', Qt::SkipEmptyParts); ++ QStringList trdPartyList = QString(TRDPARTY_LICENSE).split(';', QString::SkipEmptyParts); + for (int i = 0; i < trdPartyList.count(); i++) + trdPartyList[i] = QString("
  • %1 (%2 license)
  • ") + .arg(trdPartyList.at(i).split(',')[0]) +@@ -75,7 +75,7 @@ QString AWDebug::getAboutText(const QString &_type) + .arg(trdPartyList.at(i).split(',')[2]); + text = i18n("This software uses:") + "
      " + trdPartyList.join("") + "
    "; + } else if (_type == "thanks") { +- QStringList thanks = QString(SPECIAL_THANKS).split(';', Qt::SkipEmptyParts); ++ QStringList thanks = QString(SPECIAL_THANKS).split(';', QString::SkipEmptyParts); + for (int i = 0; i < thanks.count(); i++) + thanks[i] = QString("
  • %1
  • ") + .arg(thanks.at(i).split(',')[0]) +diff --git a/sources/awesome-widget/plugin/awabstractpairhelper.cpp b/sources/awesome-widget/plugin/awabstractpairhelper.cpp +index 55a4e91..f7c2969 100644 +--- a/sources/awesome-widget/plugin/awabstractpairhelper.cpp ++++ b/sources/awesome-widget/plugin/awabstractpairhelper.cpp +@@ -61,7 +61,7 @@ QStringList AWAbstractPairHelper::values() const + QSet AWAbstractPairHelper::valuesSet() const + { + auto values = m_pairs.values(); +- return QSet(values.cbegin(), values.cend()); ++ return QSet::fromList(values); + } + + +@@ -138,4 +138,4 @@ bool AWAbstractPairHelper::removeUnusedKeys(const QStringList &_keys) const + settings.sync(); + + return (settings.status() == QSettings::NoError); +-} +\ No newline at end of file ++} +diff --git a/sources/awesome-widget/plugin/awkeycache.cpp b/sources/awesome-widget/plugin/awkeycache.cpp +index 15aab94..54b47b3 100644 +--- a/sources/awesome-widget/plugin/awkeycache.cpp ++++ b/sources/awesome-widget/plugin/awkeycache.cpp +@@ -83,9 +83,9 @@ QStringList AWKeyCache::getRequiredKeys(const QStringList &_keys, const QStringL + << _tooltip; + + // initial copy +- QSet used(_keys.cbegin(), _keys.cend()); +- used.unite(QSet(_bars.cbegin(), _bars.cend())); +- used.unite(QSet(_userKeys.cbegin(), _userKeys.cend())); ++ auto used = QSet::fromList(_keys); ++ used.unite(QSet::fromList(_bars)); ++ used.unite(QSet::fromList(_userKeys)); + // insert keys from tooltip + for (auto &key : _tooltip.keys()) { + if ((key.endsWith("Tooltip")) && (_tooltip[key].toBool())) { +diff --git a/sources/awesomewidgets/awjsonformatter.cpp b/sources/awesomewidgets/awjsonformatter.cpp +index bbdd7ce..8a1c5e0 100644 +--- a/sources/awesomewidgets/awjsonformatter.cpp ++++ b/sources/awesomewidgets/awjsonformatter.cpp +@@ -178,7 +178,7 @@ QVariant AWJsonFormatter::getFromMap(const QVariant &_value, const QString &_key + void AWJsonFormatter::initPath() + { + m_splittedPath.clear(); +- QStringList splittedByDot = m_path.split('.', Qt::SkipEmptyParts); ++ QStringList splittedByDot = m_path.split('.', QString::SkipEmptyParts); + + for (auto &element : splittedByDot) { + bool ok; +diff --git a/sources/awesomewidgets/extscript.cpp b/sources/awesomewidgets/extscript.cpp +index 3017dac..da009f9 100644 +--- a/sources/awesomewidgets/extscript.cpp ++++ b/sources/awesomewidgets/extscript.cpp +@@ -218,7 +218,7 @@ void ExtScript::readConfiguration() + setExecutable(settings.value("Exec", executable()).toString()); + setStrRedirect(settings.value("X-AW-Redirect", strRedirect()).toString()); + // api == 3 +- setFilters(settings.value("X-AW-Filters", filters()).toString().split(',', Qt::SkipEmptyParts)); ++ setFilters(settings.value("X-AW-Filters", filters()).toString().split(',', QString::SkipEmptyParts)); + settings.endGroup(); + + bumpApi(AW_EXTSCRIPT_API); +diff --git a/sources/awesomewidgets/extupgrade.cpp b/sources/awesomewidgets/extupgrade.cpp +index 0195779..0081cc9 100644 +--- a/sources/awesomewidgets/extupgrade.cpp ++++ b/sources/awesomewidgets/extupgrade.cpp +@@ -219,8 +219,8 @@ void ExtUpgrade::updateValue() + = QTextCodec::codecForMib(106)->toUnicode(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', QString::SkipEmptyParts).count() - null() ++ : output.split('\n', QString::SkipEmptyParts).filter(QRegExp(filter())).count(); + }(qoutput); + + emit(dataReceived(m_values)); +diff --git a/sources/awesomewidgets/qcronscheduler.cpp b/sources/awesomewidgets/qcronscheduler.cpp +index 6f67590..c72abc9 100644 +--- a/sources/awesomewidgets/qcronscheduler.cpp ++++ b/sources/awesomewidgets/qcronscheduler.cpp +@@ -87,7 +87,7 @@ QList QCronScheduler::parseField(const QString &_value, const int _min, con + parsedField.fromRange(field.split('/').first(), _min, _max); + if (field.contains('/')) { + bool status; +- parsedField.div = field.split('/', Qt::SkipEmptyParts).at(1).toInt(&status); ++ parsedField.div = field.split('/', QString::SkipEmptyParts).at(1).toInt(&status); + if (!status) + parsedField.div = 1; + } +@@ -107,7 +107,7 @@ void QCronScheduler::QCronField::fromRange(const QString &_range, const int _min + minValue = _min; + maxValue = _max; + } else if (_range.contains("-")) { +- auto interval = _range.split('-', Qt::SkipEmptyParts); ++ auto interval = _range.split('-', QString::SkipEmptyParts); + if (interval.count() != 2) + return; + bool status; +diff --git a/sources/extsysmon/extsysmon.cpp b/sources/extsysmon/extsysmon.cpp +index 88b6e39..5bdc7f3 100644 +--- a/sources/extsysmon/extsysmon.cpp ++++ b/sources/extsysmon/extsysmon.cpp +@@ -126,7 +126,7 @@ QHash ExtendedSysMon::updateConfiguration(QHash")) + continue; + auto load = str.remove("").remove("").remove('%'); +@@ -140,10 +140,10 @@ void GPULoadSource::updateValue() + break; + } + } else if (m_device == "ati") { +- for (auto &str : qoutput.split('\n', Qt::SkipEmptyParts)) { ++ for (auto &str : qoutput.split('\n', QString::SkipEmptyParts)) { + if (!str.contains("load")) + continue; +- QString load = str.split(' ', Qt::SkipEmptyParts)[3].remove('%'); ++ QString load = str.split(' ', QString::SkipEmptyParts)[3].remove('%'); + m_values["gpu/load"] = load.toFloat(); + break; + } +diff --git a/sources/extsysmonsources/gputempsource.cpp b/sources/extsysmonsources/gputempsource.cpp +index 55fbadc..dce0c6e 100644 +--- a/sources/extsysmonsources/gputempsource.cpp ++++ b/sources/extsysmonsources/gputempsource.cpp +@@ -112,7 +112,7 @@ void GPUTemperatureSource::updateValue() + qCInfo(LOG_ESS) << "Output" << qoutput; + + if (m_device == "nvidia") { +- for (auto &str : qoutput.split('\n', Qt::SkipEmptyParts)) { ++ for (auto &str : qoutput.split('\n', QString::SkipEmptyParts)) { + if (!str.contains("")) + continue; + QString temp = str.remove("").remove("C"); +@@ -120,10 +120,10 @@ void GPUTemperatureSource::updateValue() + break; + } + } else if (m_device == "ati") { +- for (auto &str : qoutput.split('\n', Qt::SkipEmptyParts)) { ++ for (auto &str : qoutput.split('\n', QString::SkipEmptyParts)) { + if (!str.contains("Temperature")) + continue; +- QString temp = str.split(' ', Qt::SkipEmptyParts).at(4); ++ QString temp = str.split(' ', QString::SkipEmptyParts).at(4); + m_values["gpu/temperature"] = temp.toFloat(); + break; + } +diff --git a/sources/extsysmonsources/hddtempsource.cpp b/sources/extsysmonsources/hddtempsource.cpp +index efaae08..dad47a3 100644 +--- a/sources/extsysmonsources/hddtempsource.cpp ++++ b/sources/extsysmonsources/hddtempsource.cpp +@@ -31,7 +31,7 @@ HDDTemperatureSource::HDDTemperatureSource(QObject *_parent, const QStringList & + Q_ASSERT(_args.count() == 2); + qCDebug(LOG_ESS) << __PRETTY_FUNCTION__; + +- m_devices = _args.at(0).split(',', Qt::SkipEmptyParts); ++ m_devices = _args.at(0).split(',', QString::SkipEmptyParts); + m_cmd = _args.at(1).split(' '); // lets hope no one put cmd with spaces here lol + + m_smartctl = m_cmd.contains("smartctl"); +@@ -131,17 +131,17 @@ void HDDTemperatureSource::updateValue(const QString &_device) + + // parse + if (m_smartctl) { +- QStringList lines = qoutput.split('\n', Qt::SkipEmptyParts); ++ QStringList lines = qoutput.split('\n', QString::SkipEmptyParts); + for (auto &str : lines) { + if (!str.startsWith("194")) + continue; +- if (str.split(' ', Qt::SkipEmptyParts).count() < 9) ++ if (str.split(' ', QString::SkipEmptyParts).count() < 9) + continue; +- m_values[_device] = str.split(' ', Qt::SkipEmptyParts).at(9).toFloat(); ++ m_values[_device] = str.split(' ', QString::SkipEmptyParts).at(9).toFloat(); + break; + } + } else { +- QStringList lines = qoutput.split(':', Qt::SkipEmptyParts); ++ QStringList lines = qoutput.split(':', QString::SkipEmptyParts); + if (lines.count() >= 3) { + QString temp = lines.at(2); + temp.remove(QChar(0260)).remove('C'); +diff --git a/sources/extsysmonsources/playersource.cpp b/sources/extsysmonsources/playersource.cpp +index aaca22f..e127a05 100644 +--- a/sources/extsysmonsources/playersource.cpp ++++ b/sources/extsysmonsources/playersource.cpp +@@ -256,11 +256,11 @@ void PlayerSource::mpdSocketReadyRead() + qCInfo(LOG_ESS) << "Output" << qoutput; + + // parse +- for (auto &str : qoutput.split('\n', Qt::SkipEmptyParts)) { +- if (str.split(": ", Qt::SkipEmptyParts).count() == 2) { ++ for (auto &str : qoutput.split('\n', QString::SkipEmptyParts)) { ++ if (str.split(": ", QString::SkipEmptyParts).count() == 2) { + // "Metadata: data" +- QString metadata = str.split(": ", Qt::SkipEmptyParts).first().toLower(); +- QString data = str.split(": ", Qt::SkipEmptyParts).last().trimmed(); ++ QString metadata = str.split(": ", QString::SkipEmptyParts).first().toLower(); ++ QString data = str.split(": ", QString::SkipEmptyParts).last().trimmed(); + // there are one more time... + if ((metadata == "time") && (data.contains(':'))) { + QStringList times = data.split(':'); From de9d90df4a1a9fabebf839951e5e820ea3ed6d91 Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Fri, 8 Jan 2021 15:48:20 +0300 Subject: [PATCH 3/3] Release 3.4.3 compilation fixes for old ubuntu and provide patch for old qt versions --- packages/PKGBUILD | 4 +-- patches/qt5.14-splitbehavior-and-qset.patch | 26 +++++++++---------- sources/CMakeLists.txt | 2 +- .../awesome-widget/package/metadata.desktop | 2 +- .../desktop-panel/package/metadata.desktop | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/PKGBUILD b/packages/PKGBUILD index 26e7ec51..75df22ed 100644 --- a/packages/PKGBUILD +++ b/packages/PKGBUILD @@ -2,7 +2,7 @@ pkgname=plasma5-applet-awesome-widgets _pkgname=awesome-widgets -pkgver=3.4.2 +pkgver=3.4.3 pkgrel=1 pkgdesc="Collection of minimalistic Plasmoids which look like Awesome WM widgets (ex-PyTextMonitor)" arch=('i686' 'x86_64') @@ -17,7 +17,7 @@ optdepends=("catalyst: for GPU monitor" makedepends=('cmake' 'extra-cmake-modules' 'python') source=(https://github.com/arcan1s/awesome-widgets/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz) install=${pkgname}.install -md5sums=('df3ad1c626fdc1893f0f6e0b0fe636c2') +md5sums=('5953ba518191bb6fff83cdb8633c735c') backup=('etc/xdg/plasma-dataengine-extsysmon.conf') prepare() { diff --git a/patches/qt5.14-splitbehavior-and-qset.patch b/patches/qt5.14-splitbehavior-and-qset.patch index c2103034..de2d300e 100644 --- a/patches/qt5.14-splitbehavior-and-qset.patch +++ b/patches/qt5.14-splitbehavior-and-qset.patch @@ -1,16 +1,3 @@ -diff --git a/.docker/build-ubuntu.sh b/.docker/build-ubuntu.sh -index 9b5e97a..b953425 100755 ---- a/.docker/build-ubuntu.sh -+++ b/.docker/build-ubuntu.sh -@@ -6,7 +6,7 @@ rm -rf build-ubuntu - mkdir build-ubuntu - - # patches --git apply patches/qt5.14-splitbehavior-and-qset.patch -+#git apply patches/qt5.14-splitbehavior-and-qset.patch - - # build - cd build-ubuntu diff --git a/sources/awdebug.cpp b/sources/awdebug.cpp index 7135db6..a2870ec 100644 --- a/sources/awdebug.cpp @@ -253,3 +240,16 @@ index aaca22f..e127a05 100644 // there are one more time... if ((metadata == "time") && (data.contains(':'))) { QStringList times = data.split(':'); +diff --git a/sources/test/testawtelemetryhandler.cpp b/sources/test/testawtelemetryhandler.cpp +index ffb0e79..b4181e0 100644 +--- a/sources/test/testawtelemetryhandler.cpp ++++ b/sources/test/testawtelemetryhandler.cpp +@@ -51,7 +51,7 @@ void TestAWTelemetryHandler::test_get() + QStringList output = plugin->get(telemetryGroup); + + QVERIFY(!output.isEmpty()); +- QCOMPARE(QSet(output.cbegin(), output.cend()).count(), output.count()); ++ QCOMPARE(QSet::fromList(output).count(), output.count()); + QVERIFY(output.contains(telemetryData)); + } + diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt index 771e8a93..663ab5e2 100644 --- a/sources/CMakeLists.txt +++ b/sources/CMakeLists.txt @@ -16,7 +16,7 @@ set(PROJECT_CONTACT "esalexeev@gmail.com") set(PROJECT_LICENSE "GPL3") set(PROJECT_VERSION_MAJOR "3") set(PROJECT_VERSION_MINOR "4") -set(PROJECT_VERSION_PATCH "2") +set(PROJECT_VERSION_PATCH "3") set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") # append git version if any set(PROJECT_COMMIT_SHA "Commit hash" CACHE INTERNAL "") diff --git a/sources/awesome-widget/package/metadata.desktop b/sources/awesome-widget/package/metadata.desktop index 4d9ea660..461fcb42 100644 --- a/sources/awesome-widget/package/metadata.desktop +++ b/sources/awesome-widget/package/metadata.desktop @@ -19,7 +19,7 @@ X-Plasma-MainScript=ui/main.qml X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis X-KDE-PluginInfo-Email=esalexeev@gmail.com X-KDE-PluginInfo-Name=org.kde.plasma.awesomewidget -X-KDE-PluginInfo-Version=3.4.2 +X-KDE-PluginInfo-Version=3.4.3 X-KDE-PluginInfo-Website=https://arcanis.me/projects/awesome-widgets/ X-KDE-PluginInfo-Category=System Information X-KDE-PluginInfo-Depends= diff --git a/sources/desktop-panel/package/metadata.desktop b/sources/desktop-panel/package/metadata.desktop index 241c30ca..6ffb9c4e 100644 --- a/sources/desktop-panel/package/metadata.desktop +++ b/sources/desktop-panel/package/metadata.desktop @@ -19,7 +19,7 @@ X-Plasma-MainScript=ui/main.qml X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis X-KDE-PluginInfo-Email=esalexeev@gmail.com X-KDE-PluginInfo-Name=org.kde.plasma.desktoppanel -X-KDE-PluginInfo-Version=3.4.2 +X-KDE-PluginInfo-Version=3.4.3 X-KDE-PluginInfo-Website=https://arcanis.me/projects/awesome-widgets/ X-KDE-PluginInfo-Category=System Information X-KDE-PluginInfo-Depends=