Properly fix getting file name with ICC configuration

(cherry picked from commit 46fd5cba30)
v3.5.13-sru
Slávek Banko 12 years ago
parent 35563d6195
commit 251896b94c

@ -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,18 +102,8 @@ TQString KRandrSimpleAPI::getIccFileName(TQString profileName, TQString screenNa
else {
retval = "";
}
}
if (profileName != "") {
if (t_config) {
delete t_config;
}
}
else {
if (t_systemconfig) {
delete t_systemconfig;
}
}
return retval;
}

Loading…
Cancel
Save