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

List:       kde-commits
Subject:    branches/kdepim/enterprise/kdepim/libkdepim
From:       Allen Winter <winter () kde ! org>
Date:       2010-04-05 22:41:14
Message-ID: 20100405224114.811C6AC857 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1111533 by winterz:

fix the <tab> key work properly to move the address selection to the next \
addressbook. kolab/issue3882
MERGE: trunk,4.4


 M  +5 -5      addresseelineedit.cpp  


--- branches/kdepim/enterprise/kdepim/libkdepim/addresseelineedit.cpp \
#1111532:1111533 @@ -1118,11 +1118,11 @@
       QListBoxItem *item = completionBox()->item( currentIndex );
       if ( item && itemIsHeader(item) ) {
         completionBox()->setSelected( currentIndex, true );
-      }
-    } else if ( ke->key() == Key_Tab || ke->key() == Key_Backtab ) {
+       }
+   } else if ( e->type() == QEvent::KeyRelease && ke->key() == Key_Tab || ke->key() \
== Key_Backtab ) {  /// first, find the header of the current section
       QListBoxItem *myHeader = 0;
-      int i = currentIndex;
+      int i = QMAX( currentIndex - 1, 0 );
       while ( i>=0 ) {
         if ( itemIsHeader( completionBox()->item(i) ) ) {
           myHeader = completionBox()->item( i );
@@ -1140,14 +1140,14 @@
       uint j = ke->key() == Key_Tab ? currentIndex : i==0 ? \
                completionBox()->count()-1 : (i-1) % completionBox()->count();
       while ( ( nextHeader = completionBox()->item( j ) ) && nextHeader != myHeader \
) {  if ( itemIsHeader(nextHeader) ) {
-              break;
+            break;
           }
           j = (j + iterationstep) % completionBox()->count();
       }
       if ( nextHeader && nextHeader != myHeader ) {
         QListBoxItem *item = completionBox()->item( j + 1 );
         if ( item && !itemIsHeader(item) ) {
-          completionBox()->setSelected( j+1, true );
+          completionBox()->setSelected( item, true );
           completionBox()->setCurrentItem( item );
           completionBox()->ensureCurrentVisible();
         }


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

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