diff --git a/kcms/colors/colorsmodel.cpp b/kcms/colors/colorsmodel.cpp --- a/kcms/colors/colorsmodel.cpp +++ b/kcms/colors/colorsmodel.cpp @@ -85,10 +85,12 @@ item.pendingDeletion = pendingDeletion; emit dataChanged(index, index, {PendingDeletionRole}); - // move to the next non-pending theme - const auto nonPending = match(index, PendingDeletionRole, false); - if (!nonPending.isEmpty()) { - setSelectedScheme(nonPending.first().data(SchemeNameRole).toString()); + if (index.row() == selectedSchemeIndex() && pendingDeletion) { + // move to the next non-pending theme + const auto nonPending = match(index, PendingDeletionRole, false); + if (!nonPending.isEmpty()) { + setSelectedScheme(nonPending.first().data(SchemeNameRole).toString()); + } } emit pendingDeletionsChanged();