[utilities/kdebugsettings] src/quickapps/qml: Fix enabled rules support

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

Fix enabled rules support

M  +4    -1    src/quickapps/qml/CustomRulesPage.qml
M  +3    -3    src/quickapps/qml/EditCustomRuleDialog.qml

https://invent.kde.org/utilities/kdebugsettings/-/commit/92ab21221dc73cd8b7bc0389b11f634aa97ead79

diff --git a/src/quickapps/qml/CustomRulesPage.qml b/src/quickapps/qml/CustomRulesPage.qml
index 045f4b72..3a262b47 100644
--- a/src/quickapps/qml/CustomRulesPage.qml
+++ b/src/quickapps/qml/CustomRulesPage.qml
@@ -52,7 +52,7 @@ Kirigami.ScrollablePage {
                 onTriggered: {
                     editCustomRuleDialog.editMode = false;
                     editCustomRuleDialog.categoryName = "";
-
+                    editCustomRuleDialog.categoryEnabled = false;
                     editCustomRuleDialog.open();
                 }
             }
@@ -62,8 +62,11 @@ Kirigami.ScrollablePage {
                 text: i18nc("@action edit custom rule", "Edit Rule…")
                 onTriggered: {
                     const categoryName = listviewRules.currentItem ? listviewRules.currentItem.categoryName : "";
+                    const categoryEnabled = listviewRules.currentItem ? listviewRules.currentItem.enabled : false;
+                    const categoryLoggingType = listviewRules.currentItem ? listviewRules.currentItem.loggingType : LoggingCategory.LoggingType.Debug;
                     editCustomRuleDialog.editMode = true;
                     editCustomRuleDialog.categoryName = categoryName;
+                    editCustomRuleDialog.categoryEnabled = categoryEnabled;
                     editCustomRuleDialog.open();
                 }
             }
diff --git a/src/quickapps/qml/EditCustomRuleDialog.qml b/src/quickapps/qml/EditCustomRuleDialog.qml
index 4c69e3ca..14355728 100644
--- a/src/quickapps/qml/EditCustomRuleDialog.qml
+++ b/src/quickapps/qml/EditCustomRuleDialog.qml
@@ -47,10 +47,10 @@ Kirigami.Dialog {
         }
     }
     onAccepted: {
-        if (!editMode) {
-            LoggingManager.customCategoryModel.addCategory(categoryNameField.text, categoryEnabled.checked, categoryType.currentValue);
-        } else {
+        if (editMode) {
             console.debug("Edit custom Not implemented yet");
+        } else {
+            LoggingManager.customCategoryModel.addCategory(categoryNameField.text, categoryEnabled.checked, categoryType.currentValue);
         }
     }
 }
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.