- Timestamp:
- Nov 30, 2009, 11:56:07 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/global/qlibraryinfo.cpp
r357 r366 481 481 } 482 482 483 #ifdef Q_OS_OS2 484 485 // QDir::isRelativePath() isn't precise on OS/2 (see 486 // QDir::absoluteFilePath()) therefore we don't rely on it 487 if (loc == PrefixPath) { 488 #ifdef QT_BUILD_QMAKE 489 QFileInfo fi(qmake_libraryInfoFile()); 490 return QDir::cleanPath(QDir(fi.absolutePath()).absoluteFilePath(ret)); 491 #else 492 QSettings *config = QLibraryInfoPrivate::configuration(); 493 if (config) { 494 // if we read paths from qt[sys].conf, the Prefix is relative to 495 // the directory we load qt[sys].conf from 496 QFileInfo fi(config->fileName()); 497 return QDir::cleanPath(QDir(fi.absolutePath()).absoluteFilePath(ret)); 498 } else { 499 // we make the prefix path absolute to the executable's directory 500 if (QCoreApplication::instance()) { 501 return QDir::cleanPath(QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(ret)); 502 } 503 return QDir::current().absoluteFilePath(ret); 504 } 505 #endif 506 } 507 508 // we make any other path absolute to the prefix directory 509 return QDir::cleanPath(QDir(location(PrefixPath)).absoluteFilePath(ret)); 510 511 #else // #ifdef Q_OS_OS2 512 483 513 if (QDir::isRelativePath(ret)) { 484 514 if (loc == PrefixPath) { … … 488 518 return QDir::cleanPath(QDir(fi.absolutePath()).absoluteFilePath(ret)); 489 519 #else 490 #ifdef Q_OS_OS2491 QSettings *config = QLibraryInfoPrivate::configuration();492 if (config) {493 // if we read paths from qt[sys].conf, the Prefix is relative to494 // the directory we load qt[sys].conf from495 QFileInfo fi(config->fileName());496 return QDir::cleanPath(QDir(fi.absolutePath()).absoluteFilePath(ret));497 }498 else499 #endif500 520 if (QCoreApplication::instance()) { 501 521 #ifdef Q_OS_MAC … … 520 540 } 521 541 return QDir::cleanPath(ret); 542 543 #endif // #ifdef Q_OS_OS2 522 544 } 523 545
Note:
See TracChangeset
for help on using the changeset viewer.