summaryrefslogtreecommitdiffstats
path: root/kdecore
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-16 20:28:28 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-16 20:28:28 +0000
commitae5384b4bdea0c9ab28322bb53183bef569c77c5 (patch)
treef5255cda8ced7daa61b696c3e7c74a87bbdd6352 /kdecore
parentb4eb2132ef5b2d1706bef6f53d0f24d2b1e9e8ff (diff)
downloadtdelibs-ae5384b4bdea0c9ab28322bb53183bef569c77c5.tar.gz
tdelibs-ae5384b4bdea0c9ab28322bb53183bef569c77c5.zip
Added default directories to kglobalsettings to prevent odd behaviour during XDG configuration problems
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1176159 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdecore')
-rw-r--r--kdecore/kglobalsettings.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/kdecore/kglobalsettings.cpp b/kdecore/kglobalsettings.cpp
index 5d6987550..35b958e9e 100644
--- a/kdecore/kglobalsettings.cpp
+++ b/kdecore/kglobalsettings.cpp
@@ -515,10 +515,20 @@ void KGlobalSettings::initStatic() // should be called initPaths(). Don't put an
// Read desktop and documents path using XDG_USER_DIRS
readXdgUserDirs(s_desktopPath, s_documentPath);
+ if (s_desktopPath->isEmpty() == true) {
+ *s_desktopPath = QDir::homeDirPath() + "/Desktop/";
+ }
*s_desktopPath = TQDir::cleanDirPath( *s_desktopPath );
if ( !s_desktopPath->endsWith("/") )
s_desktopPath->append('/');
+ if (s_documentPath->isEmpty() == true) {
+#ifdef Q_WS_WIN
+ *s_documentPath = getWin32ShellFoldersPath("Personal");
+#else
+ *s_documentPath = QDir::homeDirPath() + "/Documents/";
+#endif
+ }
*s_documentPath = TQDir::cleanDirPath( *s_documentPath );
if ( !s_documentPath->endsWith("/"))
s_documentPath->append('/');