- Timestamp:
- Dec 14, 2009, 9:16:37 PM (16 years ago)
- Location:
- trunk/src/corelib/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qsettings.cpp
r25 r425 1136 1136 windowsConfigPath(CSIDL_COMMON_APPDATA) + QDir::separator()); 1137 1137 #elif defined(Q_OS_OS2) 1138 /* Though this code is very similar to the following #else statment, 1139 * we have to do it separately for OS/2 and leave the original code 1140 * intact since QDir::separator() returns ":" on Mac OS X while "/" is 1141 * actually used in the #else below. */ 1138 /* Though this code is very similar to the following #else block, the 1139 * definition of the "absolute path" is different on OS/2 (see 1140 * isRelativePath() in qfsfileengine_os2.cpp) so take it into account)*/ 1142 1141 QString userPath; 1143 QString env = Q Latin1String(getenv("XDG_CONFIG_HOME"));1142 QString env = QFile::decodeName(qgetenv("XDG_CONFIG_HOME")); 1144 1143 if (env.isEmpty()) { 1145 1144 userPath = homePath; 1146 1145 userPath += QDir::separator(); 1147 1146 userPath += QLatin1String(".config"); 1148 } else if (QDir::isAbsolutePath(env)) {1149 userPath = env;1150 1147 } else { 1151 userPath = homePath; 1152 userPath += QDir::separator(); 1153 userPath += env; 1154 } 1155 userPath += QDir::separator(); 1148 userPath = QDir::cleanPath(QDir(homePath).absoluteFilePath(env)); 1149 } 1150 userPath = QDir::cleanPath(userPath) + QLatin1Char('/'); 1156 1151 1157 1152 pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::UserScope), userPath); … … 2386 2381 \o \c{%HOME%\.config\MySoft\Star Runner.ini} 2387 2382 \o \c{%HOME%\.config\MySoft.ini} 2388 \o \c{ <boot_drv>:\OS2\xdg\MySoft\Star Runner.ini}2389 \o \c{ <boot_drv>:\OS2\xdg\MySoft.ini}2383 \o \c{%ETC%\xdg\MySoft\Star Runner.ini} 2384 \o \c{%ETC%\xdg\MySoft.ini} 2390 2385 \endlist 2391 2386 … … 3470 3465 \row \o{1,2} Mac OS X \o{1,2} IniFormat \o UserScope \o \c $HOME/.config 3471 3466 \row \o SystemScope \o \c /etc/xdg 3472 \row \o{1,2} OS/2 \o{1,2} IniFormat \o UserScope \o \c $HOME\.config3473 \row \o SystemScope \o \c <boot_drv>:\OS2\xdg3467 \row \o{1,2} OS/2 \o{1,2} IniFormat \o UserScope \o \c %HOME%\.config 3468 \row \o SystemScope \o \c %ETC%\xdg 3474 3469 \endtable 3475 3470 … … 3477 3472 $HOME/Settings) can be overridden by the user by setting the 3478 3473 \c XDG_CONFIG_HOME environment variable. The default SystemScope 3479 paths on Unix, Mac OS X (\c /etc/xdg) and OS/2 (\c <boot_drv>:\OS2\xdg) can3480 beoverridden when building the Qt library using the \c configure script's3474 paths on Unix, Mac OS X (\c /etc/xdg) and OS/2 (\c %ETC%\xdg) can be 3475 overridden when building the Qt library using the \c configure script's 3481 3476 \c 3482 3477 --sysconfdir flag (see QLibraryInfo for details). -
trunk/src/corelib/io/qsettings_os2.cpp
r399 r425 1070 1070 } 1071 1071 1072 static QSettings::Format checkFormat(QSettings::Format format) 1073 { 1074 if (getenv("QT_PM_NO_REGISTRY") != NULL || 1075 getenv("QT_PM_REGISTRY") == NULL) { 1076 #if defined(QT_DEBUG) 1077 if (getenv("QT_PM_NO_REGISTRY") != NULL) 1078 qDebug("QSettings: WARNING: using plain INI files due to QT_PM_NO_REGISTRY=%s", 1079 getenv("QT_PM_NO_REGISTRY")); 1080 #endif 1081 if (format == QSettings::NativeFormat) 1082 format = QSettings::IniFormat; 1083 } 1084 #if defined(QT_DEBUG) 1085 if (getenv("QT_PM_REGISTRY") != NULL) 1086 qDebug("QSettings: WARNING: using Open32 registry due to QT_PM_REGISTRY=%s", 1087 getenv("QT_PM_REGISTRY")); 1088 #endif 1089 1090 return format; 1091 } 1092 1072 1093 QSettingsPrivate *QSettingsPrivate::create(QSettings::Format format, QSettings::Scope scope, 1073 1094 const QString &organization, const QString &application) 1074 1095 { 1096 format = checkFormat(format); 1097 1075 1098 if (format == QSettings::NativeFormat) { 1076 1099 return new QOS2SettingsPrivate(scope, organization, application); … … 1082 1105 QSettingsPrivate *QSettingsPrivate::create(const QString &fileName, QSettings::Format format) 1083 1106 { 1107 format = checkFormat(format); 1108 1084 1109 if (format == QSettings::NativeFormat) { 1085 1110 return new QOS2SettingsPrivate(fileName);
Note:
See TracChangeset
for help on using the changeset viewer.