[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/kmail
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2010-11-25 23:10:13
Message-ID: 20101125231013.1F615AC8A4 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1200842 by tokoe:

Do not blind send a key press event but make proper copy calls.

This fixes a stack overflow in case a widget has the focus that
doesn't accept the key event. In this case the event has been forwarded
to the shortcut map -> copy action -> slotCopy -> ...


 M  +6 -2      kmcomposewin.cpp  


--- trunk/KDE/kdepim/kmail/kmcomposewin.cpp #1200841:1200842
@@ -2135,9 +2135,13 @@
   if ( !fw ) {
     return;
   }
-  QKeyEvent k( QEvent::KeyPress, Qt::Key_C, Qt::ControlModifier );
-  qApp->notify( fw, &k );
+
+  if ( ::qobject_cast<KMComposerEditor*>( fw ) ) {
+    static_cast<KTextEdit*>(fw)->copy();
+  } else if ( ::qobject_cast<KLineEdit*>( fw ) ) {
+    static_cast<KLineEdit*>( fw )->copy();
 }
+}
 
 //-----------------------------------------------------------------------------
 void KMComposeWin::slotPaste()
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic