-rw-r--r-- | kmicromail/koprefs.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp index 8143b6f..342bbf3 100644 --- a/kmicromail/koprefs.cpp +++ b/kmicromail/koprefs.cpp | |||
@@ -48,41 +48,45 @@ | |||
48 | 48 | ||
49 | KOPrefs *KOPrefs::mInstance = 0; | 49 | KOPrefs *KOPrefs::mInstance = 0; |
50 | static KStaticDeleter<KOPrefs> insd; | 50 | static KStaticDeleter<KOPrefs> insd; |
51 | 51 | ||
52 | KOPrefs::KOPrefs() : | 52 | KOPrefs::KOPrefs() : |
53 | KPimPrefs("kopiemailrc") | 53 | KPimPrefs("kopiemailrc") |
54 | { | 54 | { |
55 | mAppFont = QFont("helvetica",12); | 55 | mAppFont = QFont("helvetica",12); |
56 | mComposeFont = QFont("helvetica",12); | 56 | mComposeFont = QFont("helvetica",12); |
57 | mReadFont = QFont("helvetica",12); | 57 | mReadFont = QFont("helvetica",12); |
58 | 58 | ||
59 | KPrefs::setCurrentGroup("General"); | 59 | KPrefs::setCurrentGroup("General"); |
60 | addItemString("SendCodec",&mSendCodec,i18n ("userdefined") ); | ||
60 | addItemString("SenderName",&mName,i18n ("Please set at") ); | 61 | addItemString("SenderName",&mName,i18n ("Please set at") ); |
61 | addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") ); | 62 | addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") ); |
62 | addItemBool("ViewMailAsHtml",&mViewAsHtml,false); | 63 | addItemBool("ViewMailAsHtml",&mViewAsHtml,false); |
63 | addItemBool("SendMailLater",&mSendLater,true); | 64 | addItemBool("SendMailLater",&mSendLater,true); |
64 | addItemBool("UseKapi",&mUseKapi,false); | 65 | addItemBool("UseKapi",&mUseKapi,false); |
66 | addItemInt("CurrentCodec",&mCurrentCodec,0); | ||
65 | 67 | ||
66 | KPrefs::setCurrentGroup("Fonts"); | 68 | KPrefs::setCurrentGroup("Fonts"); |
67 | addItemFont("Application Font",&mAppFont); | 69 | addItemFont("Application Font",&mAppFont); |
68 | addItemFont("Compose Font",&mComposeFont); | 70 | addItemFont("Compose Font",&mComposeFont); |
69 | addItemFont("Read Font",&mReadFont); | 71 | addItemFont("Read Font",&mReadFont); |
70 | fillMailDefaults(); | 72 | fillMailDefaults(); |
71 | 73 | isDirty = false; | |
72 | } | 74 | } |
73 | 75 | ||
74 | 76 | ||
75 | KOPrefs::~KOPrefs() | 77 | KOPrefs::~KOPrefs() |
76 | { | 78 | { |
79 | if ( isDirty ) | ||
80 | writeConfig(); | ||
77 | if (mInstance == this) | 81 | if (mInstance == this) |
78 | mInstance = insd.setObject(0); | 82 | mInstance = insd.setObject(0); |
79 | 83 | ||
80 | } | 84 | } |
81 | 85 | ||
82 | 86 | ||
83 | KOPrefs *KOPrefs::instance() | 87 | KOPrefs *KOPrefs::instance() |
84 | { | 88 | { |
85 | if (!mInstance) { | 89 | if (!mInstance) { |
86 | mInstance = insd.setObject(new KOPrefs()); | 90 | mInstance = insd.setObject(new KOPrefs()); |
87 | mInstance->readConfig(); | 91 | mInstance->readConfig(); |
88 | } | 92 | } |
@@ -101,22 +105,21 @@ void KOPrefs::fillMailDefaults() | |||
101 | if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB"); | 105 | if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB"); |
102 | } | 106 | } |
103 | 107 | ||
104 | void KOPrefs::usrReadConfig() | 108 | void KOPrefs::usrReadConfig() |
105 | { | 109 | { |
106 | 110 | ||
107 | KPimPrefs::usrReadConfig(); | 111 | KPimPrefs::usrReadConfig(); |
108 | } | 112 | } |
109 | 113 | ||
110 | 114 | ||
111 | void KOPrefs::usrWriteConfig() | 115 | void KOPrefs::usrWriteConfig() |
112 | { | 116 | { |
113 | |||
114 | KPimPrefs::usrWriteConfig(); | 117 | KPimPrefs::usrWriteConfig(); |
115 | } | 118 | } |
116 | 119 | ||
117 | 120 | ||
118 | 121 | ||
119 | KConfig* KOPrefs::getConfig() | 122 | KConfig* KOPrefs::getConfig() |
120 | { | 123 | { |
121 | return config(); | 124 | return config(); |
122 | } | 125 | } |