From ae5384b4bdea0c9ab28322bb53183bef569c77c5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 16 Sep 2010 20:28:28 +0000 Subject: 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 --- kdecore/kglobalsettings.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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('/'); -- cgit v1.2.1