-rw-r--r-- | pwmanager/pwmanager/pwmprefs.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
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 | |||
@@ -28,13 +28,13 @@ | |||
28 | #include <klocale.h> | 28 | #include <klocale.h> |
29 | #include <kstaticdeleter.h> | 29 | #include <kstaticdeleter.h> |
30 | 30 | ||
31 | #include "pwmprefs.h" | 31 | #include "pwmprefs.h" |
32 | 32 | ||
33 | PWMPrefs *PWMPrefs::sInstance = 0; | 33 | PWMPrefs *PWMPrefs::sInstance = 0; |
34 | static KStaticDeleter<PWMPrefs> staticDeleter; | 34 | static KStaticDeleter<PWMPrefs> staticDeleterPP; |
35 | 35 | ||
36 | PWMPrefs::PWMPrefs() | 36 | PWMPrefs::PWMPrefs() |
37 | : KPimPrefs("pwmanagerrc") | 37 | : KPimPrefs("pwmanagerrc") |
38 | { | 38 | { |
39 | KPrefs::setCurrentGroup( "Global" ); | 39 | KPrefs::setCurrentGroup( "Global" ); |
40 | 40 | ||
@@ -65,23 +65,27 @@ PWMPrefs::PWMPrefs() | |||
65 | addItemBool( "close", &mClose, CONF_DEFAULT_WNDCLOSE ); | 65 | addItemBool( "close", &mClose, CONF_DEFAULT_WNDCLOSE ); |
66 | addItemIntList( "commentSplitter", &mCommentSplitter ); | 66 | addItemIntList( "commentSplitter", &mCommentSplitter ); |
67 | addItemIntList( "categorySplitter", &mCategorySplitter ); | 67 | addItemIntList( "categorySplitter", &mCategorySplitter ); |
68 | } | 68 | } |
69 | 69 | ||
70 | PWMPrefs::~PWMPrefs() | 70 | PWMPrefs::~PWMPrefs() |
71 | { | 71 | { |
72 | if (sInstance == this) | ||
73 | sInstance = staticDeleterPP.setObject(0); | ||
74 | else | ||
75 | qDebug("Whats this? Error in PWMPrefs::~PWMPrefs()?"); | ||
72 | } | 76 | } |
73 | 77 | ||
74 | PWMPrefs *PWMPrefs::instance() | 78 | PWMPrefs *PWMPrefs::instance() |
75 | { | 79 | { |
76 | if ( !sInstance ) { | 80 | if ( !sInstance ) { |
77 | #ifdef PWM_EMBEDDED | 81 | #ifdef PWM_EMBEDDED |
78 | sInstance = staticDeleter.setObject( new PWMPrefs() ); | 82 | sInstance = staticDeleterPP.setObject( new PWMPrefs() ); |
79 | #else //PWM_EMBEDDED | 83 | #else //PWM_EMBEDDED |
80 | //US the following line has changed ???. Why | 84 | //US the following line has changed ???. Why |
81 | staticDeleter.setObject( sInstance, new PWMPrefs() ); | 85 | staticDeleterPP.setObject( sInstance, new PWMPrefs() ); |
82 | #endif //KAB_EMBEDDED | 86 | #endif //KAB_EMBEDDED |
83 | sInstance->readConfig(); | 87 | sInstance->readConfig(); |
84 | } | 88 | } |
85 | 89 | ||
86 | return sInstance; | 90 | return sInstance; |
87 | } | 91 | } |