rev 6715 - in trunk/packages/kdebase/debian: . patches

Sune Vuorela pusling-guest at alioth.debian.org
Sat Jul 7 16:38:38 UTC 2007


Author: pusling-guest
Date: 2007-07-07 16:38:38 +0000 (Sat, 07 Jul 2007)
New Revision: 6715

Added:
   trunk/packages/kdebase/debian/patches/45_klipper_backreferences.diff
Modified:
   trunk/packages/kdebase/debian/changelog
Log:
add backreferences


Modified: trunk/packages/kdebase/debian/changelog
===================================================================
--- trunk/packages/kdebase/debian/changelog	2007-07-07 16:32:53 UTC (rev 6714)
+++ trunk/packages/kdebase/debian/changelog	2007-07-07 16:38:38 UTC (rev 6715)
@@ -1,11 +1,13 @@
 kdebase (4:3.5.7-2) unstable; urgency=low
- 
+
   +++ Changes by Sune Vuorela:
 
-  * Ignore gecko also in wm class list in klipper. Thanks Sean. 
+  * Ignore gecko also in wm class list in klipper. Thanks Sean.
     (Closes: #428026)
+  * Add support or back references in klipper. Thanks to Sean Finney. 
+    (Closes: #427843)
 
- -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Sat, 07 Jul 2007 18:31:40 +0200
+ -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Sat, 07 Jul 2007 18:38:35 +0200
 
 kdebase (4:3.5.7-1) unstable; urgency=low
 

Added: trunk/packages/kdebase/debian/patches/45_klipper_backreferences.diff
===================================================================
--- trunk/packages/kdebase/debian/patches/45_klipper_backreferences.diff	                        (rev 0)
+++ trunk/packages/kdebase/debian/patches/45_klipper_backreferences.diff	2007-07-07 16:38:38 UTC (rev 6715)
@@ -0,0 +1,111 @@
+diff -Nru kdebase-3.5.7/klipper/urlgrabber.cpp kdebase-3.5.7.sean/klipper/urlgrabber.cpp
+--- kdebase-3.5.7/klipper/urlgrabber.cpp	2005-10-10 17:03:59.000000000 +0200
++++ kdebase-3.5.7.sean/klipper/urlgrabber.cpp	2007-06-07 21:03:21.000000000 +0200
+@@ -51,7 +51,6 @@
+ {
+     if( m_config == NULL )
+         m_config = kapp->config();
+-    myCurrentAction = 0L;
+     myMenu = 0L;
+     myPopupKillTimeout = 8;
+     m_stripWhiteSpace = true;
+@@ -160,6 +159,7 @@
+ 
+         QString item;
+         myCommandMapper.clear();
++        myGroupingMapper.clear();
+ 
+         myPopupKillTimer->stop();
+         delete myMenu;
+@@ -184,6 +184,7 @@
+                 else
+                     id = myMenu->insertItem( SmallIcon(command->pixmap), item);
+                 myCommandMapper.insert( id, command );
++                myGroupingMapper.insert( id, action->capturedTexts() );
+             }
+         }
+ 
+@@ -224,19 +225,27 @@
+ 	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() )
+diff -Nru kdebase-3.5.7/klipper/urlgrabber.h kdebase-3.5.7.sean/klipper/urlgrabber.h
+--- kdebase-3.5.7/klipper/urlgrabber.h	2005-10-10 17:03:59.000000000 +0200
++++ kdebase-3.5.7.sean/klipper/urlgrabber.h	2007-06-07 20:58:48.000000000 +0200
+@@ -72,7 +72,8 @@
+     
+ private:
+   const ActionList& matchingActions( const QString& );
+-  void execute( const struct ClipCommand *command ) const;
++  void execute( const struct ClipCommand *command, 
++                QStringList *backrefs ) const;
+   void editData();
+   bool isAvoidedWindow() const;
+   void actionMenu( bool wm_class_check );
+@@ -83,6 +84,7 @@
+   QString myClipData;
+   ClipAction *myCurrentAction;
+   QIntDict<ClipCommand> myCommandMapper;
++  QIntDict<QStringList> myGroupingMapper;
+   KPopupMenu *myMenu;
+   QTimer *myPopupKillTimer;
+   int myPopupKillTimeout;
+@@ -127,8 +129,13 @@
+ 
+   void  setRegExp( const QString& r) 	      { myRegExp = QRegExp( r ); }
+   QString regExp() 			const { return myRegExp.pattern(); }
+-  inline bool matches( const QString& string ) const {
+-      return ( myRegExp.search( string ) != -1 );
++  inline bool matches( const QString& string ) {
++    int res = myRegExp.search( string ) ;
++    if ( res != -1 ) {
++      myCapturedTexts = myRegExp.capturedTexts();
++      return true;
++    } 
++    return false;
+   }
+ 
+   void 	setDescription( const QString& d)     { myDescription = d; }
+@@ -147,9 +154,15 @@
+    */
+   void save( KConfig * ) const;
+ 
++  /**
++   * Returns the most recent list of matched group backreferences.
++   * Note: you probably need to call matches() first.
++   */
++  inline const QStringList* capturedTexts() const { return &myCapturedTexts; }
+ 
+ private:
+   QRegExp 		myRegExp;
++  QStringList	myCapturedTexts;
+   QString 		myDescription;
+   QPtrList<ClipCommand> 	myCommands;
+ 




More information about the pkg-kde-commits mailing list