summaryrefslogtreecommitdiffstats
path: root/kdecore/kstandarddirs.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-16 22:36:03 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-16 22:36:03 +0000
commita1602e0cf6d615d5ce1c54b3bc006073eb74b05d (patch)
tree21cb11d930312fcb9af241fd1e3267a98a6d0a72 /kdecore/kstandarddirs.cpp
parentae5384b4bdea0c9ab28322bb53183bef569c77c5 (diff)
downloadtdelibs-a1602e0cf6d615d5ce1c54b3bc006073eb74b05d.tar.gz
tdelibs-a1602e0cf6d615d5ce1c54b3bc006073eb74b05d.zip
Autodetect usage of KDEROOTHOME variable
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1176194 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdecore/kstandarddirs.cpp')
-rw-r--r--kdecore/kstandarddirs.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/kdecore/kstandarddirs.cpp b/kdecore/kstandarddirs.cpp
index 800c0e191..f8b7bd307 100644
--- a/kdecore/kstandarddirs.cpp
+++ b/kdecore/kstandarddirs.cpp
@@ -1320,7 +1320,15 @@ void KStandardDirs::addKDEDefaults()
// We treat root differently to prevent a "su" shell messing up the
// file permissions in the user's home directory.
- TQString localKdeDir = readEnvPath(getuid() ? "KDEHOME" : "KDEROOTHOME");
+ TQString localKdeDir;
+ if (getuid() == 0) {
+ localKdeDir = readEnvPath("KDEROOTHOME");
+ if (localKdeDir.isEmpty() == true)
+ localKdeDir = readEnvPath("KDEHOME");
+ }
+ else {
+ localKdeDir = readEnvPath("KDEHOME");
+ }
if (!localKdeDir.isEmpty())
{
if (localKdeDir[localKdeDir.length()-1] != QChar('/'))