-rw-r--r-- | kaddressbook/jumpbuttonbar.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kaddressbook/jumpbuttonbar.cpp b/kaddressbook/jumpbuttonbar.cpp index 184d516..b12d9e7 100644 --- a/kaddressbook/jumpbuttonbar.cpp +++ b/kaddressbook/jumpbuttonbar.cpp | |||
@@ -99,8 +99,11 @@ void JumpButtonBar::letterClicked() | |||
99 | { | 99 | { |
100 | JumpButton *button = (JumpButton*)sender(); | 100 | JumpButton *button = (JumpButton*)sender(); |
101 | QString character = button->character(); | 101 | QString character = button->character(); |
102 | if ( character.length() == 2 ) | ||
103 | character = character.left(1) +"-"+character.right(1); | ||
102 | if ( !character.isNull() ) | 104 | if ( !character.isNull() ) |
103 | emit jumpToLetter( character ); | 105 | emit jumpToLetter( character ); |
106 | //qDebug("emit *%s* ",character.latin1()); | ||
104 | } | 107 | } |
105 | 108 | ||
106 | void JumpButtonBar::recreateButtons() | 109 | void JumpButtonBar::recreateButtons() |
@@ -122,6 +125,7 @@ void JumpButtonBar::recreateButtons() | |||
122 | setEnabled( false ); | 125 | setEnabled( false ); |
123 | return; | 126 | return; |
124 | } | 127 | } |
128 | mCharacters.append( "*"); | ||
125 | for ( it = ab->begin(); it != ab->end(); ++it ) { | 129 | for ( it = ab->begin(); it != ab->end(); ++it ) { |
126 | if ( !field->value( *it ).isEmpty() ) | 130 | if ( !field->value( *it ).isEmpty() ) |
127 | character = field->value( *it )[ 0 ].lower(); | 131 | character = field->value( *it )[ 0 ].lower(); |
@@ -158,12 +162,15 @@ void JumpButtonBar::recreateButtons() | |||
158 | bool state = isUpdatesEnabled(); | 162 | bool state = isUpdatesEnabled(); |
159 | setUpdatesEnabled( false ); | 163 | setUpdatesEnabled( false ); |
160 | //qDebug("cc %d ",mCharacters.count() ); | 164 | //qDebug("cc %d ",mCharacters.count() ); |
161 | JumpButton *button; | 165 | JumpButton *button = 0; |
162 | int row = 0, col = 0; | 166 | int row = 0, col = 0; |
163 | JumpButton* cur = mButtons.first(); | 167 | JumpButton* cur = mButtons.first(); |
164 | for ( uint i = 0; i < mCharacters.count(); ++i ) { | 168 | for ( uint i = 0; i < mCharacters.count(); ++i ) { |
165 | if ( skipcount > 0 && skipcurrent ) { | 169 | if ( skipcount > 0 && skipcurrent ) { |
166 | --skipcount; | 170 | --skipcount; |
171 | if ( button ) { | ||
172 | button->setCharacter( button->character() + mCharacters[ i ]); | ||
173 | } | ||
167 | } else { | 174 | } else { |
168 | if ( cur ) { | 175 | if ( cur ) { |
169 | button = cur ; | 176 | button = cur ; |
@@ -185,7 +192,7 @@ void JumpButtonBar::recreateButtons() | |||
185 | } else | 192 | } else |
186 | row++; | 193 | row++; |
187 | } | 194 | } |
188 | 195 | if ( i > 0 ) | |
189 | skipcurrent = !skipcurrent; | 196 | skipcurrent = !skipcurrent; |
190 | } | 197 | } |
191 | while ( cur ) { | 198 | while ( cur ) { |