-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | kaddressbook/kabprefs.cpp | 73 | ||||
-rw-r--r-- | kaddressbook/kabprefs.h | 1 | ||||
-rw-r--r-- | kmicromail/koprefs.h | 2 | ||||
-rw-r--r-- | korganizer/kodialogmanager.cpp | 5 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 88 | ||||
-rw-r--r-- | korganizer/koprefs.h | 16 | ||||
-rw-r--r-- | korganizer/ktimeedit.cpp | 5 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 3 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 76 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.h | 2 | ||||
-rw-r--r-- | microkde/kstaticdeleter.h | 5 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmprefs.cpp | 12 |
13 files changed, 105 insertions, 185 deletions
@@ -1,7 +1,7 @@ ############################################################################# # Makefile for building: kdepim-desktop -# Generated by qmake (1.07a) (Qt 3.3.3) on: Sat Oct 23 09:29:11 2004 +# Generated by qmake (1.07a) (Qt 3.3.3) on: Sat Oct 23 12:23:49 2004 # Project: kdepim-desktop.pro # Template: subdirs # Command: $(QMAKE) "CONFIG+=thread" "CONFIG+=debug" -o Makefile kdepim-desktop.pro ############################################################################# diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index 01c935f..3cbcc9a 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp @@ -42,15 +42,13 @@ #include <qapplication.h> #endif KABPrefs *KABPrefs::sInstance = 0; -static KStaticDeleter<KABPrefs> staticDeleter; +static KStaticDeleter<KABPrefs> staticDeleterAB; KABPrefs::KABPrefs() : KPimPrefs("kaddressbookrc") { - - mLocaleDict = 0; mDetailsFont = QFont("helvetica",12); KPrefs::setCurrentGroup( "Views" ); addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); @@ -95,21 +93,20 @@ KABPrefs::KABPrefs() KABPrefs::~KABPrefs() { //qDebug("KABPrefs::~KABPrefs() "); - setLocaleDict( 0 ); - if ( mLocaleDict ) - delete mLocaleDict; + if (sInstance == this) + sInstance = staticDeleterAB.setObject(0); } KABPrefs *KABPrefs::instance() { if ( !sInstance ) { #ifdef KAB_EMBEDDED - sInstance = staticDeleter.setObject( new KABPrefs() ); + sInstance = staticDeleterAB.setObject( new KABPrefs() ); #else //KAB_EMBEDDED //US the following line has changed ???. Why - staticDeleter.setObject( sInstance, new KABPrefs() ); + staticDeleterAB.setObject( sInstance, new KABPrefs() ); #endif //KAB_EMBEDDED sInstance->readConfig(); } @@ -130,68 +127,8 @@ KConfig* KABPrefs::getConfig() return config(); } void KABPrefs::usrReadConfig() { - QString fileName ; -#ifndef DESKTOP_VERSION - fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/"; -#else - fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/"; -#endif - int mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; - mLocaleDict = 0; - if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { - - if ( mPreferredLanguage == 1 ) - fileName = fileName+"germantranslation.txt"; - else if ( mPreferredLanguage == 4 ) - fileName = fileName+"usertranslation.txt"; - else if ( mPreferredLanguage == 2 ) - fileName = fileName+"frenchtranslation.txt"; - else if ( mPreferredLanguage == 3 ) - fileName = fileName+"italiantranslation.txt"; - QFile file( fileName ); - if (file.open( IO_ReadOnly ) ) { - QTextStream ts( &file ); - ts.setEncoding( QTextStream::Latin1 ); - //ts.setCodec( QTextCodec::latin1 ); - QString text = ts.read(); - 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>; - 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 ); - line = text.mid( br, nbr - br ); - br = nbr+1; - } - //qDebug("end *%s* ", end.latin1()); - - setLocaleDict( mLocaleDict ); - } else { - qDebug("KO: Cannot find translation file %s",fileName.latin1() ); - } - - - } KPimPrefs::usrReadConfig(); } diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h index 1098f4c..cc8413e 100644 --- a/kaddressbook/kabprefs.h +++ b/kaddressbook/kabprefs.h @@ -88,9 +88,8 @@ class KABPrefs : public KPimPrefs private: KABPrefs(); - QDict<QString> *mLocaleDict; static KABPrefs *sInstance; }; #endif diff --git a/kmicromail/koprefs.h b/kmicromail/koprefs.h index a47642b..f0a4463 100644 --- a/kmicromail/koprefs.h +++ b/kmicromail/koprefs.h @@ -22,9 +22,8 @@ */ #ifndef KOPREFS_H #define KOPREFS_H -#include <qdict.h> #include <libkdepim/kpimprefs.h> class KConfig; @@ -61,9 +60,8 @@ class KOPrefs : public KPimPrefs object. */ KOPrefs(); static KOPrefs *mInstance; - QDict<QString> *mLocaleDict; public: // preferences data KConfig* getConfig(); QFont mAppFont; diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index 58198a2..db7c3f2 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp @@ -88,9 +88,9 @@ void KODialogManager::createOutgoingDialog() } void KODialogManager::showOptionsDialog( bool showSync ) { - int curLanguage = KOPrefs::instance()->mPreferredLanguage; + if (!mOptionsDialog) { mOptionsDialog = new KOPrefsDialog(mMainView); //mOptionsDialog->readConfig(); connect(mOptionsDialog,SIGNAL(configChanged()), @@ -107,10 +107,9 @@ void KODialogManager::showOptionsDialog( bool showSync ) #endif if ( showSync ) mOptionsDialog->showSyncPage(); mOptionsDialog->exec(); - if ( curLanguage != KOPrefs::instance()->mPreferredLanguage ) - KOPrefs::instance()->mLanguageChanged = true; + } void KODialogManager::showSyncOptions() { showOptionsDialog( true ); diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index ba1c6d1..f44debc 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -45,21 +45,15 @@ #include "koprefs.h" #include "mainwindow.h" -const char *germanwords[][2] = { -#include "wordsgerman.h" - "", "" -}; - KOPrefs *KOPrefs::mInstance = 0; static KStaticDeleter<KOPrefs> insd; KOPrefs::KOPrefs() : KPimPrefs("korganizerrc") { mCategoryColors.setAutoDelete(true); - mLocaleDict = 0; fillMailDefaults(); mDefaultCategoryColor = QColor(175,210,255);//196,196,196); QColor defaultHolidayColor = QColor(255,0,0); QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); @@ -99,9 +93,9 @@ KOPrefs::KOPrefs() : addItemBool("ShowIconNextDays",&mShowIconNextDays,true); addItemBool("ShowIconNext",&mShowIconNext,true); addItemBool("ShowIconJournal",&mShowIconJournal,true); addItemBool("ShowIconStretch",&mShowIconStretch,true); - addItemBool("LanguageChanged",&mLanguageChanged,false); + addItemInt("LastLoadedLanguage",&mOldLanguage,0); addItemBool("AskForQuit",&mAskForQuit,false); #ifndef DESKTOP_VERSION @@ -203,15 +197,9 @@ KOPrefs::KOPrefs() : addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); KPrefs::setCurrentGroup("Locale"); - addItemInt("PreferredLanguage",&mPreferredLanguage,0); - addItemInt("PreferredTime",&mPreferredTime,0); - addItemInt("PreferredDate",&mPreferredDate,0); - addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); addItemBool("ShortDateInViewer",&mShortDateInViewer,false); - addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); - addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); KPrefs::setCurrentGroup("Colors"); addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); @@ -315,11 +303,9 @@ KOPrefs::KOPrefs() : KOPrefs::~KOPrefs() { if (mInstance == this) mInstance = insd.setObject(0); - setLocaleDict( 0 ); - if ( mLocaleDict ) - delete mLocaleDict; + //qDebug("KOPrefs::~KOPrefs() "); } @@ -376,82 +362,18 @@ QStringList KOPrefs::getDefaultList() } void KOPrefs::usrReadConfig() { - mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; - mLocaleDict = 0; - // pending LR fix translation - // qDebug("KOPrefs::usrReadConfig() fix translation "); - if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { - if ( mPreferredLanguage == 1 ) { - mLocaleDict = new QDict<QString>; - int i = 0; - QString fw ( germanwords[i] [0]); - while ( !fw.isEmpty() ) { - mLocaleDict->insert( fw, new QString (germanwords[i] [1] )); - ++i; - fw = germanwords[i] [0]; - } - - setLocaleDict( mLocaleDict ); - } else { - QString fileName ; - if ( mPreferredLanguage == 4 ) - fileName = MainWindow::resourcePath()+"usertranslation.txt"; - else if ( mPreferredLanguage == 2 ) - fileName = MainWindow::resourcePath()+"frenchtranslation.txt"; - else if ( mPreferredLanguage == 3 ) - fileName = MainWindow::resourcePath()+"italiantranslation.txt"; - QFile file( fileName ); - if (file.open( IO_ReadOnly ) ) { - QTextStream ts( &file ); - ts.setEncoding( QTextStream::Latin1 ); - //ts.setCodec( QTextCodec::latin1 ); - QString text = ts.read(); - 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>; - 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 ); - line = text.mid( br, nbr - br ); - br = nbr+1; - } - //qDebug("end *%s* ", end.latin1()); - - setLocaleDict( mLocaleDict ); - } else { - qDebug("KO: Cannot find translation file %s",fileName.latin1() ); - } - - } - } config()->setGroup("General"); mCustomCategories = config()->readListEntry("Custom Categories"); - if ( KOPrefs::instance()->mLanguageChanged ) { + if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) { mLocationDefaults.clear(); mEventSummaryUser.clear(); mTodoSummaryUser.clear(); } + mOldLoadedLanguage = mOldLanguage ; + mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; if (mLocationDefaults.isEmpty()) { mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index c74b0ef..0656644 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -22,11 +22,11 @@ */ #ifndef KOPREFS_H #define KOPREFS_H -#include <qdict.h> #include <libkdepim/kpimprefs.h> +#include <qdict.h> class KConfig; class QFont; class QColor; @@ -69,9 +69,8 @@ class KOPrefs : public KPimPrefs object. */ KOPrefs(); static KOPrefs *mInstance; - QDict<QString> *mLocaleDict; QStringList getDefaultList(); public: // preferences data KConfig* getConfig(); @@ -157,9 +156,8 @@ class KOPrefs : public KPimPrefs int mNextXDays; int mWhatsNextDays; int mWhatsNextPrios; bool mEnableQuickTodo; - bool mLanguageChanged; bool mCompactDialogs; bool mVerticalScreen; @@ -252,23 +250,15 @@ class KOPrefs : public KPimPrefs int mAlarmPlayBeeps; int mAlarmSuspendTime; int mAlarmSuspendCount; int mAlarmBeepInterval; + int mOldLanguage; + int mOldLoadedLanguage; QString mActiveSyncPort; QString mActiveSyncIP; - - //US I copied the following settings into KPimGlobalPrefs - // that allows us later to easily remove the settings from here. - int mPreferredDate; - QString mUserDateFormatLong; - QString mUserDateFormatShort; - int mPreferredLanguage; - int mPreferredTime; - bool mWeekStartsOnSunday; - private: QDict<QColor> mCategoryColors; QColor mDefaultCategoryColor; diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp index cf07a1a..f5a1c50 100644 --- a/korganizer/ktimeedit.cpp +++ b/korganizer/ktimeedit.cpp @@ -30,8 +30,9 @@ #include <kmessagebox.h> #include <kglobal.h> #include <kdebug.h> #include <klocale.h> +#include <kpimglobalprefs.h> #include "ktimeedit.h" #include "koprefs.h" #include <qvalidator.h> @@ -110,9 +111,9 @@ KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int))); connect(this,SIGNAL(textChanged(const QString&)),this,SLOT(changedText())); QFontMetrics fm ( font() ); QString timeString = "24:00"; - if ( KOPrefs::instance()->mPreferredTime == 1 ) + if ( KPimGlobalPrefs::instance()->mPreferredTime == 1 ) timeString = "02:00pm"; int addSpace = 32; if ( QApplication::desktop()->width() > 320 ) timeString += ":00"; @@ -237,9 +238,9 @@ void KOTimeEdit::setSelect( int from, int to ) void KOTimeEdit::keyPressEvent(QKeyEvent *e) { qApp->processEvents(); - bool hour12Format = ( KOPrefs::instance()->mPreferredTime == 1 ); + bool hour12Format = ( KPimGlobalPrefs::instance()->mPreferredTime == 1 ); int maxpos = hour12Format?7:5; if ( e->isAutoRepeat() && !mFlagKeyPressed ) { e->ignore(); // qDebug(" ignore %d",e->isAutoRepeat() ); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index fbfcd20..dc2026b 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -224,12 +224,11 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : mView->openCalendar( defaultFileName() ); int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); qDebug("KO: Calendar loading time: %d ms",msNeeded ); - if ( KOPrefs::instance()->mLanguageChanged ) { + if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { KOPrefs::instance()->setCategoryDefaults(); int count = mView->addCategories(); - KOPrefs::instance()->mLanguageChanged = false; } processIncidenceSelection( 0 ); connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), SLOT( processIncidenceSelection( Incidence * ) ) ); diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 0a580ca..5298f0c 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp @@ -34,18 +34,21 @@ $Id$ #include <kdebug.h> #include <kstaticdeleter.h> #include <qregexp.h> +#include <qfile.h> +#include <qtextstream.h> +#include <qapplication.h> #include "kpimglobalprefs.h" KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; -static KStaticDeleter<KPimGlobalPrefs> staticDeleter; +static KStaticDeleter<KPimGlobalPrefs> staticDeleterGP; KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) : KPrefs("microkdeglobalrc") { - + mLocaleDict = 0; KPrefs::setCurrentGroup("Locale"); addItemInt("PreferredLanguage",&mPreferredLanguage,0); addItemInt("PreferredTime",&mPreferredTime,0); addItemInt("PreferredDate",&mPreferredDate,0); @@ -103,11 +106,70 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); } - void KPimGlobalPrefs::setGlobalConfig() { + if ( mLocaleDict == 0 ) { + QString fileName ; + QString name = KGlobal::getAppName() +"/"; +#ifndef DESKTOP_VERSION + fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/"+name +#else + fileName = qApp->applicationDirPath () + "/kdepim/"+ name; +#endif + mLocaleDict = 0; + if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { + + if ( mPreferredLanguage == 1 ) + fileName = fileName+"germantranslation.txt"; + else if ( mPreferredLanguage == 4 ) + fileName = fileName+"usertranslation.txt"; + else if ( mPreferredLanguage == 2 ) + fileName = fileName+"frenchtranslation.txt"; + else if ( mPreferredLanguage == 3 ) + fileName = fileName+"italiantranslation.txt"; + QFile file( fileName ); + if (file.open( IO_ReadOnly ) ) { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Latin1 ); + //ts.setCodec( QTextCodec::latin1 ); + QString text = ts.read(); + 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>; + 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 ); + line = text.mid( br, nbr - br ); + br = nbr+1; + } + //qDebug("end *%s* ", end.latin1()); + + setLocaleDict( mLocaleDict ); + } else { + qDebug("KO: Cannot find translation file %s",fileName.latin1() ); + } + } + } KGlobal::locale()->setHore24Format( !mPreferredTime ); KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); @@ -123,16 +185,22 @@ void KPimGlobalPrefs::setGlobalConfig() } 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 = staticDeleter.setObject( new KPimGlobalPrefs() ); + sInstance = staticDeleterGP.setObject( new KPimGlobalPrefs() ); sInstance->readConfig(); } return sInstance; diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h index d09c3da..11c534a 100644 --- a/libkdepim/kpimglobalprefs.h +++ b/libkdepim/kpimglobalprefs.h @@ -31,8 +31,9 @@ $Id$ #ifndef KPIMGLOBALPREFS_H #define KPIMGLOBALPREFS_H #include "kprefs.h" +#include <qdict.h> class KPimGlobalPrefs : public KPrefs { public: @@ -82,8 +83,9 @@ class KPimGlobalPrefs : public KPrefs private: KPimGlobalPrefs( const QString &name = QString::null ); static KPimGlobalPrefs *sInstance; + QDict<QString> *mLocaleDict; public: //US I copied the following "locale" settings from KOPrefs diff --git a/microkde/kstaticdeleter.h b/microkde/kstaticdeleter.h index dfd3929..d9c2b72 100644 --- a/microkde/kstaticdeleter.h +++ b/microkde/kstaticdeleter.h @@ -27,11 +27,12 @@ template<class type> class KStaticDeleter { public: KStaticDeleter() {}; - type *setObject( type *obj, bool isArray = false) { _mobj = obj;return obj; } - virtual ~KStaticDeleter() {delete _mobj;}; + type *setObject( type *obj, bool isArray = false) { _mobj = obj;_isArray = isArray;return obj; } + virtual ~KStaticDeleter() {if (_isArray) delete[] _mobj; else delete _mobj;}; private: type* _mobj; + bool _isArray; }; #endif diff --git a/pwmanager/pwmanager/pwmprefs.cpp b/pwmanager/pwmanager/pwmprefs.cpp index fdc34e0..68d5b68 100644 --- a/pwmanager/pwmanager/pwmprefs.cpp +++ b/pwmanager/pwmanager/pwmprefs.cpp @@ -30,9 +30,9 @@ #include "pwmprefs.h" PWMPrefs *PWMPrefs::sInstance = 0; -static KStaticDeleter<PWMPrefs> staticDeleter; +static KStaticDeleter<PWMPrefs> staticDeleterPP; PWMPrefs::PWMPrefs() : KPimPrefs("pwmanagerrc") { @@ -67,19 +67,23 @@ PWMPrefs::PWMPrefs() addItemIntList( "categorySplitter", &mCategorySplitter ); } PWMPrefs::~PWMPrefs() -{ +{ + if (sInstance == this) + sInstance = staticDeleterPP.setObject(0); + else + qDebug("Whats this? Error in PWMPrefs::~PWMPrefs()?"); } PWMPrefs *PWMPrefs::instance() { if ( !sInstance ) { #ifdef PWM_EMBEDDED - sInstance = staticDeleter.setObject( new PWMPrefs() ); + sInstance = staticDeleterPP.setObject( new PWMPrefs() ); #else //PWM_EMBEDDED //US the following line has changed ???. Why - staticDeleter.setObject( sInstance, new PWMPrefs() ); + staticDeleterPP.setObject( sInstance, new PWMPrefs() ); #endif //KAB_EMBEDDED sInstance->readConfig(); } |