summaryrefslogtreecommitdiffabout
path: root/libkdepim/kpimglobalprefs.cpp
authorzautrix <zautrix>2005-01-30 21:39:03 (UTC)
committer zautrix <zautrix>2005-01-30 21:39:03 (UTC)
commit6dbf4f4a6666e7a94c68517df1659eb14cd104b9 (patch) (unidiff)
treeb98e130d6d0d6205655cf1a6e28074c0c38011d1 /libkdepim/kpimglobalprefs.cpp
parent15c5772f8a54750115f82aea34fea47e5842ff4f (diff)
downloadkdepimpi-6dbf4f4a6666e7a94c68517df1659eb14cd104b9.zip
kdepimpi-6dbf4f4a6666e7a94c68517df1659eb14cd104b9.tar.gz
kdepimpi-6dbf4f4a6666e7a94c68517df1659eb14cd104b9.tar.bz2
fixes
Diffstat (limited to 'libkdepim/kpimglobalprefs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kpimglobalprefs.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index e8fd2d1..81e3cb1 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -133,49 +133,52 @@ void KPimGlobalPrefs::setGlobalConfig()
133 ts.setEncoding( QTextStream::Latin1 ); 133 ts.setEncoding( QTextStream::Latin1 );
134 //ts.setCodec( QTextCodec::latin1 ); 134 //ts.setCodec( QTextCodec::latin1 );
135 QString text = ts.read(); 135 QString text = ts.read();
136 file.close(); 136 file.close();
137 text.replace( QRegExp("\\\\n"), "\n" ); 137 text.replace( QRegExp("\\\\n"), "\n" );
138 QString line; 138 QString line;
139 QString we; 139 QString we;
140 QString wt; 140 QString wt;
141 int br = 0; 141 int br = 0;
142 int nbr; 142 int nbr;
143 nbr = text.find ( "},", br ); 143 nbr = text.find ( "},", br );
144 line = text.mid( br, nbr - br ); 144 line = text.mid( br, nbr - br );
145 br = nbr+1; 145 br = nbr+1;
146 int se, ee, st, et; 146 int se, ee, st, et;
147 mLocaleDict = new QDict<QString>; 147 mLocaleDict = new QDict<QString>;
148 mLocaleDict->setAutoDelete( true ); 148 mLocaleDict->setAutoDelete( true );
149 QString end = "{ \"\",\"\" }"; 149 QString end = "{ \"\",\"\" }";
150 while ( (line != end) && (br > 1) ) { 150 while ( (line != end) && (br > 1) ) {
151 //qDebug("%d *%s* ", br, line.latin1()); 151 //qDebug("%d *%s* ", br, line.latin1());
152 se = line.find("\"")+1; 152 se = line.find("\"")+1;
153 et = line.findRev("\"",-1); 153 et = line.findRev("\"",-1);
154 ee = line.find("\",\""); 154 ee = line.find("\",\"");
155 st = ee+3; 155 st = ee+3;
156 we = line.mid( se, ee-se ); 156 we = line.mid( se, ee-se );
157 wt = line.mid( st, et-st ); 157 if ( mPreferredLanguage == 4 )
158 wt = QString::fromUtf8(line.mid( st, et-st ).latin1());
159 else
160 wt = line.mid( st, et-st );
158 //qDebug("*%s* *%s* ", we.latin1(), wt.latin1()); 161 //qDebug("*%s* *%s* ", we.latin1(), wt.latin1());
159 mLocaleDict->insert( we, new QString (wt) ); 162 mLocaleDict->insert( we, new QString (wt) );
160 nbr = text.find ( "}", br ); 163 nbr = text.find ( "}", br );
161 line = text.mid( br, nbr - br ); 164 line = text.mid( br, nbr - br );
162 br = nbr+1; 165 br = nbr+1;
163 } 166 }
164 //qDebug("end *%s* ", end.latin1()); 167 //qDebug("end *%s* ", end.latin1());
165 168
166 setLocaleDict( mLocaleDict ); 169 setLocaleDict( mLocaleDict );
167 } else { 170 } else {
168 qDebug("KO: Cannot find translation file %s",fileName.latin1() ); 171 qDebug("KO: Cannot find translation file %s",fileName.latin1() );
169 } 172 }
170 } 173 }
171 } 174 }
172 175
173 KGlobal::locale()->setHore24Format( !mPreferredTime ); 176 KGlobal::locale()->setHore24Format( !mPreferredTime );
174 KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); 177 KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday );
175 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); 178 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate );
176 KGlobal::locale()->setLanguage( mPreferredLanguage ); 179 KGlobal::locale()->setLanguage( mPreferredLanguage );
177 QString dummy = mUserDateFormatLong; 180 QString dummy = mUserDateFormatLong;
178 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); 181 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
179 dummy = mUserDateFormatShort; 182 dummy = mUserDateFormatShort;
180 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); 183 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
181 KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, 184 KGlobal::locale()->setDaylightSaving( mUseDaylightsaving,