Changeset 1030 for trunk/src


Ignore:
Timestamp:
Aug 26, 2011, 7:48:22 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

OS/2: Remove suport for system-wide qt.conf files.

This turns not to be necessary. The new code is much simpler and has
less platform-dependent details. Note that hard-coded component paths
are now relative to the parent of the directory containing QtCore4.dll, not
to that directory itself as before. This in particular makes qt.conf not necessary
for the development builds at all.

For official (RPM) release builds, full hard-coded paths will be used so qt.conf
is not necessary at all. It will only be in use in portable ZIP distributions to
override these hard-coded paths of RPM builds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/global/qlibraryinfo.cpp

    r901 r1030  
    176176    if (!QFile::exists(qtconfig)) {
    177177        // 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)
    179179        qtconfig = QString::fromLocal8Bit(qt_module_path());
    180         qtconfig = QDir::fromNativeSeparators(qtconfig) +
    181                    QLatin1String("/qt.conf");
     180        qtconfig = QDir::fromNativeSeparators(qtconfig) + QLatin1String("/qt.conf");
    182181        qtconfig = QDir::cleanPath(qtconfig);
    183 
    184         if (!QFile::exists(qtconfig)) {
    185             // search in the system-wide location
    186 #ifdef QT_CONFIGURE_QT_SYSCONF_FILE
    187             qtconfig = expandEnvVars(QString::fromLocal8Bit(QT_CONFIGURE_QT_SYSCONF_FILE));
    188             if (!QFile::exists(qtconfig))
    189 #endif
    190             {
    191                 // search in %ETC% for backward compatibility
    192                 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         }
    202182    }
    203183#endif
     
    516496
    517497#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
    521500    if (loc == PrefixPath) {
    522501#ifdef BOOTSTRAPPING
     
    526505        QSettings *config = QLibraryInfoPrivate::configuration();
    527506        if (config) {
    528             // if we read paths from qt[sys].conf, the Prefix is relative to
    529             // the directory we load qt[sys].conf from
     507            // if we read paths from qt
     508            // t
    530509            QFileInfo fi(config->fileName());
    531510            ret = QDir::cleanPath(QDir(fi.absolutePath()).absoluteFilePath(ret));
    532511        } 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));
    539515        }
    540516#endif
     
    543519        ret = QDir::cleanPath(QDir(location(PrefixPath)).absoluteFilePath(ret));
    544520    }
    545 
    546521    return QDir::toNativeSeparators(ret);
    547 
    548522#else // Q_OS_OS2
    549 
    550523    if (QDir::isRelativePath(ret)) {
    551524        if (loc == PrefixPath) {
     
    577550    }
    578551    return QDir::cleanPath(ret);
    579 
    580552#endif // Q_OS_OS2
    581553}
Note: See TracChangeset for help on using the changeset viewer.