Changeset 813 for trunk/src/corelib
- Timestamp:
- Nov 4, 2010, 12:31:36 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/global/qlibraryinfo.cpp
r651 r813 81 81 } 82 82 return path; 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 83 98 } 84 99 … … 161 176 if (!QFile::exists(qtconfig)) { 162 177 // search in the system-wide location 163 qtconfig = QString::fromLocal8Bit(qgetenv("ETC")); 164 if (qtconfig.isEmpty()) 165 qtconfig = QDir::rootPath(); 166 qtconfig = QDir::fromNativeSeparators(qtconfig) + 167 QLatin1String("/qtsys.conf"); 168 qtconfig = QDir::cleanPath(qtconfig); 178 #ifdef QT_CONFIGURE_QT_SYSCONF_FILE 179 qtconfig = expandEnvVars(QString::fromLocal8Bit(QT_CONFIGURE_QT_SYSCONF_FILE)); 180 if (!QFile::exists(qtconfig)) 181 #endif 182 { 183 // search in %ETC% for backward compatibility 184 QString etc = QString::fromLocal8Bit(qgetenv("ETC")); 185 if (etc.isEmpty()) 186 etc = QDir::rootPath(); 187 etc = QDir::fromNativeSeparators(etc); 188 qtconfig = QDir::cleanPath(etc + QLatin1String("/qt.conf")); 189 if (!QFile::exists(qtconfig)) { 190 qtconfig = QDir::cleanPath(etc + QLatin1String("/qtsys.conf")); 191 } 192 } 169 193 } 170 194 } … … 341 365 ret = QString::fromLocal8Bit(path); 342 366 #ifdef Q_OS_OS2 343 // expand environment variables in the form $(ENVVAR) 344 int rep; 345 QRegExp reg_var(QLatin1String("\\$\\(.*\\)")); 346 reg_var.setMinimal(true); 347 while((rep = reg_var.indexIn(ret)) != -1) { 348 ret.replace(rep, reg_var.matchedLength(), 349 QFile::decodeName(qgetenv(ret.mid(rep + 2, 350 reg_var.matchedLength() - 3).toLatin1().constData()).constData())); 351 } 367 ret = expandEnvVars(ret); 352 368 #endif 353 369 } … … 468 484 } 469 485 ret = config->value(subKey + key, defaultValue).toString(); 470 // expand environment variables in the form $(ENVVAR) 471 int rep; 472 QRegExp reg_var(QLatin1String("\\$\\(.*\\)")); 473 reg_var.setMinimal(true); 474 while((rep = reg_var.indexIn(ret)) != -1) { 475 ret.replace(rep, reg_var.matchedLength(), 476 QFile::decodeName(qgetenv(ret.mid(rep + 2, 477 reg_var.matchedLength() - 3).toLatin1().constData()).constData())); 478 } 486 #ifdef Q_OS_OS2 487 ret = expandEnvVars(ret); 488 #endif 479 489 config->endGroup(); 480 490 }
Note:
See TracChangeset
for help on using the changeset viewer.