diff options
-rw-r--r-- | tdecore/tdeglobalsettings.cpp | 64 |
1 files changed, 48 insertions, 16 deletions
diff --git a/tdecore/tdeglobalsettings.cpp b/tdecore/tdeglobalsettings.cpp index 4941a9eda..79cd4586a 100644 --- a/tdecore/tdeglobalsettings.cpp +++ b/tdecore/tdeglobalsettings.cpp @@ -141,36 +141,68 @@ static void readXdgUserDirs(TQString *desktop, TQString *documents, TQString *do // Use sane values in case some paths are missing if (desktop->isEmpty()) { - *desktop = TQDir::homeDirPath() + "/" + i18n("Desktop") + "/"; - } + *desktop = TQDir::homeDirPath() + "/" + "Desktop" + "/"; + if (!TQDir(*desktop).exists()) + { + *desktop = TQDir::homeDirPath() + "/" + i18n("Desktop") + "/"; + } + } if (documents->isEmpty()) { - *documents = TQDir::homeDirPath() + "/" + i18n("Documents") + "/"; - } + *documents = TQDir::homeDirPath() + "/" + "Documents" + "/"; + if (!TQDir(*documents).exists()) + { + *documents = TQDir::homeDirPath() + "/" + i18n("Documents") + "/"; + } + } if (download->isEmpty()) { - *download = TQDir::homeDirPath() + "/" + i18n("Downloads") + "/"; - } + *download = TQDir::homeDirPath() + "/" + "Downloads" + "/"; + if (!TQDir(*download).exists()) + { + *download = TQDir::homeDirPath() + "/" + i18n("Downloads") + "/"; + } + } if (music->isEmpty()) { - *music = TQDir::homeDirPath() + "/" + i18n("Music") + "/"; - } + *music = TQDir::homeDirPath() + "/" + "Music" + "/"; + if (!TQDir(*music).exists()) + { + *music = TQDir::homeDirPath() + "/" + i18n("Music") + "/"; + } + } if (pictures->isEmpty()) { - *pictures = TQDir::homeDirPath() + "/" + i18n("Pictures") + "/"; - } + *pictures = TQDir::homeDirPath() + "/" + "Pictures" + "/"; + if (!TQDir(*pictures).exists()) + { + *pictures = TQDir::homeDirPath() + "/" + i18n("Pictures") + "/"; + } + } if (publicShare->isEmpty()) { - *publicShare = TQDir::homeDirPath() + "/" + i18n("Public") + "/"; - } + *publicShare = TQDir::homeDirPath() + "/" + "Public" + "/"; + if (!TQDir(*publicShare).exists()) + { + *publicShare = TQDir::homeDirPath() + "/" + i18n("Public") + "/"; + } + } if (templates->isEmpty()) { - *templates = TQDir::homeDirPath() + "/" + i18n("Templates") + "/"; - } + *templates = TQDir::homeDirPath() + "/" + "Templates" + "/"; + if (!TQDir(*templates).exists()) + { + *templates = TQDir::homeDirPath() + "/" + i18n("Templates") + "/"; + } + } if (videos->isEmpty()) { - *videos = TQDir::homeDirPath() + "/" + i18n("Videos") + "/"; - } + *videos = TQDir::homeDirPath() + "/" + "Videos" + "/"; + if (!TQDir(*videos).exists()) + { + *videos = TQDir::homeDirPath() + "/" + i18n("Videos") + "/"; + } + } } static void checkAndCreateXdgFolder(const TQString &folder, const TQString &path, TDEConfig *config) |