summaryrefslogtreecommitdiffabout
path: root/korganizer/koprefs.cpp
Unidiff
Diffstat (limited to 'korganizer/koprefs.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koprefs.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 0db8e6d..dd978bf 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -390,12 +390,13 @@ QStringList KOPrefs::getDefaultList()
390 390
391void KOPrefs::usrReadConfig() 391void KOPrefs::usrReadConfig()
392{ 392{
393 mLocaleDict = 0; 393 mLocaleDict = 0;
394 // pending LR fix translation 394 // pending LR fix translation
395 // qDebug("KOPrefs::usrReadConfig() fix translation "); 395 // qDebug("KOPrefs::usrReadConfig() fix translation ");
396 if ( mPreferredLanguage > 0 && mPreferredLanguage < 4 ) {
396 if ( mPreferredLanguage == 1 ) { 397 if ( mPreferredLanguage == 1 ) {
397 mLocaleDict = new QDict<QString>; 398 mLocaleDict = new QDict<QString>;
398 int i = 0; 399 int i = 0;
399 QString fw ( germanwords[i] [0]); 400 QString fw ( germanwords[i] [0]);
400 while ( !fw.isEmpty() ) { 401 while ( !fw.isEmpty() ) {
401 mLocaleDict->insert( fw, new QString (germanwords[i] [1] )); 402 mLocaleDict->insert( fw, new QString (germanwords[i] [1] ));
@@ -407,17 +408,17 @@ void KOPrefs::usrReadConfig()
407 } else { 408 } else {
408 QString fileName ; 409 QString fileName ;
409 if ( mPreferredLanguage == 3 ) 410 if ( mPreferredLanguage == 3 )
410 fileName = MainWindow::resourcePath()+"usertranslation.txt"; 411 fileName = MainWindow::resourcePath()+"usertranslation.txt";
411 else if ( mPreferredLanguage == 2 ) 412 else if ( mPreferredLanguage == 2 )
412 fileName = MainWindow::resourcePath()+"frenchtranslation.txt"; 413 fileName = MainWindow::resourcePath()+"frenchtranslation.txt";
413 else return;
414 QFile file( fileName ); 414 QFile file( fileName );
415 if (file.open( IO_ReadOnly ) ) { 415 if (file.open( IO_ReadOnly ) ) {
416 QTextStream ts( &file ); 416 QTextStream ts( &file );
417 ts.setCodec( QTextCodec::codecForLocale() ); 417 ts.setEncoding( QTextStream::Latin1 );
418 //ts.setCodec( QTextCodec::latin1 );
418 QString text = ts.read(); 419 QString text = ts.read();
419 file.close(); 420 file.close();
420 text.replace( QRegExp("\\\\n"), "\n" ); 421 text.replace( QRegExp("\\\\n"), "\n" );
421 QString line; 422 QString line;
422 QString we; 423 QString we;
423 QString wt; 424 QString wt;
@@ -448,23 +449,24 @@ void KOPrefs::usrReadConfig()
448 setLocaleDict( mLocaleDict ); 449 setLocaleDict( mLocaleDict );
449 } else { 450 } else {
450 qDebug("KO: Cannot find translation file %s",fileName.latin1() ); 451 qDebug("KO: Cannot find translation file %s",fileName.latin1() );
451 } 452 }
452 453
453} 454}
455 }
454 config()->setGroup("General"); 456 config()->setGroup("General");
455 457
456 mCustomCategories = config()->readListEntry("Custom Categories"); 458 mCustomCategories = config()->readListEntry("Custom Categories");
457 if ( KOPrefs::instance()->mLanguageChanged ) { 459 if ( KOPrefs::instance()->mLanguageChanged ) {
458 mLocationDefaults.clear(); 460 mLocationDefaults.clear();
459 mEventSummaryUser.clear(); 461 mEventSummaryUser.clear();
460 mTodoSummaryUser.clear(); 462 mTodoSummaryUser.clear();
461 } 463 }
462 if (mLocationDefaults.isEmpty()) { 464 if (mLocationDefaults.isEmpty()) {
463 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Libary") << i18n("School") << i18n("Doctor") << i18n("Beach") 465 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
464 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarden") 466 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
465 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 467 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
466 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 468 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
467 mLocationDefaults.sort(); 469 mLocationDefaults.sort();
468 } 470 }
469 471
470 if (mEventSummaryUser.isEmpty()) { 472 if (mEventSummaryUser.isEmpty()) {