author | zautrix <zautrix> | 2005-01-29 05:45:29 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-29 05:45:29 (UTC) |
commit | 0850ade22908615389800c6ee973f5906154d980 (patch) (unidiff) | |
tree | f15401c42b2b4e86662f478c7e148c8de1a04b2b /microkde | |
parent | a710cbadcbce154dff51445e756f8e3fc77278f9 (diff) | |
download | kdepimpi-0850ade22908615389800c6ee973f5906154d980.zip kdepimpi-0850ade22908615389800c6ee973f5906154d980.tar.gz kdepimpi-0850ade22908615389800c6ee973f5906154d980.tar.bz2 |
desktop fix
-rw-r--r-- | microkde/kdecore/kstandarddirs.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index f3584d7..cf0d1ee 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp | |||
@@ -1238,97 +1238,109 @@ void KStandardDirs::addKDEDefaults() | |||
1238 | { | 1238 | { |
1239 | kdedir = KShell::tildeExpand(kdedir); | 1239 | kdedir = KShell::tildeExpand(kdedir); |
1240 | kdedirList.append(kdedir); | 1240 | kdedirList.append(kdedir); |
1241 | } | 1241 | } |
1242 | } | 1242 | } |
1243 | //US kdedirList.append(KDEDIR); | 1243 | //US kdedirList.append(KDEDIR); |
1244 | //US for embedded, add qtopia dir as kdedir | 1244 | //US for embedded, add qtopia dir as kdedir |
1245 | 1245 | ||
1246 | #ifndef DESKTOP_VERSION | 1246 | #ifndef DESKTOP_VERSION |
1247 | QString tmp = readEnvPath("QPEDIR"); | 1247 | QString tmp = readEnvPath("QPEDIR"); |
1248 | if (!tmp.isEmpty()) | 1248 | if (!tmp.isEmpty()) |
1249 | kdedirList.append(tmp); | 1249 | kdedirList.append(tmp); |
1250 | 1250 | ||
1251 | tmp = readEnvPath("QTDIR"); | 1251 | tmp = readEnvPath("QTDIR"); |
1252 | if (!tmp.isEmpty()) | 1252 | if (!tmp.isEmpty()) |
1253 | kdedirList.append(tmp); | 1253 | kdedirList.append(tmp); |
1254 | 1254 | ||
1255 | tmp = readEnvPath("OPIEDIR"); | 1255 | tmp = readEnvPath("OPIEDIR"); |
1256 | if (!tmp.isEmpty()) | 1256 | if (!tmp.isEmpty()) |
1257 | kdedirList.append(tmp); | 1257 | kdedirList.append(tmp); |
1258 | 1258 | ||
1259 | #endif | 1259 | #endif |
1260 | 1260 | ||
1261 | #ifdef __KDE_EXECPREFIX | 1261 | #ifdef __KDE_EXECPREFIX |
1262 | QString execPrefix(__KDE_EXECPREFIX); | 1262 | QString execPrefix(__KDE_EXECPREFIX); |
1263 | if (execPrefix!="NONE") | 1263 | if (execPrefix!="NONE") |
1264 | kdedirList.append(execPrefix); | 1264 | kdedirList.append(execPrefix); |
1265 | #endif | 1265 | #endif |
1266 | 1266 | ||
1267 | QString localKdeDir; | 1267 | QString localKdeDir; |
1268 | 1268 | ||
1269 | //US if (getuid()) | 1269 | //US if (getuid()) |
1270 | if (true) | 1270 | if (true) |
1271 | { | 1271 | { |
1272 | localKdeDir = readEnvPath("MICROKDEHOME"); | 1272 | localKdeDir = readEnvPath("MICROKDEHOME"); |
1273 | if (!localKdeDir.isEmpty()) | 1273 | if (!localKdeDir.isEmpty()) |
1274 | { | 1274 | { |
1275 | #ifdef _WIN32_ | 1275 | #ifdef _WIN32_ |
1276 | if (localKdeDir.at(localKdeDir.length()-1) != '\\') | 1276 | if (localKdeDir.at(localKdeDir.length()-1) != '\\') |
1277 | localKdeDir += '\\'; | 1277 | localKdeDir += '\\'; |
1278 | #else | 1278 | #else |
1279 | if (localKdeDir.at(localKdeDir.length()-1) != '/') | 1279 | if (localKdeDir.at(localKdeDir.length()-1) != '/') |
1280 | localKdeDir += '/'; | 1280 | localKdeDir += '/'; |
1281 | #endif | 1281 | #endif |
1282 | //QMessageBox::information( 0,"localKdeDir",localKdeDir, 1 ); | 1282 | //QMessageBox::information( 0,"localKdeDir",localKdeDir, 1 ); |
1283 | } | 1283 | } |
1284 | else | 1284 | else |
1285 | { | 1285 | { |
1286 | KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" ); | 1286 | QString confFile; |
1287 | #ifdef DESKTOP_VERSION | ||
1288 | confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; | ||
1289 | QFileInfo fi ( confFile ); | ||
1290 | if ( !fi.exists() ) | ||
1291 | confFile = QDir::homeDirPath() + "/.microkdehome"; | ||
1292 | else | ||
1293 | qDebug("Loading path info from " + confFile ); | ||
1294 | |||
1295 | #else | ||
1296 | confFile = QDir::homeDirPath() + "/.microkdehome"; | ||
1297 | #endif | ||
1298 | KConfig cfg ( confFile ); | ||
1287 | cfg.setGroup("Global"); | 1299 | cfg.setGroup("Global"); |
1288 | localKdeDir = cfg.readEntry( "MICROKDEHOME", QDir::homeDirPath() + "/kdepim/" ); | 1300 | localKdeDir = cfg.readEntry( "MICROKDEHOME", QDir::homeDirPath() + "/kdepim/" ); |
1289 | } | 1301 | } |
1290 | } | 1302 | } |
1291 | else | 1303 | else |
1292 | { | 1304 | { |
1293 | // We treat root different to prevent root messing up the | 1305 | // We treat root different to prevent root messing up the |
1294 | // file permissions in the users home directory. | 1306 | // file permissions in the users home directory. |
1295 | localKdeDir = readEnvPath("MICROKDEROOTHOME"); | 1307 | localKdeDir = readEnvPath("MICROKDEROOTHOME"); |
1296 | if (!localKdeDir.isEmpty()) | 1308 | if (!localKdeDir.isEmpty()) |
1297 | { | 1309 | { |
1298 | if (localKdeDir.at(localKdeDir.length()-1) != '/') | 1310 | if (localKdeDir.at(localKdeDir.length()-1) != '/') |
1299 | localKdeDir += '/'; | 1311 | localKdeDir += '/'; |
1300 | } | 1312 | } |
1301 | else | 1313 | else |
1302 | { | 1314 | { |
1303 | //US struct passwd *pw = getpwuid(0); | 1315 | //US struct passwd *pw = getpwuid(0); |
1304 | //US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/"; | 1316 | //US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/"; |
1305 | qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed"); | 1317 | qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed"); |
1306 | } | 1318 | } |
1307 | 1319 | ||
1308 | } | 1320 | } |
1309 | 1321 | ||
1310 | //US localKdeDir = appDir(); | 1322 | //US localKdeDir = appDir(); |
1311 | 1323 | ||
1312 | //US | 1324 | //US |
1313 | // qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1()); | 1325 | // qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1()); |
1314 | if (localKdeDir != "-/") | 1326 | if (localKdeDir != "-/") |
1315 | { | 1327 | { |
1316 | localKdeDir = KShell::tildeExpand(localKdeDir); | 1328 | localKdeDir = KShell::tildeExpand(localKdeDir); |
1317 | addPrefix(localKdeDir); | 1329 | addPrefix(localKdeDir); |
1318 | } | 1330 | } |
1319 | 1331 | ||
1320 | for (QStringList::ConstIterator it = kdedirList.begin(); | 1332 | for (QStringList::ConstIterator it = kdedirList.begin(); |
1321 | it != kdedirList.end(); it++) | 1333 | it != kdedirList.end(); it++) |
1322 | { | 1334 | { |
1323 | QString dir = KShell::tildeExpand(*it); | 1335 | QString dir = KShell::tildeExpand(*it); |
1324 | addPrefix(dir); | 1336 | addPrefix(dir); |
1325 | } | 1337 | } |
1326 | // end KDEDIRS | 1338 | // end KDEDIRS |
1327 | 1339 | ||
1328 | // begin XDG_CONFIG_XXX | 1340 | // begin XDG_CONFIG_XXX |
1329 | QStringList xdgdirList; | 1341 | QStringList xdgdirList; |
1330 | QString xdgdirs = readEnvPath("XDG_CONFIG_DIRS"); | 1342 | QString xdgdirs = readEnvPath("XDG_CONFIG_DIRS"); |
1331 | if (!xdgdirs.isEmpty()) | 1343 | if (!xdgdirs.isEmpty()) |
1332 | { | 1344 | { |
1333 | tokenize(xdgdirList, xdgdirs, ":"); | 1345 | tokenize(xdgdirList, xdgdirs, ":"); |
1334 | } | 1346 | } |