summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-30 16:36:11 (UTC)
committer zautrix <zautrix>2005-03-30 16:36:11 (UTC)
commit95ec57b2f9df64dc40067c3a2278438029517f4c (patch) (side-by-side diff)
treee1abf6285aa4facedde892dddf1d38baa21b6fb0
parent8c160d7aeeab1d22382ced11440712f6541a6db7 (diff)
downloadkdepimpi-95ec57b2f9df64dc40067c3a2278438029517f4c.zip
kdepimpi-95ec57b2f9df64dc40067c3a2278438029517f4c.tar.gz
kdepimpi-95ec57b2f9df64dc40067c3a2278438029517f4c.tar.bz2
win fix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--microkde/kdecore/kstandarddirs.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp
index 4ab1a68..d5bfefd 100644
--- a/microkde/kdecore/kstandarddirs.cpp
+++ b/microkde/kdecore/kstandarddirs.cpp
@@ -1278,65 +1278,70 @@ void KStandardDirs::addKDEDefaults()
#else
if (localKdeDir.at(localKdeDir.length()-1) != '/')
localKdeDir += '/';
#endif
//QMessageBox::information( 0,"localKdeDir",localKdeDir, 1 );
}
else
{
QString confFile;
#ifdef DESKTOP_VERSION
confFile = qApp->applicationDirPath ()+ "/.microkdehome" ;
QFileInfo fi ( confFile );
if ( !fi.exists() )
confFile = QDir::homeDirPath() + "/.microkdehome";
else
qDebug("Loading path info from " + confFile );
#else
confFile = QDir::homeDirPath() + "/.microkdehome";
#endif
KConfig cfg ( confFile );
cfg.setGroup("Global");
localKdeDir = cfg.readEntry( "MICROKDEHOME", QDir::homeDirPath() + "/kdepim/" );
#ifdef DESKTOP_VERSION
if ( localKdeDir.startsWith( "LOCAL:" ) ) {
#ifdef _WIN32_
localKdeDir = qApp->applicationDirPath () + "\\"+ localKdeDir.mid( 6 );
#else
localKdeDir = qApp->applicationDirPath () + "/"+ localKdeDir.mid( 6 );
#endif
qDebug("Using local conf dir %s ",localKdeDir.latin1() );
// <stdlib.h>
+#ifdef _WIN32_
+ QString envSt = "LOCALMICROKDEHOME="+localKdeDir;
+ _putenv( envSt.latin1());
+#else
setenv( "LOCALMICROKDEHOME", localKdeDir.latin1(), 1 );
+#endif
}
#endif
}
}
else
{
// We treat root different to prevent root messing up the
// file permissions in the users home directory.
localKdeDir = readEnvPath("MICROKDEROOTHOME");
if (!localKdeDir.isEmpty())
{
if (localKdeDir.at(localKdeDir.length()-1) != '/')
localKdeDir += '/';
}
else
{
//US struct passwd *pw = getpwuid(0);
//US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/";
qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed");
}
}
//US localKdeDir = appDir();
//US
// qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1());
if (localKdeDir != "-/")
{
localKdeDir = KShell::tildeExpand(localKdeDir);
addPrefix(localKdeDir);
}