From a10c7f11d065a9c220073dd0a5cfd35de07dacc1 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 23 Sep 2010 06:43:53 +0000 Subject: Fix issues with kxdglauncher git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1178447 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdesktop/kxdglauncher.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/kdesktop/kxdglauncher.cpp b/kdesktop/kxdglauncher.cpp index da650aeee..fba2c3fbf 100644 --- a/kdesktop/kxdglauncher.cpp +++ b/kdesktop/kxdglauncher.cpp @@ -120,7 +120,16 @@ int main( int argc, char **argv) } else { if (newDirectory.length() < 4096) { - if (myqdir.mkdir(newDirectory, TRUE) == true) { + bool directoryOk = false; + if (myqdir.exists(newDirectory, TRUE) == false) { + if (myqdir.mkdir(newDirectory, TRUE) == true) { + directoryOk = TRUE; + } + } + else { + directoryOk = TRUE; + } + if (directoryOk == true) { char systemcommand[8192]; sprintf(systemcommand, "xdg-user-dirs-update --set DOCUMENTS \"%s\"", newDirectory.ascii()); system(systemcommand); @@ -149,12 +158,12 @@ int main( int argc, char **argv) } } else { - printf("XDG variable not recognized\n\r"); + printf("[kxdglauncher] XDG variable not recognized\n\r"); return 1; } } else { - printf("Please specify the desired XDG variable name with --xdgname\n\r"); + printf("[kxdglauncher] Please specify the desired XDG variable name with --xdgname\n\r"); return 1; } } -- cgit v1.2.1