summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/contactlistview.cpp28
-rw-r--r--microkde/kdecore/klocale.cpp4
-rw-r--r--microkde/kdecore/klocale.h1
3 files changed, 32 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
@@ -170,3 +170,29 @@ 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();
}
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp
index 673d845..3674f28 100644
--- a/microkde/kdecore/klocale.cpp
+++ b/microkde/kdecore/klocale.cpp
@@ -166,2 +166,6 @@ void KLocale::setLanguage( int i )
}
+int KLocale::language( )
+{
+ return mLanguage;
+}
QString KLocale::translate( const char *index ) const
diff --git a/microkde/kdecore/klocale.h b/microkde/kdecore/klocale.h
index be9442c..14660d6 100644
--- a/microkde/kdecore/klocale.h
+++ b/microkde/kdecore/klocale.h
@@ -82,2 +82,3 @@ class KLocale
void setLanguage( int );
+ int language();
void setDateFormat( QString );