Changeset 548


Ignore:
Timestamp:
Feb 8, 2010, 6:31:02 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

qmake: Use the system-wide qtsys.conf if qt.conf isn't found in the qmake.exe's directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/qmake/option.cpp

    r29 r548  
    756756        DosQueryModuleName(ppib->pib_hmte, sizeof(appFileName), appFileName);
    757757    }
    758     filePath = QString::fromLocal8Bit(appFileName);
    759     ret = filePath.filePath();
     758    ret = QFileInfo(QString::fromLocal8Bit(appFileName)).absolutePath() +
     759                    QLatin1String("/qt.conf");
     760    if (!QFile::exists(ret)) {
     761        // search in the system-wide location
     762        ret = QString::fromLocal8Bit(qgetenv("ETC"));
     763        if (ret.isEmpty())
     764            ret = QDir::rootPath();
     765        ret = ret + QLatin1String("/qtsys.conf");
     766    }
     767    return QDir::cleanPath(ret);
    760768#else
    761769    QString argv0 = QFile::decodeName(QByteArray(Option::application_argv0));
     
    799807    ret = fi.exists() ? fi.canonicalFilePath() : QString();
    800808#endif
     809#if !defined(Q_OS_OS2)
    801810    if(!ret.isEmpty())
    802811        ret = QDir(QFileInfo(ret).absolutePath()).filePath("qt.conf");
    803812    return ret;
     813#endif
    804814}
    805815
Note: See TracChangeset for help on using the changeset viewer.