[plasma/print-manager] src/kded: kded: Rename class MarkerLevelChecker to CupsWatcher

Mike Noe <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 13499b5f91eb35e5db3e1472b508e523f711c77d by Mike Noe.
Committed on 20/07/2026 at 14:00.
Pushed by noee into branch 'master'.

kded: Rename class MarkerLevelChecker to CupsWatcher

Make the class more generic as it will assumed other
"checking" duties in future MRs

M  +2    -2    src/kded/CMakeLists.txt
R  +16   -16   src/kded/CupsWatcher.cpp [from: src/kded/MarkerLevelChecker.cpp - 070% similarity]
R  +4    -4    src/kded/CupsWatcher.h [from: src/kded/MarkerLevelChecker.h - 085% similarity]
M  +2    -2    src/kded/PrintManagerKded.cpp

https://invent.kde.org/plasma/print-manager/-/commit/13499b5f91eb35e5db3e1472b508e523f711c77d

diff --git a/src/kded/CMakeLists.txt b/src/kded/CMakeLists.txt
index 75a4907f..eba991de 100644
--- a/src/kded/CMakeLists.txt
+++ b/src/kded/CMakeLists.txt
@@ -3,8 +3,8 @@ set(printmanagerkded_SRCS
     PrintManagerKded.cpp
     NewPrinterNotification.h
     PrintManagerKded.h
-    MarkerLevelChecker.cpp
-    MarkerLevelChecker.h
+    CupsWatcher.cpp
+    CupsWatcher.h
 )
 
 qt_add_dbus_adaptor(printmanagerkded_SRCS
diff --git a/src/kded/MarkerLevelChecker.cpp b/src/kded/CupsWatcher.cpp
similarity index 70%
rename from src/kded/MarkerLevelChecker.cpp
rename to src/kded/CupsWatcher.cpp
index 45405571..7613d60e 100644
--- a/src/kded/MarkerLevelChecker.cpp
+++ b/src/kded/CupsWatcher.cpp
@@ -4,7 +4,7 @@
     SPDX-License-Identifier: GPL-2.0-or-later
 */
 
-#include "MarkerLevelChecker.h"
+#include "CupsWatcher.h"
 #include "pmkded_log.h"
 
 #include <KLocalizedString>
@@ -15,7 +15,7 @@
 
 using namespace Qt::StringLiterals;
 
-MarkerLevelChecker::MarkerLevelChecker(QObject *parent)
+CupsWatcher::CupsWatcher(QObject *parent)
     : QObject(parent)
 {
     connect(KCupsConnection::global(), &KCupsConnection::serverStarted, this, [](const QString &msg) {
@@ -30,10 +30,10 @@ MarkerLevelChecker::MarkerLevelChecker(QObject *parent)
         qCDebug(PMKDED) << "CUPS Restarted:" << msg;
     });
 
-    connect(KCupsConnection::global(), &KCupsConnection::jobCreated, this, &MarkerLevelChecker::jobHandler);
+    connect(KCupsConnection::global(), &KCupsConnection::jobCreated, this, &CupsWatcher::jobHandler);
 }
 
-void MarkerLevelChecker::checkMarkerLevels(const KCupsPrinter &printer)
+void CupsWatcher::checkMarkerLevels(const KCupsPrinter &printer)
 {
     const auto msgs = printer.checkMarkerLevels();
 
@@ -52,17 +52,17 @@ void MarkerLevelChecker::checkMarkerLevels(const KCupsPrinter &printer)
     }
 }
 
-void MarkerLevelChecker::jobHandler([[maybe_unused]] const QString &text,
-                                    [[maybe_unused]] const QString &printerUri,
-                                    [[maybe_unused]] const QString &printerName,
-                                    [[maybe_unused]] uint printerState,
-                                    [[maybe_unused]] const QString &printerStateReasons,
-                                    [[maybe_unused]] bool printerIsAcceptingJobs,
-                                    [[maybe_unused]] uint jobId,
-                                    [[maybe_unused]] uint jobState,
-                                    [[maybe_unused]] const QString &jobStateReasons,
-                                    [[maybe_unused]] const QString &jobName,
-                                    [[maybe_unused]] uint jobImpressionsCompleted)
+void CupsWatcher::jobHandler([[maybe_unused]] const QString &text,
+                             [[maybe_unused]] const QString &printerUri,
+                             [[maybe_unused]] const QString &printerName,
+                             [[maybe_unused]] uint printerState,
+                             [[maybe_unused]] const QString &printerStateReasons,
+                             [[maybe_unused]] bool printerIsAcceptingJobs,
+                             [[maybe_unused]] uint jobId,
+                             [[maybe_unused]] uint jobState,
+                             [[maybe_unused]] const QString &jobStateReasons,
+                             [[maybe_unused]] const QString &jobName,
+                             [[maybe_unused]] uint jobImpressionsCompleted)
 {
     qCDebug(PMKDED) << text << printerName << jobId << jobStateReasons;
     static const QStringList s_attrs({KCUPS_MARKER_NAMES,
@@ -88,4 +88,4 @@ void MarkerLevelChecker::jobHandler([[maybe_unused]] const QString &text,
     request->getPrinterAttributes(printerName, false, s_attrs);
 }
 
-#include "moc_MarkerLevelChecker.cpp"
+#include "moc_CupsWatcher.cpp"
diff --git a/src/kded/MarkerLevelChecker.h b/src/kded/CupsWatcher.h
similarity index 85%
rename from src/kded/MarkerLevelChecker.h
rename to src/kded/CupsWatcher.h
index 8f24653c..0f5d733e 100644
--- a/src/kded/MarkerLevelChecker.h
+++ b/src/kded/CupsWatcher.h
@@ -1,5 +1,5 @@
 /*
-    SPDX-FileCopyrightText: 2025 Mike Noe <[email protected]>
+    SPDX-FileCopyrightText: 2025-2026 Mike Noe <[email protected]>
 
     SPDX-License-Identifier: GPL-2.0-or-later
 */
@@ -19,13 +19,13 @@ class KCupsPrinter;
  * Assumes levels and thresholds are percentages.
  * see https://openprinting.github.io/cups/doc/spec-ipp.html#marker-high-levels
  */
-class MarkerLevelChecker : public QObject
+class CupsWatcher : public QObject
 {
     Q_OBJECT
 
 public:
-    explicit MarkerLevelChecker(QObject *parent);
-    ~MarkerLevelChecker() = default;
+    explicit CupsWatcher(QObject *parent);
+    ~CupsWatcher() = default;
 
 private:
     void checkMarkerLevels(const KCupsPrinter &printer);
diff --git a/src/kded/PrintManagerKded.cpp b/src/kded/PrintManagerKded.cpp
index 94c0653b..bb50cac5 100644
--- a/src/kded/PrintManagerKded.cpp
+++ b/src/kded/PrintManagerKded.cpp
@@ -5,7 +5,7 @@
 */
 
 #include "PrintManagerKded.h"
-#include "MarkerLevelChecker.h"
+#include "CupsWatcher.h"
 #include "NewPrinterNotification.h"
 #include <KPluginFactory>
 
@@ -17,7 +17,7 @@ PrintManagerKded::PrintManagerKded(QObject *parent, const QVariantList &args)
     Q_UNUSED(args)
 
     new NewPrinterNotification(this);
-    new MarkerLevelChecker(this);
+    new CupsWatcher(this);
 }
 
 PrintManagerKded::~PrintManagerKded()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.