summaryrefslogtreecommitdiffstats
path: root/kdesktop/kxdglauncher.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-23 00:35:03 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-23 00:35:03 +0000
commit608d620c37af696840bed60ffa9d7d5098a8b3d4 (patch)
tree6331639945b3574ad796b738d9e8640760b421f4 /kdesktop/kxdglauncher.cpp
parent038192db168d9708aacfce2b30af3680587dc5b4 (diff)
downloadtdebase-608d620c37af696840bed60ffa9d7d5098a8b3d4.tar.gz
tdebase-608d620c37af696840bed60ffa9d7d5098a8b3d4.zip
Fix broken Documents shortcut in KMenu
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1178412 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdesktop/kxdglauncher.cpp')
-rw-r--r--kdesktop/kxdglauncher.cpp34
1 files changed, 23 insertions, 11 deletions
diff --git a/kdesktop/kxdglauncher.cpp b/kdesktop/kxdglauncher.cpp
index b22a2a5d7..da650aeee 100644
--- a/kdesktop/kxdglauncher.cpp
+++ b/kdesktop/kxdglauncher.cpp
@@ -83,6 +83,7 @@ TQString getDocumentPath()
static KCmdLineOptions options[] =
{
{ "xdgname <argument>", I18N_NOOP("XDG variable name to open"), 0 },
+ { "getpath", I18N_NOOP("Do not launch Konqueror; instead print path to directory if it exists)"), 0 },
KCmdLineLastOption
};
@@ -100,16 +101,21 @@ int main( int argc, char **argv)
if (desiredFolder == "DOCUMENTS") {
TQDir myqdir;
if (myqdir.exists(getDocumentPath(), TRUE) == true) {
- KRun * run = new KRun( KURL(getDocumentPath()), 0, false, false );
- TQObject::connect( run, TQT_SIGNAL( finished() ), &app, TQT_SLOT( quit() ));
- TQObject::connect( run, TQT_SIGNAL( error() ), &app, TQT_SLOT( quit() ));
- app.exec();
- return 0;
+ if (args->isSet( "getpath" ) == true) {
+ printf("%s\n\r", getDocumentPath().ascii());
+ return 0;
+ }
+ else {
+ KRun * run = new KRun( KURL(getDocumentPath()), 0, false, false );
+ TQObject::connect( run, TQT_SIGNAL( finished() ), &app, TQT_SLOT( quit() ));
+ TQObject::connect( run, TQT_SIGNAL( error() ), &app, TQT_SLOT( quit() ));
+ app.exec();
+ return 0;
+ }
}
else {
TQString newDirectory = KInputDialog::text("Create Documents directory", "Please confirm your Documents directory location<br>Upon confimation a new directory will be created", getDocumentPath());
if (newDirectory == TQString::null) {
- printf("User cancelled directory creation\n\r");
return 1;
}
else {
@@ -118,10 +124,16 @@ int main( int argc, char **argv)
char systemcommand[8192];
sprintf(systemcommand, "xdg-user-dirs-update --set DOCUMENTS \"%s\"", newDirectory.ascii());
system(systemcommand);
- KRun * run = new KRun( getDocumentPath(), 0, false, false );
- TQObject::connect( run, TQT_SIGNAL( finished() ), &app, TQT_SLOT( quit() ));
- TQObject::connect( run, TQT_SIGNAL( error() ), &app, TQT_SLOT( quit() ));
- app.exec();
+ if (args->isSet( "getpath" ) == true) {
+ printf("%s\n\r", getDocumentPath().ascii());
+ return 0;
+ }
+ else {
+ KRun * run = new KRun( getDocumentPath(), 0, false, false );
+ TQObject::connect( run, TQT_SIGNAL( finished() ), &app, TQT_SLOT( quit() ));
+ TQObject::connect( run, TQT_SIGNAL( error() ), &app, TQT_SLOT( quit() ));
+ app.exec();
+ }
return 0;
}
else {
@@ -145,4 +157,4 @@ int main( int argc, char **argv)
printf("Please specify the desired XDG variable name with --xdgname\n\r");
return 1;
}
-} \ No newline at end of file
+}