diff --git a/kcms/icons/iconsmodel.cpp b/kcms/icons/iconsmodel.cpp --- a/kcms/icons/iconsmodel.cpp +++ b/kcms/icons/iconsmodel.cpp @@ -79,12 +79,11 @@ item.pendingDeletion = pendingDeletion; emit dataChanged(index, index, {PendingDeletionRole}); - // move to the next non-pending theme + // if we delete current selected theme move to the next non-pending theme const auto nonPending = match(index, PendingDeletionRole, false); - if (!nonPending.isEmpty()) { + if (index.row() == selectedThemeIndex() && !nonPending.isEmpty()) { setSelectedTheme(nonPending.first().data(ThemeNameRole).toString()); } - emit pendingDeletionsChanged(); return true; }