diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-23 00:35:03 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-23 00:35:03 +0000 |
commit | 608d620c37af696840bed60ffa9d7d5098a8b3d4 (patch) | |
tree | 6331639945b3574ad796b738d9e8640760b421f4 | |
parent | 038192db168d9708aacfce2b30af3680587dc5b4 (diff) | |
download | tdebase-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
-rw-r--r-- | kdesktop/kxdglauncher.cpp | 34 | ||||
-rw-r--r-- | kioslave/system/entries/documents.desktop | 83 |
2 files changed, 91 insertions, 26 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 +} diff --git a/kioslave/system/entries/documents.desktop b/kioslave/system/entries/documents.desktop index ca461a586..225149c25 100644 --- a/kioslave/system/entries/documents.desktop +++ b/kioslave/system/entries/documents.desktop @@ -1,16 +1,69 @@ [Desktop Entry] -Encoding=UTF-8 -Comment= -Comment[en_US]= -Exec=kxdglauncher --xdgname DOCUMENTS -Icon=folder_wordprocessing -MimeType= -Name=My Documents -Name[en_US]=My Documents -StartupNotify=true -Terminal=false -TerminalOptions= -Type=Application -X-DCOP-ServiceType= -X-KDE-SubstituteUID=false -X-KDE-Username= +Type=Link +Path[$e]=$( kxdglauncher --getpath --xdgname DOCUMENTS ) +Icon=folder_man +Name=Documents Folder +Name[af]=Dokument Gids +Name[ar]=مستنداتي +Name[be]=ТÑчка Ð´Ð»Ñ Ð´Ð°ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñž +Name[bg]=Ð”Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ñ Ð´Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð¸ +Name[bn]=ডকà§à¦®à§‡à¦¨à§à¦Ÿ ফোলà§à¦¡à¦¾à¦° +Name[br]=Renkell an teulioù +Name[bs]=Direktorij dokumenata +Name[ca]=Carpeta de documents +Name[cs]=Složka s dokumenty +Name[csb]=Katalog dokùmentów +Name[da]=Dokumentmappe +Name[de]=Dokumente +Name[el]=Φάκελος εγγÏάφων +Name[eo]=Dokumenta dosierujo +Name[es]=Carpeta de documentos +Name[et]=Dokumentide kataloog +Name[eu]=Dokumentuen karpeta +Name[fa]=پوشۀ مستندات +Name[fi]=Asiakirjakansio +Name[fr]=Dossier des documents +Name[fy]=Ofkeppele kamera +Name[ga]=Fillteán na gCáipéisà +Name[gl]=Cartafol de Documentos +Name[he]=תיקיית ×ž×¡×ž×›×™× +Name[hr]=Mapa dokumenata +Name[hu]=Dokumentumok könyvtár +Name[is]=Skjalamappa +Name[it]=Cartella documenti +Name[ja]=ドã‚ュメントフォルダ +Name[ka]=დáƒáƒ™áƒ£áƒ›áƒ”ნტების დáƒáƒ¡áƒ¢áƒ +Name[kk]=Құжаттар қапшығы +Name[km]=ážážâ€‹áž¯áž€ážŸáž¶ážš +Name[ko]=문서 íƒìƒ‰ê¸° +Name[lt]=Dokumentų aplankai +Name[mk]=Папка Ñо документи +Name[nb]=Dokumentmappe +Name[nds]=Dokmenten-Orner +Name[ne]=कागजात फोलà¥à¤¡à¤° +Name[nl]=Documenten +Name[nn]=Dokumentmappe +Name[pa]=ਦਸਤਾਵੇਜ਼ ਫੋਲਡਰ +Name[pl]=Katalog dokumentów +Name[pt]=Pasta de Documentos +Name[pt_BR]=Pasta de Documentos +Name[ro]=Folder documente +Name[ru]=Документы +Name[se]=Dokumeantamáhppa +Name[sk]=PrieÄinok dokumentov +Name[sl]=Mapa z dokumenti +Name[sr]=ФаÑцикла Ñа документима +Name[sr@Latn]=Fascikla sa dokumentima +Name[sv]=Dokumentkatalog +Name[te]=పతà±à°°à°¾à°² ఫొలà±à°¡à°°à± +Name[tg]=Ҳуҷҷатҳо +Name[th]=โฟลเดà¸à¸£à¹Œà¹€à¸à¸à¸ªà¸²à¸£ +Name[tr]=Belgeler Dizini +Name[uk]=Тека документів +Name[uz]=Hujjatlar jildi +Name[uz@cyrillic]=Ҳужжатлар жилди +Name[vi]=ThÆ° mục Tà i liệu +Name[wa]=Ridant documints +Name[zh_CN]=文档文件夹 +Name[zh_TW]=文件目錄 + |