kmeditor patch

"alessandro diaferia" <[email protected]> Thu, 24 Apr 2008 13:31:51 +0200
Newsgroups gmane.comp.kde.devel.kmail
Message-ID <[email protected]>
Hi mailinglist, hi Thomas,
I wrote some code editing kmeditor.cpp. Now kmeditor selects the word
under mouse cursor and not under text cursor, every time you right
click the text. Can you please have a look and tell me know what you
think?
Many Thanks, Alex.

_______________________________________________
KMail developers mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kmail-devel
kmeditor_patch.diff (application/octet-stream, 859 B)
--- /usr/portage/distfiles/svn-src/KDE/kdepim/kdepim/libkdepim/kmeditor.cpp	2008-04-16 09:35:37.000000000 +0200
+++ kmeditor.cpp	2008-04-24 13:26:21.000000000 +0200
@@ -640,16 +640,9 @@ void KMeditor::disableWordWrap()
 
 void KMeditor::contextMenuEvent( QContextMenuEvent *event )
 {
-  QTextCursor cursor = textCursor();
-  if ( cursor.hasSelection() )
-  {
-    //if we have selection so use standard menu
-    KTextEdit::contextMenuEvent( event );
-    return;
-  }
-  else
-  {
-    //select word under current cursor
+
+   QTextCursor cursor = cursorForPosition(event -> pos());
+
     cursor.select( QTextCursor::WordUnderCursor );
     setTextCursor( cursor );
     QString word = textCursor().selectedText();
@@ -691,7 +684,6 @@ void KMeditor::contextMenuEvent( QContex
       }
       return;
     }
-  }
 }
 
 void KMeditor::slotPasteAsQuotation()