author | ulf69 <ulf69> | 2004-10-01 18:10:17 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-01 18:10:17 (UTC) |
commit | 7810fe355bd75c83bcdaed646cd1dde8d3c94fcb (patch) (unidiff) | |
tree | 7f425b9d7ba5109a289414c2903fff7c5182f700 /microkde/kdecore/kstandarddirs.cpp | |
parent | ae6aaaf2ec81317d275ebaabba2de188279b58cd (diff) | |
download | kdepimpi-7810fe355bd75c83bcdaed646cd1dde8d3c94fcb.zip kdepimpi-7810fe355bd75c83bcdaed646cd1dde8d3c94fcb.tar.gz kdepimpi-7810fe355bd75c83bcdaed646cd1dde8d3c94fcb.tar.bz2 |
added env variables QTDIR and OPIEDIR to search for libraries.
This is a fix for pdaXROM users that have not set QPEDIR
Diffstat (limited to 'microkde/kdecore/kstandarddirs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kdecore/kstandarddirs.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index 500426b..7f2a326 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp | |||
@@ -1194,97 +1194,108 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode) | |||
1194 | qDebug("KStandardDirs::makeDir could not create: %s" , base.latin1()); | 1194 | qDebug("KStandardDirs::makeDir could not create: %s" , base.latin1()); |
1195 | return false; | 1195 | return false; |
1196 | } | 1196 | } |
1197 | } | 1197 | } |
1198 | 1198 | ||
1199 | i = pos + 1; | 1199 | i = pos + 1; |
1200 | } | 1200 | } |
1201 | return true; | 1201 | return true; |
1202 | 1202 | ||
1203 | } | 1203 | } |
1204 | 1204 | ||
1205 | static QString readEnvPath(const char *env) | 1205 | static QString readEnvPath(const char *env) |
1206 | { | 1206 | { |
1207 | #ifdef _WIN32_ | 1207 | #ifdef _WIN32_ |
1208 | return ""; | 1208 | return ""; |
1209 | #else | 1209 | #else |
1210 | QCString c_path = getenv(env); | 1210 | QCString c_path = getenv(env); |
1211 | if (c_path.isEmpty()) | 1211 | if (c_path.isEmpty()) |
1212 | return QString::null; | 1212 | return QString::null; |
1213 | return QFile::decodeName(c_path); | 1213 | return QFile::decodeName(c_path); |
1214 | #endif | 1214 | #endif |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | void KStandardDirs::addKDEDefaults() | 1217 | void KStandardDirs::addKDEDefaults() |
1218 | { | 1218 | { |
1219 | //qDebug("ERROR: KStandardDirs::addKDEDefaults() called "); | 1219 | //qDebug("ERROR: KStandardDirs::addKDEDefaults() called "); |
1220 | //return; | 1220 | //return; |
1221 | QStringList kdedirList; | 1221 | QStringList kdedirList; |
1222 | 1222 | ||
1223 | // begin KDEDIRS | 1223 | // begin KDEDIRS |
1224 | QString kdedirs = readEnvPath("MICROKDEDIRS"); | 1224 | QString kdedirs = readEnvPath("MICROKDEDIRS"); |
1225 | if (!kdedirs.isEmpty()) | 1225 | if (!kdedirs.isEmpty()) |
1226 | { | 1226 | { |
1227 | tokenize(kdedirList, kdedirs, ":"); | 1227 | tokenize(kdedirList, kdedirs, ":"); |
1228 | } | 1228 | } |
1229 | else | 1229 | else |
1230 | { | 1230 | { |
1231 | QString kdedir = readEnvPath("MICROKDEDIR"); | 1231 | QString kdedir = readEnvPath("MICROKDEDIR"); |
1232 | if (!kdedir.isEmpty()) | 1232 | if (!kdedir.isEmpty()) |
1233 | { | 1233 | { |
1234 | kdedir = KShell::tildeExpand(kdedir); | 1234 | kdedir = KShell::tildeExpand(kdedir); |
1235 | kdedirList.append(kdedir); | 1235 | kdedirList.append(kdedir); |
1236 | } | 1236 | } |
1237 | } | 1237 | } |
1238 | //US kdedirList.append(KDEDIR); | 1238 | //US kdedirList.append(KDEDIR); |
1239 | //US for embedded, add qtopia dir as kdedir | 1239 | //US for embedded, add qtopia dir as kdedir |
1240 | 1240 | ||
1241 | #ifndef DESKTOP_VERSION | 1241 | #ifndef DESKTOP_VERSION |
1242 | kdedirList.append(readEnvPath("QPEDIR" )); | 1242 | QString tmp = readEnvPath("QPEDIR"); |
1243 | if (!tmp.isEmpty()) | ||
1244 | kdedirList.append(tmp); | ||
1245 | |||
1246 | tmp = readEnvPath("QTDIR"); | ||
1247 | if (!tmp.isEmpty()) | ||
1248 | kdedirList.append(tmp); | ||
1249 | |||
1250 | tmp = readEnvPath("OPIEDIR"); | ||
1251 | if (!tmp.isEmpty()) | ||
1252 | kdedirList.append(tmp); | ||
1253 | |||
1243 | #endif | 1254 | #endif |
1244 | 1255 | ||
1245 | #ifdef __KDE_EXECPREFIX | 1256 | #ifdef __KDE_EXECPREFIX |
1246 | QString execPrefix(__KDE_EXECPREFIX); | 1257 | QString execPrefix(__KDE_EXECPREFIX); |
1247 | if (execPrefix!="NONE") | 1258 | if (execPrefix!="NONE") |
1248 | kdedirList.append(execPrefix); | 1259 | kdedirList.append(execPrefix); |
1249 | #endif | 1260 | #endif |
1250 | 1261 | ||
1251 | QString localKdeDir; | 1262 | QString localKdeDir; |
1252 | 1263 | ||
1253 | //US if (getuid()) | 1264 | //US if (getuid()) |
1254 | if (true) | 1265 | if (true) |
1255 | { | 1266 | { |
1256 | localKdeDir = readEnvPath("MICROKDEHOME"); | 1267 | localKdeDir = readEnvPath("MICROKDEHOME"); |
1257 | if (!localKdeDir.isEmpty()) | 1268 | if (!localKdeDir.isEmpty()) |
1258 | { | 1269 | { |
1259 | if (localKdeDir.at(localKdeDir.length()-1) != '/') | 1270 | if (localKdeDir.at(localKdeDir.length()-1) != '/') |
1260 | localKdeDir += '/'; | 1271 | localKdeDir += '/'; |
1261 | } | 1272 | } |
1262 | else | 1273 | else |
1263 | { | 1274 | { |
1264 | localKdeDir = QDir::homeDirPath() + "/kdepim/"; | 1275 | localKdeDir = QDir::homeDirPath() + "/kdepim/"; |
1265 | } | 1276 | } |
1266 | } | 1277 | } |
1267 | else | 1278 | else |
1268 | { | 1279 | { |
1269 | // We treat root different to prevent root messing up the | 1280 | // We treat root different to prevent root messing up the |
1270 | // file permissions in the users home directory. | 1281 | // file permissions in the users home directory. |
1271 | localKdeDir = readEnvPath("MICROKDEROOTHOME"); | 1282 | localKdeDir = readEnvPath("MICROKDEROOTHOME"); |
1272 | if (!localKdeDir.isEmpty()) | 1283 | if (!localKdeDir.isEmpty()) |
1273 | { | 1284 | { |
1274 | if (localKdeDir.at(localKdeDir.length()-1) != '/') | 1285 | if (localKdeDir.at(localKdeDir.length()-1) != '/') |
1275 | localKdeDir += '/'; | 1286 | localKdeDir += '/'; |
1276 | } | 1287 | } |
1277 | else | 1288 | else |
1278 | { | 1289 | { |
1279 | //US struct passwd *pw = getpwuid(0); | 1290 | //US struct passwd *pw = getpwuid(0); |
1280 | //US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/"; | 1291 | //US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/"; |
1281 | qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed"); | 1292 | qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed"); |
1282 | } | 1293 | } |
1283 | 1294 | ||
1284 | } | 1295 | } |
1285 | 1296 | ||
1286 | //US localKdeDir = appDir(); | 1297 | //US localKdeDir = appDir(); |
1287 | 1298 | ||
1288 | //US | 1299 | //US |
1289 | // qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1()); | 1300 | // qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1()); |
1290 | if (localKdeDir != "-/") | 1301 | if (localKdeDir != "-/") |