[utilities/kdebugsettings] src: Allow to save in ~/.config/QtProject/qtlogging.ini

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 18a044298c367bb4f65876b1c6b63eb3b16a621d by Laurent Montel.
Committed on 18/07/2026 at 16:24.
Pushed by mlaurent into branch 'master'.

Allow to save in ~/.config/QtProject/qtlogging.ini

M  +6    -0    src/core/loggingmanager.cpp
M  +3    -1    src/core/loggingmanager.h
M  +1    -3    src/quickapps/contents/ui/main.qml

https://invent.kde.org/utilities/kdebugsettings/-/commit/18a044298c367bb4f65876b1c6b63eb3b16a621d

diff --git a/src/core/loggingmanager.cpp b/src/core/loggingmanager.cpp
index 3660e459..ef25fea4 100644
--- a/src/core/loggingmanager.cpp
+++ b/src/core/loggingmanager.cpp
@@ -7,6 +7,7 @@
 
 #include "loggingmanager.h"
 #include "jobs/saverulesjob.h"
+#include "kdebugsettingsutil.h"
 
 LoggingManager::LoggingManager(QObject *parent)
     : QObject{parent}
@@ -66,6 +67,11 @@ void LoggingManager::updateLoggingCategories()
     mQtKdeCategoryModel->setLoggingCategories(qtKdeCategories);
 }
 
+bool LoggingManager::saveInQtLogging()
+{
+    return saveRules(KDebugSettingsUtil::qtFileName());
+}
+
 bool LoggingManager::saveRules(const QString &path, bool forceSavingAllRules)
 {
     SaveRulesJob job;
diff --git a/src/core/loggingmanager.h b/src/core/loggingmanager.h
index cd005fb4..17eab878 100644
--- a/src/core/loggingmanager.h
+++ b/src/core/loggingmanager.h
@@ -43,7 +43,9 @@ public:
     void readQtLoggingFile();
     void updateLoggingCategories();
 
-    [[nodiscard]] Q_INVOKABLE bool saveRules(const QString &path, bool forceSavingAllRules);
+    [[nodiscard]] Q_INVOKABLE bool saveInQtLogging();
+
+    [[nodiscard]] Q_INVOKABLE bool saveRules(const QString &path, bool forceSavingAllRules = false);
 
     [[nodiscard]] KDEApplicationLoggingCategoryProxyModel *kdeApplicationLoggingCategoryProxyModel() const;
 
diff --git a/src/quickapps/contents/ui/main.qml b/src/quickapps/contents/ui/main.qml
index e42c5a63..9b05e169 100644
--- a/src/quickapps/contents/ui/main.qml
+++ b/src/quickapps/contents/ui/main.qml
@@ -73,9 +73,7 @@ Kirigami.ApplicationWindow {
         icon.name: "document-save"
         shortcut: StandardKey.Save
         onTriggered: {
-            LoggingManager.saveRules("ddd", false);
-            console.debug("Not implemented yet")
-            // TODO
+            LoggingManager.saveInQtLogging();
         }
     }
     GlobalMenu {}
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.