diff --git a/kcms/icons/iconsmodel.cpp b/kcms/icons/iconsmodel.cpp --- a/kcms/icons/iconsmodel.cpp +++ b/kcms/icons/iconsmodel.cpp @@ -83,12 +83,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 (m_settings->theme() == index.data(ThemeNameRole) && !nonPending.isEmpty()) { m_settings->setTheme(nonPending.first().data(ThemeNameRole).toString()); } - emit pendingDeletionsChanged(); return true; }