diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c630f00..f9fd9d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,10 +27,10 @@ jobs: run: pacman -Sy --noconfirm base-devel cmake extra-cmake-modules python util-linux-libs xorg-server-xvfb - name: install dependencies - run: pacman -S --noconfirm plasma-workspace ksysguard + run: pacman -S --noconfirm plasma-workspace - name: configure cmake - run: cmake -B build -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_FUTURE=ON -DBUILD_TESTING=ON sources + run: cmake -B build -S sources -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_FUTURE=ON -DBUILD_TESTING=ON - name: build working-directory: /repo/build diff --git a/sources/awesome-widget/plugin/awkeyoperations.cpp b/sources/awesome-widget/plugin/awkeyoperations.cpp index 6f8c89e..663272f 100644 --- a/sources/awesome-widget/plugin/awkeyoperations.cpp +++ b/sources/awesome-widget/plugin/awkeyoperations.cpp @@ -130,9 +130,8 @@ QStringList AWKeyOperations::dictKeys() const allKeys.append(QString("up%1").arg(i)); } // battery - auto allBatteryDevices - = QDir("/sys/class/power_supply") - .entryList(QStringList({"BAT*"}), QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); + auto allBatteryDevices = QDir("/sys/class/power_supply") + .entryList(QStringList({"BAT*"}), QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); for (int i = 0; i < allBatteryDevices.count(); i++) { allKeys.append(QString("bat%1").arg(i)); allKeys.append(QString("batleft%1").arg(i)); diff --git a/sources/extsysmon/extsysmonaggregator.cpp b/sources/extsysmon/extsysmonaggregator.cpp index 64200f8..93e0280 100644 --- a/sources/extsysmon/extsysmonaggregator.cpp +++ b/sources/extsysmon/extsysmonaggregator.cpp @@ -62,7 +62,7 @@ void ExtSysMonAggregator::init(const QHash &_config) createSensor("custom", i18n("Scripts"), new CustomSource(this, {})); // desktop // FIXME causes segfault in kde libs -// createSensor("desktop", i18n("Desktop"), new DesktopSource(this, {})); + // createSensor("desktop", i18n("Desktop"), new DesktopSource(this, {})); // network createSensor("network", i18n("Network"), new NetworkSource(this, {})); // player diff --git a/sources/test/testdatetimeformatter.cpp b/sources/test/testdatetimeformatter.cpp index 501d6a7..f102793 100644 --- a/sources/test/testdatetimeformatter.cpp +++ b/sources/test/testdatetimeformatter.cpp @@ -49,15 +49,15 @@ void TestAWDateTimeFormatter::test_values() void TestAWDateTimeFormatter::test_conversion() { - QDateTime now = QDateTime::currentDateTime(); - QCOMPARE(formatter->convert(now), now.toString(format)); + auto now = QDateTime::currentDateTime(); + QCOMPARE(formatter->convert(now), QLocale::system().toString(now, format)); } void TestAWDateTimeFormatter::test_copy() { formatter->setTranslateString(false); - AWDateTimeFormatter *newFormatter = formatter->copy("/dev/null", 1); + auto *newFormatter = formatter->copy("/dev/null", 1); QCOMPARE(newFormatter->format(), formatter->format()); QCOMPARE(newFormatter->translateString(), formatter->translateString()); diff --git a/sources/test/testnetworksource.cpp b/sources/test/testnetworksource.cpp index ee3a7db..db41e24 100644 --- a/sources/test/testnetworksource.cpp +++ b/sources/test/testnetworksource.cpp @@ -39,13 +39,13 @@ void TestNetworkSource::cleanupTestCase() void TestNetworkSource::test_sources() { - QCOMPARE(source->sources(), QStringList() << src << "network/current/ssid"); + QCOMPARE(source->sources(), QStringList({"device", "ssid"})); } void TestNetworkSource::test_values() { - QVERIFY(source->data(src).toString().count() > 0); + QVERIFY(source->data("device").toString().length() > 0); } diff --git a/sources/test/testnetworksource.h b/sources/test/testnetworksource.h index c467e3f..6f86fe1 100644 --- a/sources/test/testnetworksource.h +++ b/sources/test/testnetworksource.h @@ -38,7 +38,6 @@ private slots: private: NetworkSource *source = nullptr; - QString src = "network/current/name"; }; diff --git a/sources/test/testplayersource.cpp b/sources/test/testplayersource.cpp index ab7f26b..a132f21 100644 --- a/sources/test/testplayersource.cpp +++ b/sources/test/testplayersource.cpp @@ -43,23 +43,23 @@ void TestPlayerSource::test_buildString() { QString randomString = AWTestLibrary::randomString(1, 40); QString str = PlayerSource::buildString("", randomString, 20); - QCOMPARE(str.count(), 20); + QCOMPARE(str.length(), 20); str = PlayerSource::buildString(str, randomString, 20); - QCOMPARE(str.count(), 20); + QCOMPARE(str.length(), 20); str = PlayerSource::buildString("", AWTestLibrary::randomString(1, 10), 20); - QCOMPARE(str.count(), 20); + QCOMPARE(str.length(), 20); } void TestPlayerSource::test_stripString() { QString str = PlayerSource::buildString("", AWTestLibrary::randomString(1, 40), 20); - QCOMPARE(str.count(), 20); + QCOMPARE(str.length(), 20); str = PlayerSource::buildString("", AWTestLibrary::randomString(1, 10), 20); - QCOMPARE(str.count(), 20); + QCOMPARE(str.length(), 20); } @@ -85,7 +85,7 @@ void TestPlayerSource::test_mpd() // init spy QSignalSpy spy(source, SIGNAL(dataReceived(const QVariantHash &))); - QVariant firstValue = source->data("player/title"); + QVariant firstValue = source->data("title"); if (!source->isMpdSocketConnected()) QSKIP("No mpd found"); @@ -95,10 +95,10 @@ void TestPlayerSource::test_mpd() QVariantHash secondValue = arguments.at(0).toHash(); // actually nothing to test here just print warning if no information found - if (secondValue["player/title"].toString() == "unknown") + if (secondValue["title"].toString() == "unknown") QSKIP("No mpd found"); - QVERIFY(secondValue["player/progress"].toInt() < secondValue["player/duration"].toInt()); + QVERIFY(secondValue["progress"].toInt() < secondValue["duration"].toInt()); } @@ -109,9 +109,9 @@ void TestPlayerSource::test_mpris() PlayerSource *source = new PlayerSource(this, args); _test_sources(source); - QString value = source->data("player/title").toString(); - int progress = source->data("player/progress").toInt(); - int duration = source->data("player/duration").toInt(); + QString value = source->data("title").toString(); + int progress = source->data("progress").toInt(); + int duration = source->data("duration").toInt(); // actually nothing to test here just print warning if no information found if (value == "unknown") diff --git a/sources/test/testprocessessource.cpp b/sources/test/testprocessessource.cpp index 1fdce78..6272ce2 100644 --- a/sources/test/testprocessessource.cpp +++ b/sources/test/testprocessessource.cpp @@ -45,9 +45,9 @@ void TestProcessesSource::test_sources() void TestProcessesSource::test_values() { - QVERIFY(source->data("ps/running/count").toInt() > 0); - QVERIFY(source->data("ps/running/list").toStringList().count() > 0); - QVERIFY(source->data("ps/total/count").toInt() > 0); + QVERIFY(source->data("running").toInt() > 0); + QVERIFY(source->data("list").toStringList().count() > 0); + QVERIFY(source->data("count").toInt() > 0); }