- Timestamp:
- Aug 26, 2011, 7:48:22 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/global/qlibraryinfo.cpp
r901 r1030 176 176 if (!QFile::exists(qtconfig)) { 177 177 // search in the directory that contains the DLL or EXE where this 178 // code is located (e.g. QtCore .dll or app.exe if Qt is a static lib)178 // code is located (e.g. QtCore.dll or app.exe if Qt is a static lib) 179 179 qtconfig = QString::fromLocal8Bit(qt_module_path()); 180 qtconfig = QDir::fromNativeSeparators(qtconfig) + 181 QLatin1String("/qt.conf"); 180 qtconfig = QDir::fromNativeSeparators(qtconfig) + QLatin1String("/qt.conf"); 182 181 qtconfig = QDir::cleanPath(qtconfig); 183 184 if (!QFile::exists(qtconfig)) {185 // search in the system-wide location186 #ifdef QT_CONFIGURE_QT_SYSCONF_FILE187 qtconfig = expandEnvVars(QString::fromLocal8Bit(QT_CONFIGURE_QT_SYSCONF_FILE));188 if (!QFile::exists(qtconfig))189 #endif190 {191 // search in %ETC% for backward compatibility192 QString etc = QString::fromLocal8Bit(qgetenv("ETC"));193 if (etc.isEmpty())194 etc = QDir::rootPath();195 etc = QDir::fromNativeSeparators(etc);196 qtconfig = QDir::cleanPath(etc + QLatin1String("/qt.conf"));197 if (!QFile::exists(qtconfig)) {198 qtconfig = QDir::cleanPath(etc + QLatin1String("/qtsys.conf"));199 }200 }201 }202 182 } 203 183 #endif … … 516 496 517 497 #ifdef Q_OS_OS2 518 519 // QDir::isRelativePath() isn't precise on OS/2 (see 520 // QDir::absoluteFilePath()) therefore we don't rely on it 498 // QDir::isRelativePath() isn't precise on OS/2 (see QDir::absoluteFilePath()) 499 // therefore we don't rely on it 521 500 if (loc == PrefixPath) { 522 501 #ifdef BOOTSTRAPPING … … 526 505 QSettings *config = QLibraryInfoPrivate::configuration(); 527 506 if (config) { 528 // if we read paths from qt [sys].conf, the Prefix is relative to529 // t he directory we load qt[sys].conf from507 // if we read paths from qt 508 // t 530 509 QFileInfo fi(config->fileName()); 531 510 ret = QDir::cleanPath(QDir(fi.absolutePath()).absoluteFilePath(ret)); 532 511 } else { 533 // we make the prefix path absolute to the executable's directory 534 if (QCoreApplication::instance()) { 535 ret = QDir::cleanPath(QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(ret)); 536 } else { 537 ret = QDir::current().absoluteFilePath(ret); 538 } 512 // otherwise we make the prefix path absolute to the DLL/EXE directory 513 QString path = QString::fromLocal8Bit(qt_module_path()); 514 ret = QDir::cleanPath(QDir(path).absoluteFilePath(ret)); 539 515 } 540 516 #endif … … 543 519 ret = QDir::cleanPath(QDir(location(PrefixPath)).absoluteFilePath(ret)); 544 520 } 545 546 521 return QDir::toNativeSeparators(ret); 547 548 522 #else // Q_OS_OS2 549 550 523 if (QDir::isRelativePath(ret)) { 551 524 if (loc == PrefixPath) { … … 577 550 } 578 551 return QDir::cleanPath(ret); 579 580 552 #endif // Q_OS_OS2 581 553 }
Note:
See TracChangeset
for help on using the changeset viewer.