summaryrefslogtreecommitdiffabout
Unidiff
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
@@ -147,49 +147,75 @@ void DynamicTip::maybeTip( const QPoint &pos )
147 147
148 tip( r, s ); 148 tip( r, s );
149 } 149 }
150 else 150 else
151 hide(); 151 hide();
152 ishidden = !ishidden; 152 ishidden = !ishidden;
153 153
154} 154}
155 155
156/////////////////////////// 156///////////////////////////
157// ContactListViewItem Methods 157// ContactListViewItem Methods
158 158
159ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, 159ContactListViewItem::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
169QString ContactListViewItem::key(int column, bool ascending) const 169QString 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
174void ContactListViewItem::paintCell(QPainter * p, 200void 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 );
188 } 214 }
189} 215}
190 216
191 217
192ContactListView *ContactListViewItem::parent() 218ContactListView *ContactListViewItem::parent()
193{ 219{
194 return parentListView; 220 return parentListView;
195} 221}
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
@@ -143,48 +143,52 @@ void KLocale::setWeekStartMonday( bool b )
143 143
144KLocale::IntDateFormat KLocale::getIntDateFormat( ) 144KLocale::IntDateFormat KLocale::getIntDateFormat( )
145{ 145{
146 return mIntDateFormat; 146 return mIntDateFormat;
147 147
148} 148}
149void KLocale::setIntDateFormat( KLocale::IntDateFormat i ) 149void KLocale::setIntDateFormat( KLocale::IntDateFormat i )
150{ 150{
151 mIntDateFormat = i; 151 mIntDateFormat = i;
152} 152}
153KLocale::IntDateFormat KLocale::getIntTimeFormat( ) 153KLocale::IntDateFormat KLocale::getIntTimeFormat( )
154{ 154{
155 return mIntTimeFormat; 155 return mIntTimeFormat;
156 156
157} 157}
158void KLocale::setIntTimeFormat( KLocale::IntDateFormat i ) 158void KLocale::setIntTimeFormat( KLocale::IntDateFormat i )
159{ 159{
160 mIntTimeFormat = i; 160 mIntTimeFormat = i;
161} 161}
162 162
163void KLocale::setLanguage( int i ) 163void KLocale::setLanguage( int i )
164{ 164{
165 mLanguage = i; 165 mLanguage = i;
166} 166}
167int KLocale::language( )
168{
169 return mLanguage;
170}
167QString KLocale::translate( const char *index ) const 171QString KLocale::translate( const char *index ) const
168{ 172{
169 return i18n( index ); 173 return i18n( index );
170} 174}
171 175
172QString KLocale::translate( const char *, const char *fallback) const 176QString KLocale::translate( const char *, const char *fallback) const
173{ 177{
174 return i18n( fallback ); 178 return i18n( fallback );
175} 179}
176 180
177QString KLocale::formatTime(const QTime &pTime, bool includeSecs, IntDateFormat intIntDateFormat) const 181QString KLocale::formatTime(const QTime &pTime, bool includeSecs, IntDateFormat intIntDateFormat) const
178{ 182{
179 const QString rst = timeFormat(intIntDateFormat); 183 const QString rst = timeFormat(intIntDateFormat);
180 184
181 // only "pm/am" here can grow, the rest shrinks, but 185 // only "pm/am" here can grow, the rest shrinks, but
182 // I'm rather safe than sorry 186 // I'm rather safe than sorry
183 QChar *buffer = new QChar[rst.length() * 3 / 2 + 30]; 187 QChar *buffer = new QChar[rst.length() * 3 / 2 + 30];
184 188
185 uint index = 0; 189 uint index = 0;
186 bool escape = false; 190 bool escape = false;
187 int number = 0; 191 int number = 0;
188 192
189 for ( uint format_index = 0; format_index < rst.length(); format_index++ ) 193 for ( uint format_index = 0; format_index < rst.length(); format_index++ )
190 { 194 {
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
@@ -59,48 +59,49 @@ class KLocale
59 59
60 bool use12Clock() const; 60 bool use12Clock() const;
61 bool weekStartsMonday() const; 61 bool weekStartsMonday() const;
62 int weekStartDay() const; 62 int weekStartDay() const;
63 63
64 QString weekDayName(int,bool=false) const; 64 QString weekDayName(int,bool=false) const;
65 QString monthName(int,bool=false) const; 65 QString monthName(int,bool=false) const;
66 66
67 QString country() const; 67 QString country() const;
68 68
69 QString dateFormat(IntDateFormat intIntDateFormat = Undefined) const; 69 QString dateFormat(IntDateFormat intIntDateFormat = Undefined) const;
70 QString dateFormatShort(IntDateFormat intIntDateFormat = Undefined) const; 70 QString dateFormatShort(IntDateFormat intIntDateFormat = Undefined) const;
71 QString timeFormat(IntDateFormat intIntDateFormat = Undefined) const; 71 QString timeFormat(IntDateFormat intIntDateFormat = Undefined) const;
72 72
73 void insertCatalogue ( const QString & ); 73 void insertCatalogue ( const QString & );
74 74
75 KCalendarSystem *calendar(); 75 KCalendarSystem *calendar();
76 void setHore24Format ( bool ); 76 void setHore24Format ( bool );
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;
89 QString m_monetaryDecimalSymbol; 90 QString m_monetaryDecimalSymbol;
90 QString m_monetaryThousandsSeparator; 91 QString m_monetaryThousandsSeparator;
91 QString m_positiveSign; 92 QString m_positiveSign;
92 QString m_negativeSign; 93 QString m_negativeSign;
93 94
94 int timezoneOffset( QString ); 95 int timezoneOffset( QString );
95 QStringList timeZoneList() const; 96 QStringList timeZoneList() const;
96 void setDaylightSaving( bool, int , int ); 97 void setDaylightSaving( bool, int , int );
97 int localTimeOffset(const QDateTime &); 98 int localTimeOffset(const QDateTime &);
98 void setTimezone( const QString &timeZone , bool oddTZ); 99 void setTimezone( const QString &timeZone , bool oddTZ);
99 private: 100 private:
100 QTime readTime(const QString &str, bool seconds, bool *ok) const; 101 QTime readTime(const QString &str, bool seconds, bool *ok) const;
101 QDate readDate(const QString &str, bool shortFormat, bool *ok) const; 102 QDate readDate(const QString &str, bool shortFormat, bool *ok) const;
102 KCalendarSystem *mCalendarSystem; 103 KCalendarSystem *mCalendarSystem;
103 bool mWeekStartsMonday; 104 bool mWeekStartsMonday;
104 bool mHourF24Format; 105 bool mHourF24Format;
105 IntDateFormat mIntDateFormat; 106 IntDateFormat mIntDateFormat;
106 IntDateFormat mIntTimeFormat; 107 IntDateFormat mIntTimeFormat;