From c3ae6650ed0cd0a9246801c9c022addaae5006c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Fri, 1 Aug 2025 12:16:30 +0200 Subject: [PATCH] quicksettings: fix dynamic removal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a quicksetting is changed to not available, it should be removed from the model. The proper API call to beginRemoveRows() has the index of the last removed element as last parameter and will fail with null. This patch makes dynamically removing a quicksetting by changing the available property to false. Signed-off-by: Sebastian Kügler --- components/quicksettingsplugin/quicksettingsmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/quicksettingsplugin/quicksettingsmodel.cpp b/components/quicksettingsplugin/quicksettingsmodel.cpp index f81ce9f1..d9c87552 100644 --- a/components/quicksettingsplugin/quicksettingsmodel.cpp +++ b/components/quicksettingsplugin/quicksettingsmodel.cpp @@ -166,7 +166,7 @@ void QuickSettingsModel::loadQuickSetting(KPluginMetaData metaData, bool emitIns void QuickSettingsModel::removeQuickSetting(int index) { if (index >= 0) { - beginRemoveRows({}, index, 0); + beginRemoveRows({}, index, index); m_quickSettings.removeAt(index); m_quickSettingsMetaData.removeAt(index); endRemoveRows();