Changeset 900


Ignore:
Timestamp:
Jul 19, 2011, 9:32:34 PM (9 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib: Use expandEnvVars() in qlibraryinfo.cpp on all platforms.

File:
1 edited

Legend:

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

    r851 r900  
    6363#endif
    6464
     65#ifdef Q_OS_OS2
     66#  include "qt_os2.h"
     67#endif
     68
    6569#ifdef QLIBRARYINFO_EPOCROOT
    6670# include "symbian/epocroot_p.h"
    6771#endif
    6872
     73#include "qconfig.cpp"
     74
     75QT_BEGIN_NAMESPACE
     76
     77extern void qDumpCPUFeatures(); // in qsimd.cpp
     78
    6979#ifdef Q_OS_OS2
    70 
    71 #include "qt_os2.h"
    7280
    7381static const char *qt_module_path()
     
    8795}
    8896
     97#endif // Q_OS_OS2
     98
    8999// expands environment variables in the form $(ENVVAR)
    90100static QString expandEnvVars(const QString &str)
     
    101111    return ret;
    102112}
    103 
    104 #endif // Q_OS_OS2
    105 
    106 #include "qconfig.cpp"
    107 
    108 QT_BEGIN_NAMESPACE
    109 
    110 extern void qDumpCPUFeatures(); // in qsimd.cpp
    111113
    112114#ifndef QT_NO_SETTINGS
     
    499501            }
    500502            ret = config->value(subKey + key, defaultValue).toString();
    501 #ifdef Q_OS_OS2
    502503            ret = expandEnvVars(ret);
    503 #endif
    504             // expand environment variables in the form $(ENVVAR)
    505             int rep;
    506             QRegExp reg_var(QLatin1String("\\$\\(.*\\)"));
    507             reg_var.setMinimal(true);
    508             while((rep = reg_var.indexIn(ret)) != -1) {
    509                 ret.replace(rep, reg_var.matchedLength(),
    510                             QString::fromLocal8Bit(qgetenv(ret.mid(rep + 2,
    511                                 reg_var.matchedLength() - 3).toLatin1().constData()).constData()));
    512             }
    513504
    514505#ifdef QLIBRARYINFO_EPOCROOT
    515506            // $${EPOCROOT} is a special case, resolve it similarly to qmake.
     507            int rep;
    516508            QRegExp epocrootMatcher(QLatin1String("\\$\\$\\{EPOCROOT\\}"));
    517509            if ((rep = epocrootMatcher.indexIn(ret)) != -1)
Note: See TracChangeset for help on using the changeset viewer.