summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-05-15 19:43:45 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-05-15 19:46:13 +0200
commit251896b94c150af20e7c05a61ce4326866c91539 (patch)
tree89a6669513e86f707654be595426ac18b4ac73c8
parent35563d6195e9e6486bcf3e5cc3093fbee7e5e525 (diff)
downloadtdelibs-251896b94c150af20e7c05a61ce4326866c91539.tar.gz
tdelibs-251896b94c150af20e7c05a61ce4326866c91539.zip
Properly fix getting file name with ICC configuration
(cherry picked from commit 46fd5cba30603e692585d81ad4f1824231fd86b6)
-rw-r--r--krandr/libkrandr.cc22
1 files changed, 4 insertions, 18 deletions
diff --git a/krandr/libkrandr.cc b/krandr/libkrandr.cc
index 893913cea..06a242101 100644
--- a/krandr/libkrandr.cc
+++ b/krandr/libkrandr.cc
@@ -81,14 +81,8 @@ TQString KRandrSimpleAPI::getIccFileName(TQString profileName, TQString screenNa
TQStringList t_cfgProfiles;
TQString retval;
- if (profileName != NULL) {
+ if ((profileName != NULL) && (profileName != "")) {
t_config = new KSimpleConfig( TQString::fromLatin1( "kiccconfigrc" ));
- }
- else {
- t_systemconfig = new KSimpleConfig( kde_confdir + TQString("/kicc/kiccconfigrc") );
- }
-
- if (profileName != NULL) {
t_config->setGroup(NULL);
if (t_config->readBoolEntry("EnableICC", false) == true) {
t_config->setGroup(profileName);
@@ -97,8 +91,10 @@ TQString KRandrSimpleAPI::getIccFileName(TQString profileName, TQString screenNa
else {
retval = "";
}
+ delete t_config;
}
else {
+ t_systemconfig = new KSimpleConfig( kde_confdir + TQString("/kicc/kiccconfigrc") );
t_systemconfig->setGroup(NULL);
if (t_systemconfig->readBoolEntry("EnableICC", false) == true) {
retval = t_systemconfig->readEntry("ICCFile");
@@ -106,17 +102,7 @@ TQString KRandrSimpleAPI::getIccFileName(TQString profileName, TQString screenNa
else {
retval = "";
}
- }
-
- if (profileName != "") {
- if (t_config) {
- delete t_config;
- }
- }
- else {
- if (t_systemconfig) {
- delete t_systemconfig;
- }
+ delete t_systemconfig;
}
return retval;