summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Kügler <[email protected]>2014-06-13 03:42:14 +0200
committerSebastian Kügler <[email protected]>2014-06-13 03:42:14 +0200
commit32bf61302045ac8016532b647d5923a76460b098 (patch)
treea1677eb9d618b2a6e0f6f5aabe0dafa24c12de2f
parentfd6725a5e2035db36d0fabc145f1c888a40cb000 (diff)
avoid empty labels
-rw-r--r--kcmtranslations.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/kcmtranslations.cpp b/kcmtranslations.cpp
index b2fb0a5..6a83119 100644
--- a/kcmtranslations.cpp
+++ b/kcmtranslations.cpp
@@ -228,7 +228,11 @@ void KCMTranslations::initTranslations()
foreach (const QString &languageCode, m_kcmTranslations) {
QListWidgetItem *listItem = new QListWidgetItem(m_ui->m_selectTranslations->selectedListWidget());
// TODO This gives the name in the language itself, not in current language, need new QLocale api for that
- listItem->setText(QLocale(languageCode).nativeLanguageName());
+ QString label = QLocale(languageCode).nativeLanguageName();
+ if (label.isEmpty()) {
+ label = languageCode;
+ }
+ listItem->setText(label);
listItem->setData(Qt::UserRole, languageCode);
}