author | zautrix <zautrix> | 2004-10-20 11:04:17 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-20 11:04:17 (UTC) |
commit | c45d38a1574bcb53e1b0fd0dc4987cb725d430c0 (patch) (unidiff) | |
tree | 22f1ee07fc4002c49867d5dd36690e54cfe21276 | |
parent | f6f5f5cfcaa38f3e2bf36d8466b2b44ba7b3fb28 (diff) | |
download | kdepimpi-c45d38a1574bcb53e1b0fd0dc4987cb725d430c0.zip kdepimpi-c45d38a1574bcb53e1b0fd0dc4987cb725d430c0.tar.gz kdepimpi-c45d38a1574bcb53e1b0fd0dc4987cb725d430c0.tar.bz2 |
fixed umlaute sort order
-rw-r--r-- | kaddressbook/views/contactlistview.cpp | 28 | ||||
-rw-r--r-- | microkde/kdecore/klocale.cpp | 4 | ||||
-rw-r--r-- | microkde/kdecore/klocale.h | 1 |
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 | |||
@@ -165,13 +165,39 @@ ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, | |||
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, |
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 | |||
@@ -161,12 +161,16 @@ void KLocale::setIntTimeFormat( KLocale::IntDateFormat i ) | |||
161 | } | 161 | } |
162 | 162 | ||
163 | void KLocale::setLanguage( int i ) | 163 | void KLocale::setLanguage( int i ) |
164 | { | 164 | { |
165 | mLanguage = i; | 165 | mLanguage = i; |
166 | } | 166 | } |
167 | int KLocale::language( ) | ||
168 | { | ||
169 | return mLanguage; | ||
170 | } | ||
167 | QString KLocale::translate( const char *index ) const | 171 | QString KLocale::translate( const char *index ) const |
168 | { | 172 | { |
169 | return i18n( index ); | 173 | return i18n( index ); |
170 | } | 174 | } |
171 | 175 | ||
172 | QString KLocale::translate( const char *, const char *fallback) const | 176 | QString KLocale::translate( const char *, const char *fallback) 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 | |||
@@ -77,12 +77,13 @@ class KLocale | |||
77 | void setWeekStartMonday( bool ); | 77 | void setWeekStartMonday( bool ); |
78 | void setIntDateFormat( IntDateFormat ); | 78 | void setIntDateFormat( IntDateFormat ); |
79 | void setIntTimeFormat( IntDateFormat ); | 79 | void setIntTimeFormat( IntDateFormat ); |
80 | IntDateFormat getIntDateFormat( ); | 80 | IntDateFormat getIntDateFormat( ); |
81 | IntDateFormat getIntTimeFormat( ); | 81 | IntDateFormat getIntTimeFormat( ); |
82 | void setLanguage( int ); | 82 | void setLanguage( int ); |
83 | int language(); | ||
83 | void setDateFormat( QString ); | 84 | void setDateFormat( QString ); |
84 | void setDateFormatShort( QString ); | 85 | void setDateFormatShort( QString ); |
85 | 86 | ||
86 | QString m_decimalSymbol; | 87 | QString m_decimalSymbol; |
87 | QString m_thousandsSeparator; | 88 | QString m_thousandsSeparator; |
88 | QString m_currencySymbol; | 89 | QString m_currencySymbol; |