summaryrefslogtreecommitdiffstats
path: root/klipper/urlgrabber.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 20:21:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 20:21:27 +0000
commit10e41144596fc9ced40fc349d9ecd099b1c2ea19 (patch)
tree88ab04e475ff5a4cd889cb082f5760b6e0bf5e4e /klipper/urlgrabber.cpp
parent4aed2c8219774f5d797760606b8489a92ddc5163 (diff)
downloadtdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.tar.gz
tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.zip
Initial import of Trinity 3.5.11 to kdebase
Extends krandrtray, adds iccconfig kcontrol module, adds run dialog autocomplete and lots of bugfixes Will need to check for commit warnings and repair as encountered Also needs full compile test git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1061475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'klipper/urlgrabber.cpp')
-rw-r--r--klipper/urlgrabber.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/klipper/urlgrabber.cpp b/klipper/urlgrabber.cpp
index 352f3ab74..45d5f5e4b 100644
--- a/klipper/urlgrabber.cpp
+++ b/klipper/urlgrabber.cpp
@@ -51,7 +51,6 @@ URLGrabber::URLGrabber( KConfig* config )
{
if( m_config == NULL )
m_config = kapp->config();
- myCurrentAction = 0L;
myMenu = 0L;
myPopupKillTimeout = 8;
m_stripWhiteSpace = true;
@@ -160,6 +159,7 @@ void URLGrabber::actionMenu( bool wm_class_check )
QString item;
myCommandMapper.clear();
+ myGroupingMapper.clear();
myPopupKillTimer->stop();
delete myMenu;
@@ -184,6 +184,7 @@ void URLGrabber::actionMenu( bool wm_class_check )
else
id = myMenu->insertItem( SmallIcon(command->pixmap), item);
myCommandMapper.insert( id, command );
+ myGroupingMapper.insert( id, action->capturedTexts() );
}
}
@@ -224,19 +225,27 @@ void URLGrabber::slotItemSelected( int id )
break;
default:
ClipCommand *command = myCommandMapper.find( id );
- if ( !command )
+ QStringList *backrefs = myGroupingMapper.find( id );
+ if ( !command || !backrefs )
qWarning("Klipper: can't find associated action");
else
- execute( command );
+ execute( command, backrefs );
}
}
-void URLGrabber::execute( const struct ClipCommand *command ) const
+void URLGrabber::execute( const struct ClipCommand *command,
+ QStringList *backrefs) const
{
if ( command->isEnabled ) {
QMap<QChar,QString> map;
map.insert( 's', myClipData );
+ int brCounter = -1;
+ QStringList::Iterator it = backrefs->begin();
+ while( it != backrefs->end() ) {
+ map.insert( char(++brCounter + '0') , *it );
+ ++it;
+ }
QString cmdLine = KMacroExpander::expandMacrosShellQuote( command->command, map );
if ( cmdLine.isEmpty() )