diff options
author | Robert Xu <robxu9@gmail.com> | 2011-11-10 18:04:39 -0500 |
---|---|---|
committer | Robert Xu <robxu9@gmail.com> | 2011-11-10 18:04:39 -0500 |
commit | 21fcfa3348213aa87f0e3aef62ca4720c6d31cb7 (patch) | |
tree | 2cfb64c59322628e613ed0895e3c3694d3abe6bd /opensuse/tdebase/khotkeys-multimedia-action2.diff | |
parent | 8667643bff14a60d8571c599efd3e48bed3e3b12 (diff) | |
download | tde-packaging-21fcfa3348213aa87f0e3aef62ca4720c6d31cb7.tar.gz tde-packaging-21fcfa3348213aa87f0e3aef62ca4720c6d31cb7.zip |
initial commit to suse branch: eclipse integration
Diffstat (limited to 'opensuse/tdebase/khotkeys-multimedia-action2.diff')
-rw-r--r-- | opensuse/tdebase/khotkeys-multimedia-action2.diff | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/opensuse/tdebase/khotkeys-multimedia-action2.diff b/opensuse/tdebase/khotkeys-multimedia-action2.diff deleted file mode 100644 index 9f995b1ab..000000000 --- a/opensuse/tdebase/khotkeys-multimedia-action2.diff +++ /dev/null @@ -1,81 +0,0 @@ -Index: khotkeys/shared/actions.cpp -=================================================================== ---- khotkeys/shared/actions.cpp.orig -+++ khotkeys/shared/actions.cpp -@@ -29,6 +29,7 @@ - #include <kaccel.h> - #include <kservice.h> - #include <kprocess.h> -+#include <qregexp.h> - - #include "windows.h" - #include "action_data.h" -@@ -116,7 +117,6 @@ void Command_url_action::execute() - { - if( command_url().isEmpty()) - return; -- KURIFilterData uri; - QString cmd = command_url(); - static bool sm_ready = false; - if( !sm_ready ) -@@ -124,6 +124,9 @@ void Command_url_action::execute() - kapp->propagateSessionManager(); - sm_ready = true; - } -+ if( substituteAndHandleSpecial( cmd )) -+ return; -+ KURIFilterData uri; - // int space_pos = command_url().find( ' ' ); - // if( command_url()[ 0 ] != '\'' && command_url()[ 0 ] != '"' && space_pos > -1 - // && command_url()[ space_pos - 1 ] != '\\' ) -@@ -176,6 +179,38 @@ void Command_url_action::execute() - timeout.start( 1000, true ); // 1sec timeout - } - -+// do special command substitutions, return true if also already handled -+bool Command_url_action::substituteAndHandleSpecial( QString& cmd ) -+ { -+ if( cmd.contains( "KHOTKEYS_BROWSER" )) -+ { // the default browser -+ KConfig config( QString::fromLatin1("kfmclientrc")); // see KRun -+ config.setGroup("General"); -+ QString browser = config.readEntry("BrowserApplication"); -+ if( browser.startsWith( QString::fromLatin1( "!" ))) -+ browser = browser.mid( 1 ); -+ else -+ { -+ KService::Ptr service = KService::serviceByStorageId( browser ); -+ if( service ) -+ { -+ browser = service->exec(); -+ browser.replace( QRegExp( " %.?" ), "" ); // remove " %u" and others -+ } -+ } -+ if( browser.isEmpty()) -+ browser = QString::fromLatin1( "konqueror" ); // opens in webbrowsing profile by default -+ cmd = cmd.replace( "KHOTKEYS_BROWSER", browser ); -+ } -+ if( cmd.contains( "KHOTKEYS_TERMINAL" )) -+ { // the default terminal application -+ KConfigGroup config( KGlobal::config(), "General" ); -+ QString terminal = config.readPathEntry( "TerminalApplication", "konsole" ); -+ cmd = cmd.replace( "KHOTKEYS_TERMINAL", terminal ); -+ } -+ return false; -+ } -+ - QString Command_url_action::description() const - { - return i18n( "Command/URL : " ) + command_url(); -Index: khotkeys/shared/actions.h -=================================================================== ---- khotkeys/shared/actions.h.orig -+++ khotkeys/shared/actions.h -@@ -75,6 +75,7 @@ class KDE_EXPORT Command_url_action - protected: - QTimer timeout; - private: -+ bool substituteAndHandleSpecial( QString& cmd ); - QString _command_url; - }; - |