Commit d06fc533 authored by Eike Hein's avatar Eike Hein

Merge branch 'Plasma/5.14'

parents 62941a1e bb865db2
......@@ -221,10 +221,14 @@ ScrollViewKCM {
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);
}
}]
}
}
......
......@@ -213,7 +213,7 @@ void SelectedTranslationsModel::remove(const QString &languageCode)
int index = m_selectedLanguages.indexOf(languageCode);
if (index < 1) {
if (index < 0 || m_selectedLanguages.count() < 2) {
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment