diff options
Diffstat (limited to 'kdesktop/kxdglauncher.cpp')
-rw-r--r-- | kdesktop/kxdglauncher.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/kdesktop/kxdglauncher.cpp b/kdesktop/kxdglauncher.cpp index fba2c3fbf..ff173c842 100644 --- a/kdesktop/kxdglauncher.cpp +++ b/kdesktop/kxdglauncher.cpp @@ -30,6 +30,7 @@ #include <kglobalsettings.h> #include <kinputdialog.h> #include <kmessagebox.h> +#include <kconfig.h> #include <stdlib.h> @@ -130,9 +131,14 @@ int main( int argc, char **argv) directoryOk = TRUE; } if (directoryOk == true) { - char systemcommand[8192]; - sprintf(systemcommand, "xdg-user-dirs-update --set DOCUMENTS \"%s\"", newDirectory.ascii()); - system(systemcommand); + TQString xdgModifiedDirectory = newDirectory; + xdgModifiedDirectory = xdgModifiedDirectory.replace(TQDir::homeDirPath(), "$HOME"); + while (xdgModifiedDirectory.endsWith("/")) { + xdgModifiedDirectory.truncate(xdgModifiedDirectory.length()-1); + } + KConfig config(TQDir::homeDirPath() + "/.config/user-dirs.dirs", false, false); + config.writeEntry("XDG_DOCUMENTS_DIR", TQString("\"") + xdgModifiedDirectory + TQString("\""), true); + config.sync(); if (args->isSet( "getpath" ) == true) { printf("%s\n\r", getDocumentPath().ascii()); return 0; |