summaryrefslogtreecommitdiffstats
path: root/krandr/libkrandr.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-20 20:43:38 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-20 20:43:38 +0000
commit42dfcbcc0fe6019d32cd5680a86e2831fe9b6974 (patch)
tree81f15764d81efcdcb0ec9edeeaf534ce2ecc0d48 /krandr/libkrandr.cc
parente7c20618e624eb27aa17abcdc471f3711e94b914 (diff)
downloadtdelibs-42dfcbcc0fe6019d32cd5680a86e2831fe9b6974.tar.gz
tdelibs-42dfcbcc0fe6019d32cd5680a86e2831fe9b6974.zip
KRandRTray fixes; minor compilation repairs
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1152360 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krandr/libkrandr.cc')
-rw-r--r--krandr/libkrandr.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/krandr/libkrandr.cc b/krandr/libkrandr.cc
index db40743a4..f2080f287 100644
--- a/krandr/libkrandr.cc
+++ b/krandr/libkrandr.cc
@@ -90,6 +90,9 @@ QString KRandrSimpleAPI::applyIccFile(QString screenName, QString fileName) {
screenNumber = -1;
randr_display = XOpenDisplay(NULL);
randr_screen_info = read_screen_info(randr_display);
+ if (randr_screen_info == NULL) {
+ return "";
+ }
j=0;
for (i = 0; i < randr_screen_info->n_output; i++) {
output_info = randr_screen_info->outputs[i]->info;
@@ -151,6 +154,9 @@ QString KRandrSimpleAPI::applyIccFile(QString screenName, QString fileName) {
screenNumber = -1;
randr_display = XOpenDisplay(NULL);
randr_screen_info = read_screen_info(randr_display);
+ if (randr_screen_info == NULL) {
+ return "";
+ }
j=0;
for (i = 0; i < randr_screen_info->n_output; i++) {
output_info = randr_screen_info->outputs[i]->info;
@@ -216,6 +222,9 @@ QString KRandrSimpleAPI::applyIccConfiguration(QString profileName, QString kde_
if (isValid() == true) {
randr_display = XOpenDisplay(NULL);
randr_screen_info = read_screen_info(randr_display);
+ if (randr_screen_info == NULL) {
+ return "";
+ }
for (i = 0; i < randr_screen_info->n_output; i++) {
output_info = randr_screen_info->outputs[i]->info;
errorstr = applyIccFile(output_info->name, getIccFileName(profileName, output_info->name, kde_confdir));