Changeset 769 for trunk/src/corelib/io/qsettings.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/corelib/io/qsettings.cpp
r651 r769 1092 1092 } 1093 1093 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 1094 static void initDefaultPaths(QMutexLocker *locker) 1095 { 1096 PathHash *pathHash = pathHashFunc(); 1099 1097 QString homePath = QDir::homePath(); 1100 1098 QString systemPath; 1101 1099 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(); 1118 1111 if (pathHash->isEmpty()) { 1119 1112 /* … … 1173 1166 #endif 1174 1167 } 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1175 1179 1176 1180 QString result = pathHash->value(pathHashKey(format, scope)); … … 3483 3487 QMutexLocker locker(globalMutex()); 3484 3488 PathHash *pathHash = pathHashFunc(); 3489 3490 3485 3491 pathHash->insert(pathHashKey(format, scope), path + QDir::separator()); 3486 3492 }
Note:
See TracChangeset
for help on using the changeset viewer.