summaryrefslogtreecommitdiffabout
path: root/microkde/kdecore/kstandarddirs.cpp
Unidiff
Diffstat (limited to 'microkde/kdecore/kstandarddirs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdecore/kstandarddirs.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp
index 4c03c15..f3584d7 100644
--- a/microkde/kdecore/kstandarddirs.cpp
+++ b/microkde/kdecore/kstandarddirs.cpp
@@ -1238,97 +1238,99 @@ 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 localKdeDir = QDir::homeDirPath() + "/kdepim/"; 1286 KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" );
1287 cfg.setGroup("Global");
1288 localKdeDir = cfg.readEntry( "MICROKDEHOME", QDir::homeDirPath() + "/kdepim/" );
1287 } 1289 }
1288 } 1290 }
1289 else 1291 else
1290 { 1292 {
1291 // We treat root different to prevent root messing up the 1293 // We treat root different to prevent root messing up the
1292 // file permissions in the users home directory. 1294 // file permissions in the users home directory.
1293 localKdeDir = readEnvPath("MICROKDEROOTHOME"); 1295 localKdeDir = readEnvPath("MICROKDEROOTHOME");
1294 if (!localKdeDir.isEmpty()) 1296 if (!localKdeDir.isEmpty())
1295 { 1297 {
1296 if (localKdeDir.at(localKdeDir.length()-1) != '/') 1298 if (localKdeDir.at(localKdeDir.length()-1) != '/')
1297 localKdeDir += '/'; 1299 localKdeDir += '/';
1298 } 1300 }
1299 else 1301 else
1300 { 1302 {
1301//US struct passwd *pw = getpwuid(0); 1303//US struct passwd *pw = getpwuid(0);
1302//US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/"; 1304//US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/";
1303 qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed"); 1305 qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed");
1304 } 1306 }
1305 1307
1306 } 1308 }
1307 1309
1308//US localKdeDir = appDir(); 1310//US localKdeDir = appDir();
1309 1311
1310//US 1312//US
1311// qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1()); 1313// qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1());
1312 if (localKdeDir != "-/") 1314 if (localKdeDir != "-/")
1313 { 1315 {
1314 localKdeDir = KShell::tildeExpand(localKdeDir); 1316 localKdeDir = KShell::tildeExpand(localKdeDir);
1315 addPrefix(localKdeDir); 1317 addPrefix(localKdeDir);
1316 } 1318 }
1317 1319
1318 for (QStringList::ConstIterator it = kdedirList.begin(); 1320 for (QStringList::ConstIterator it = kdedirList.begin();
1319 it != kdedirList.end(); it++) 1321 it != kdedirList.end(); it++)
1320 { 1322 {
1321 QString dir = KShell::tildeExpand(*it); 1323 QString dir = KShell::tildeExpand(*it);
1322 addPrefix(dir); 1324 addPrefix(dir);
1323 } 1325 }
1324 // end KDEDIRS 1326 // end KDEDIRS
1325 1327
1326 // begin XDG_CONFIG_XXX 1328 // begin XDG_CONFIG_XXX
1327 QStringList xdgdirList; 1329 QStringList xdgdirList;
1328 QString xdgdirs = readEnvPath("XDG_CONFIG_DIRS"); 1330 QString xdgdirs = readEnvPath("XDG_CONFIG_DIRS");
1329 if (!xdgdirs.isEmpty()) 1331 if (!xdgdirs.isEmpty())
1330 { 1332 {
1331 tokenize(xdgdirList, xdgdirs, ":"); 1333 tokenize(xdgdirList, xdgdirs, ":");
1332 } 1334 }
1333 else 1335 else
1334 { 1336 {