-rw-r--r-- | kaddressbook/views/contactlistview.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp index 4cc22ea..c74f8cf 100644 --- a/kaddressbook/views/contactlistview.cpp +++ b/kaddressbook/views/contactlistview.cpp | |||
@@ -155,33 +155,59 @@ void DynamicTip::maybeTip( const QPoint &pos ) | |||
155 | 155 | ||
156 | /////////////////////////// | 156 | /////////////////////////// |
157 | // ContactListViewItem Methods | 157 | // ContactListViewItem Methods |
158 | 158 | ||
159 | ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, | 159 | ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, |
160 | ContactListView *parent, | 160 | ContactListView *parent, |
161 | KABC::AddressBook *doc, | 161 | KABC::AddressBook *doc, |
162 | const KABC::Field::List &fields ) | 162 | const KABC::Field::List &fields ) |
163 | : KListViewItem(parent), mAddressee(a), mFields( fields ), | 163 | : KListViewItem(parent), mAddressee(a), mFields( fields ), |
164 | parentListView( parent ), mDocument(doc) | 164 | parentListView( parent ), mDocument(doc) |
165 | { | 165 | { |
166 | refresh(); | 166 | refresh(); |
167 | } | 167 | } |
168 | 168 | ||
169 | QString ContactListViewItem::key(int column, bool ascending) const | 169 | QString ContactListViewItem::key(int column, bool ascending) const |
170 | { | 170 | { |
171 | return QListViewItem::key(column, ascending).lower(); | 171 | int lan = KGlobal::locale()->language(); |
172 | //qDebug("language %d ", lan); | ||
173 | if ( lan == 1 ) { //GERMAN | ||
174 | QString ret = QListViewItem::key(column, ascending).utf8(); | ||
175 | int start = -1; | ||
176 | while ( (start = ret.find( 'ä', start+1)) > 0 ) { | ||
177 | ret.at(start-1) = 'a'; | ||
178 | } | ||
179 | start = -1; | ||
180 | while ( (start = ret.find( 'ö', start+1)) > 0 ) { | ||
181 | ret.at(start-1) = 'o'; | ||
182 | } | ||
183 | start = -1; | ||
184 | while ( (start = ret.find( 'ü', start+1)) > 0 ) { | ||
185 | ret.at(start-1) = 'o'; | ||
186 | } | ||
187 | start = -1; | ||
188 | while ( (start = ret.find( 'ß', start+1)) > 0 ) { | ||
189 | ret.at(start-1) = 's'; | ||
190 | } | ||
191 | //qDebug("conv string %s ", ret.latin1()); | ||
192 | |||
193 | return ret; | ||
194 | |||
195 | } | ||
196 | else | ||
197 | return QListViewItem::key(column, ascending).lower(); | ||
172 | } | 198 | } |
173 | 199 | ||
174 | void ContactListViewItem::paintCell(QPainter * p, | 200 | void ContactListViewItem::paintCell(QPainter * p, |
175 | const QColorGroup & cg, | 201 | const QColorGroup & cg, |
176 | int column, | 202 | int column, |
177 | int width, | 203 | int width, |
178 | int align) | 204 | int align) |
179 | { | 205 | { |
180 | KListViewItem::paintCell(p, cg, column, width, align); | 206 | KListViewItem::paintCell(p, cg, column, width, align); |
181 | 207 | ||
182 | if ( !p ) | 208 | if ( !p ) |
183 | return; | 209 | return; |
184 | 210 | ||
185 | if (parentListView->singleLine()) { | 211 | if (parentListView->singleLine()) { |
186 | p->setPen( parentListView->alternateColor() ); | 212 | p->setPen( parentListView->alternateColor() ); |
187 | p->drawLine( 0, height() - 1, width, height() - 1 ); | 213 | p->drawLine( 0, height() - 1, width, height() - 1 ); |