Diffstat (limited to 'libkdepim/kpimglobalprefs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 3771569..0fdc3e4 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp @@ -135,24 +135,25 @@ void KPimGlobalPrefs::setGlobalConfig() file.close(); text.replace( QRegExp("\\\\n"), "\n" ); QString line; QString we; QString wt; int br = 0; int nbr; nbr = text.find ( "},", br ); line = text.mid( br, nbr - br ); br = nbr+1; int se, ee, st, et; mLocaleDict = new QDict<QString>; + mLocaleDict->setAutoDelete( true ); QString end = "{ \"\",\"\" }"; while ( (line != end) && (br > 1) ) { //qDebug("%d *%s* ", br, line.latin1()); se = line.find("\"")+1; et = line.findRev("\"",-1); ee = line.find("\",\""); st = ee+3; we = line.mid( se, ee-se ); wt = line.mid( st, et-st ); //qDebug("*%s* *%s* ", we.latin1(), wt.latin1()); mLocaleDict->insert( we, new QString (wt) ); nbr = text.find ( "}", br ); @@ -179,26 +180,24 @@ void KPimGlobalPrefs::setGlobalConfig() KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, mDaylightsavingStart, mDaylightsavingEnd ); KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min ); } KPimGlobalPrefs::~KPimGlobalPrefs() { if (sInstance == this) sInstance = staticDeleterGP.setObject(0); else qDebug("Whats this? Error in KPimGlobalPrefs::~KPimGlobalPrefs() ?"); - //qDebug("KPimGlobalPrefs::~KPimGlobalPrefs() "); - writeConfig(); if ( mLocaleDict ) delete mLocaleDict; } KPimGlobalPrefs *KPimGlobalPrefs::instance() { if ( !sInstance ) { sInstance = staticDeleterGP.setObject( new KPimGlobalPrefs() ); sInstance->readConfig(); } return sInstance; |