summaryrefslogtreecommitdiffstats
path: root/kcontrol/randr
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-17 14:59:23 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-17 14:59:23 -0600
commitf6095d86a621538298e764b710344c3e50ecc9e8 (patch)
tree770e7c2834f12cebf6c5fea7e2664b68b796a964 /kcontrol/randr
parent2d728f781b55fb1dc63fb10e9f570cdb4902b1cd (diff)
downloadtdebase-f6095d86a621538298e764b710344c3e50ecc9e8.tar.gz
tdebase-f6095d86a621538298e764b710344c3e50ecc9e8.zip
Fix krandrtray profile list when no XRandR extension is available
Diffstat (limited to 'kcontrol/randr')
-rw-r--r--kcontrol/randr/krandrtray.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/kcontrol/randr/krandrtray.cpp b/kcontrol/randr/krandrtray.cpp
index 8e6a19256..89315f75c 100644
--- a/kcontrol/randr/krandrtray.cpp
+++ b/kcontrol/randr/krandrtray.cpp
@@ -232,11 +232,14 @@ void KRandRSystemTray::contextMenuAboutToShow(KPopupMenu* menu)
menu->clear();
menu->setCheckable(true);
- if (!isValid()) {
+ bool valid = isValid();
+
+ if (!valid) {
lastIndex = menu->insertItem(i18n("Required X Extension Not Available"));
menu->setItemEnabled(lastIndex, false);
- } else {
+ }
+ else {
m_screenPopups.clear();
for (int s = 0; s < numScreens() /*&& numScreens() > 1 */; s++) {
setCurrentScreen(s);
@@ -273,17 +276,19 @@ void KRandRSystemTray::contextMenuAboutToShow(KPopupMenu* menu)
menu->connectItem(lastIndex, this, TQT_SLOT(slotColorProfileChanged(int)));
}
- // Find any display profiles
- TQStringList displayProfiles;
- displayProfiles = getDisplayConfigurationProfiles(locateLocal("config", "/", true));
- if (displayProfiles.isEmpty() == false) {
- menu->insertTitle(SmallIcon("background"), i18n("Display Profiles"));
- }
- lastIndex = menu->insertItem(SmallIcon("bookmark"), "<default>");
- menu->connectItem(lastIndex, this, TQT_SLOT(slotDisplayProfileChanged(int)));
- for (TQStringList::Iterator t(displayProfiles.begin()); t != displayProfiles.end(); ++t) {
- lastIndex = menu->insertItem(SmallIcon("bookmark"), *t);
+ if (valid) {
+ // Find any display profiles
+ TQStringList displayProfiles;
+ displayProfiles = getDisplayConfigurationProfiles(locateLocal("config", "/", true));
+ if (displayProfiles.isEmpty() == false) {
+ menu->insertTitle(SmallIcon("background"), i18n("Display Profiles"));
+ }
+ lastIndex = menu->insertItem(SmallIcon("bookmark"), "<default>");
menu->connectItem(lastIndex, this, TQT_SLOT(slotDisplayProfileChanged(int)));
+ for (TQStringList::Iterator t(displayProfiles.begin()); t != displayProfiles.end(); ++t) {
+ lastIndex = menu->insertItem(SmallIcon("bookmark"), *t);
+ menu->connectItem(lastIndex, this, TQT_SLOT(slotDisplayProfileChanged(int)));
+ }
}
menu->insertTitle(SmallIcon("randr"), i18n("Global Configuation"));