Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
kdebase3
khotkeys-multimedia-action2.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File khotkeys-multimedia-action2.diff of Package kdebase3
--- khotkeys/shared/actions.cpp.sav 2006-12-06 16:54:40.000000000 +0100 +++ khotkeys/shared/actions.cpp 2006-12-18 18:11:47.000000000 +0100 @@ -29,6 +29,7 @@ #include <kaccel.h> #include <kservice.h> #include <kprocess.h> +#include <qregexp.h> #include "windows.h" #include "action_data.h" @@ -116,14 +117,16 @@ void Command_url_action::execute() { if( command_url().isEmpty()) return; - KURIFilterData uri; QString cmd = command_url(); static bool sm_ready = false; if( !sm_ready ) { 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 ] != '\\' ) @@ -170,6 +173,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(); --- khotkeys/shared/actions.h.sav 2006-12-06 16:54:40.000000000 +0100 +++ khotkeys/shared/actions.h 2006-12-14 15:53:16.000000000 +0100 @@ -75,6 +75,7 @@ class KDE_EXPORT Command_url_action protected: QTimer timeout; private: + bool substituteAndHandleSpecial( QString& cmd ); QString _command_url; };
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor