Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/corelib/io/qsettings.cpp

    r651 r769  
    10921092}
    10931093
    1094 static QString getPath(QSettings::Format format, QSettings::Scope scope)
    1095 {
    1096     Q_ASSERT((int)QSettings::NativeFormat == 0);
    1097     Q_ASSERT((int)QSettings::IniFormat == 1);
    1098 
     1094static void initDefaultPaths(QMutexLocker *locker)
     1095{
     1096    PathHash *pathHash = pathHashFunc();
    10991097    QString homePath = QDir::homePath();
    11001098    QString systemPath;
    11011099
    1102     QMutexLocker locker(globalMutex());
    1103     PathHash *pathHash = pathHashFunc();
    1104     bool loadSystemPath = pathHash->isEmpty();
    1105     locker.unlock();
    1106 
    1107     if (loadSystemPath) {
    1108         /*
    1109            QLibraryInfo::location() uses QSettings, so in order to
    1110            avoid a dead-lock, we can't hold the global mutex while
    1111            calling it.
    1112        */
    1113         systemPath = QLibraryInfo::location(QLibraryInfo::SettingsPath);
    1114         systemPath += QLatin1Char('/');
    1115     }
    1116 
    1117     locker.relock();
     1100    locker->unlock();
     1101       
     1102    /*
     1103       QLibraryInfo::location() uses QSettings, so in order to
     1104       avoid a dead-lock, we can't hold the global mutex while
     1105       calling it.
     1106    */
     1107    systemPath = QLibraryInfo::location(QLibraryInfo::SettingsPath);
     1108    systemPath += QLatin1Char('/');
     1109
     1110    locker->relock();
    11181111    if (pathHash->isEmpty()) {
    11191112        /*
     
    11731166#endif
    11741167    }
     1168
     1169
     1170
     1171
     1172
     1173
     1174
     1175
     1176
     1177
     1178
    11751179
    11761180    QString result = pathHash->value(pathHashKey(format, scope));
     
    34833487    QMutexLocker locker(globalMutex());
    34843488    PathHash *pathHash = pathHashFunc();
     3489
     3490
    34853491    pathHash->insert(pathHashKey(format, scope), path + QDir::separator());
    34863492}
Note: See TracChangeset for help on using the changeset viewer.