diff --git a/kcms/translations/package/contents/ui/main.qml b/kcms/translations/package/contents/ui/main.qml --- a/kcms/translations/package/contents/ui/main.qml +++ b/kcms/translations/package/contents/ui/main.qml @@ -220,10 +220,14 @@ onTriggered: kcm.selectedTranslationsModel.move(index, 0) }, Kirigami.Action { - enabled: !model.IsMissing + property bool removing: false + enabled: removing || !model.IsMissing && languagesList.count > 1 iconName: "list-remove" tooltip: i18nc("@info:tooltip", "Remove") - onTriggered: kcm.selectedTranslationsModel.remove(model.LanguageCode) + onTriggered: { + removing = true; // Don't crash by re-evaluating `enabled` during destruction. + kcm.selectedTranslationsModel.remove(model.LanguageCode); + } }] } } diff --git a/kcms/translations/translationsmodel.cpp b/kcms/translations/translationsmodel.cpp --- a/kcms/translations/translationsmodel.cpp +++ b/kcms/translations/translationsmodel.cpp @@ -213,7 +213,7 @@ int index = m_selectedLanguages.indexOf(languageCode); - if (index < 1) { + if (index < 0 || m_selectedLanguages.count() < 2) { return; }