summaryrefslogtreecommitdiffstats
path: root/kcm_gtk/kcmgtk.cpp
diff options
context:
space:
mode:
authorFrancois Andriot <[email protected]>2013-09-24 02:27:33 +0200
committerSlávek Banko <[email protected]>2013-09-24 02:31:43 +0200
commit082a0c06c2d33bd9056f93ff0fa22ab2b0062928 (patch)
tree8fd7ec6badfe1287e5bfea0360874701477ff2aa /kcm_gtk/kcmgtk.cpp
parentb0ae5425ef54cac49164fc1a79decb40f982bbf6 (diff)
downloadgtk-qt-engine-082a0c06c2d33bd9056f93ff0fa22ab2b0062928.tar.gz
gtk-qt-engine-082a0c06c2d33bd9056f93ff0fa22ab2b0062928.zip
Fix kcm_gtk crash when GTK2 / GTK3 themes is not available
This resolves Bug 1587
Diffstat (limited to 'kcm_gtk/kcmgtk.cpp')
-rw-r--r--kcm_gtk/kcmgtk.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/kcm_gtk/kcmgtk.cpp b/kcm_gtk/kcmgtk.cpp
index 9ff9b79..9532bb2 100644
--- a/kcm_gtk/kcmgtk.cpp
+++ b/kcm_gtk/kcmgtk.cpp
@@ -232,13 +232,19 @@ void KcmGtk::getInstalledThemes()
}
}
+ bool installed = false;
widget->styleBox->clear();
TQStringList otherStyles = themes.keys();
- otherStyles.remove(otherStyles.find("Qt"));
- widget->styleBox->insertStringList(otherStyles);
-
- bool installed = (themes.find("Qt") != themes.end());
+ if(!otherStyles.empty()) {
+ otherStyles.remove(otherStyles.find("Qt"));
+ installed = !otherStyles.empty();
+ }
+ if(installed) {
+ widget->styleBox->insertStringList(otherStyles);
+ }
widget->styleKde->setEnabled(installed);
+ widget->styleBox->setEnabled(installed);
+ widget->styleOther->setEnabled(installed);
widget->warning1->setHidden(installed);
widget->warning2->setHidden(installed);
widget->warning3->setHidden(installed);
@@ -261,13 +267,19 @@ void KcmGtk::getInstalledThemes()
}
}
+ bool gtk3installed = false;
widget->styleBox3->clear();
TQStringList otherGtk3Styles = gtk3Themes.keys();
- otherGtk3Styles.remove(otherGtk3Styles.find("tdegtk"));
- widget->styleBox3->insertStringList(otherGtk3Styles);
-
- bool gtk3installed = (gtk3Themes.find("tdegtk") != gtk3Themes.end());
+ if(!otherGtk3Styles.empty()) {
+ otherGtk3Styles.remove(otherGtk3Styles.find("tdegtk"));
+ gtk3installed = !otherGtk3Styles.empty();
+ }
+ if(gtk3installed) {
+ widget->styleBox3->insertStringList(otherGtk3Styles);
+ }
widget->styleKde3->setEnabled(gtk3installed);
+ widget->styleBox3->setEnabled(gtk3installed);
+ widget->styleOther3->setEnabled(gtk3installed);
widget->warning4->setHidden(gtk3installed);
widget->warning5->setHidden(gtk3installed);
widget->warning6->setHidden(gtk3installed);