summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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"));