From c45d38a1574bcb53e1b0fd0dc4987cb725d430c0 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 20 Oct 2004 11:04:17 +0000 Subject: fixed umlaute sort order --- (limited to 'kaddressbook') 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 @@ -168,7 +168,33 @@ ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, QString ContactListViewItem::key(int column, bool ascending) const { - return QListViewItem::key(column, ascending).lower(); + int lan = KGlobal::locale()->language(); + //qDebug("language %d ", lan); + if ( lan == 1 ) { //GERMAN + QString ret = QListViewItem::key(column, ascending).utf8(); + int start = -1; + while ( (start = ret.find( 'ä', start+1)) > 0 ) { + ret.at(start-1) = 'a'; + } + start = -1; + while ( (start = ret.find( 'ö', start+1)) > 0 ) { + ret.at(start-1) = 'o'; + } + start = -1; + while ( (start = ret.find( 'ü', start+1)) > 0 ) { + ret.at(start-1) = 'o'; + } + start = -1; + while ( (start = ret.find( 'ß', start+1)) > 0 ) { + ret.at(start-1) = 's'; + } + //qDebug("conv string %s ", ret.latin1()); + + return ret; + + } + else + return QListViewItem::key(column, ascending).lower(); } void ContactListViewItem::paintCell(QPainter * p, -- cgit v0.9.0.2