mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
quicksettings: fix dynamic removal
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 <sebas@kde.org>
This commit is contained in:
parent
361278b54b
commit
c3ae6650ed
1 changed files with 1 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue