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
v3.5.13-sru
tpearson 14 years ago
parent b4eb2132ef
commit ae5384b4bd

@ -515,10 +515,20 @@ void KGlobalSettings::initStatic() // should be called initPaths(). Don't put an
// Read desktop and documents path using XDG_USER_DIRS // Read desktop and documents path using XDG_USER_DIRS
readXdgUserDirs(s_desktopPath, s_documentPath); readXdgUserDirs(s_desktopPath, s_documentPath);
if (s_desktopPath->isEmpty() == true) {
*s_desktopPath = QDir::homeDirPath() + "/Desktop/";
}
*s_desktopPath = TQDir::cleanDirPath( *s_desktopPath ); *s_desktopPath = TQDir::cleanDirPath( *s_desktopPath );
if ( !s_desktopPath->endsWith("/") ) if ( !s_desktopPath->endsWith("/") )
s_desktopPath->append('/'); 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 ); *s_documentPath = TQDir::cleanDirPath( *s_documentPath );
if ( !s_documentPath->endsWith("/")) if ( !s_documentPath->endsWith("/"))
s_documentPath->append('/'); s_documentPath->append('/');

Loading…
Cancel
Save