summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kdesktop/kxdglauncher.cpp15
1 files 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;
}
}