summaryrefslogtreecommitdiff
authoralwin <alwin>2004-02-18 22:36:26 (UTC)
committer alwin <alwin>2004-02-18 22:36:26 (UTC)
commitcfd235730a4619ae9181f0d78d78a7f9360ea49e (patch) (unidiff)
tree6044d8213b5b794ef6d99c60667df17445d86b2d
parent71b6aa6d19ed2e4690cd98ecdb7dbfe40f857653 (diff)
downloadopie-cfd235730a4619ae9181f0d78d78a7f9360ea49e.zip
opie-cfd235730a4619ae9181f0d78d78a7f9360ea49e.tar.gz
opie-cfd235730a4619ae9181f0d78d78a7f9360ea49e.tar.bz2
forgot member variable initializer
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/settings.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp
index 3279f39..65ca387 100644
--- a/noncore/net/mail/libmailwrapper/settings.cpp
+++ b/noncore/net/mail/libmailwrapper/settings.cpp
@@ -1,438 +1,439 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <qdir.h> 2#include <qdir.h>
3 3
4#include <qpe/config.h> 4#include <qpe/config.h>
5 5
6#include "settings.h" 6#include "settings.h"
7//#include "defines.h" 7//#include "defines.h"
8 8
9#define IMAP_PORT "143" 9#define IMAP_PORT "143"
10#define IMAP_SSL_PORT "993" 10#define IMAP_SSL_PORT "993"
11#define SMTP_PORT "25" 11#define SMTP_PORT "25"
12#define SMTP_SSL_PORT "465" 12#define SMTP_SSL_PORT "465"
13#define POP3_PORT "110" 13#define POP3_PORT "110"
14#define POP3_SSL_PORT "995" 14#define POP3_SSL_PORT "995"
15#define NNTP_PORT "119" 15#define NNTP_PORT "119"
16#define NNTP_SSL_PORT "563" 16#define NNTP_SSL_PORT "563"
17 17
18 18
19Settings::Settings() 19Settings::Settings()
20 : QObject() 20 : QObject()
21{ 21{
22 updateAccounts(); 22 updateAccounts();
23} 23}
24 24
25void Settings::checkDirectory() 25void Settings::checkDirectory()
26{ 26{
27 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { 27 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) {
28 system( "mkdir -p $HOME/Applications/opiemail" ); 28 system( "mkdir -p $HOME/Applications/opiemail" );
29 qDebug( "$HOME/Applications/opiemail created" ); 29 qDebug( "$HOME/Applications/opiemail created" );
30 } 30 }
31} 31}
32 32
33QList<Account> Settings::getAccounts() 33QList<Account> Settings::getAccounts()
34{ 34{
35 return accounts; 35 return accounts;
36} 36}
37 37
38void Settings::addAccount( Account *account ) 38void Settings::addAccount( Account *account )
39{ 39{
40 accounts.append( account ); 40 accounts.append( account );
41} 41}
42 42
43void Settings::delAccount( Account *account ) 43void Settings::delAccount( Account *account )
44{ 44{
45 accounts.remove( account ); 45 accounts.remove( account );
46 account->remove(); 46 account->remove();
47} 47}
48 48
49void Settings::updateAccounts() 49void Settings::updateAccounts()
50{ 50{
51 accounts.clear(); 51 accounts.clear();
52 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); 52 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
53 QStringList::Iterator it; 53 QStringList::Iterator it;
54 54
55 QStringList imap = dir.entryList( "imap-*" ); 55 QStringList imap = dir.entryList( "imap-*" );
56 for ( it = imap.begin(); it != imap.end(); it++ ) { 56 for ( it = imap.begin(); it != imap.end(); it++ ) {
57 qDebug( "Added IMAP account" ); 57 qDebug( "Added IMAP account" );
58 IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); 58 IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") );
59 accounts.append( account ); 59 accounts.append( account );
60 } 60 }
61 61
62 QStringList pop3 = dir.entryList( "pop3-*" ); 62 QStringList pop3 = dir.entryList( "pop3-*" );
63 for ( it = pop3.begin(); it != pop3.end(); it++ ) { 63 for ( it = pop3.begin(); it != pop3.end(); it++ ) {
64 qDebug( "Added POP account" ); 64 qDebug( "Added POP account" );
65 POP3account *account = new POP3account( (*it).replace(0, 5, "") ); 65 POP3account *account = new POP3account( (*it).replace(0, 5, "") );
66 accounts.append( account ); 66 accounts.append( account );
67 } 67 }
68 68
69 QStringList smtp = dir.entryList( "smtp-*" ); 69 QStringList smtp = dir.entryList( "smtp-*" );
70 for ( it = smtp.begin(); it != smtp.end(); it++ ) { 70 for ( it = smtp.begin(); it != smtp.end(); it++ ) {
71 qDebug( "Added SMTP account" ); 71 qDebug( "Added SMTP account" );
72 SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); 72 SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") );
73 accounts.append( account ); 73 accounts.append( account );
74 } 74 }
75 75
76 QStringList nntp = dir.entryList( "nntp-*" ); 76 QStringList nntp = dir.entryList( "nntp-*" );
77 for ( it = nntp.begin(); it != nntp.end(); it++ ) { 77 for ( it = nntp.begin(); it != nntp.end(); it++ ) {
78 qDebug( "Added NNTP account" ); 78 qDebug( "Added NNTP account" );
79 NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); 79 NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") );
80 accounts.append( account ); 80 accounts.append( account );
81 } 81 }
82 82
83 readAccounts(); 83 readAccounts();
84} 84}
85 85
86void Settings::saveAccounts() 86void Settings::saveAccounts()
87{ 87{
88 checkDirectory(); 88 checkDirectory();
89 Account *it; 89 Account *it;
90 90
91 for ( it = accounts.first(); it; it = accounts.next() ) { 91 for ( it = accounts.first(); it; it = accounts.next() ) {
92 it->save(); 92 it->save();
93 } 93 }
94} 94}
95 95
96void Settings::readAccounts() 96void Settings::readAccounts()
97{ 97{
98 checkDirectory(); 98 checkDirectory();
99 Account *it; 99 Account *it;
100 100
101 for ( it = accounts.first(); it; it = accounts.next() ) { 101 for ( it = accounts.first(); it; it = accounts.next() ) {
102 it->read(); 102 it->read();
103 } 103 }
104} 104}
105 105
106Account::Account() 106Account::Account()
107{ 107{
108 accountName = "changeMe"; 108 accountName = "changeMe";
109 type = "changeMe"; 109 type = "changeMe";
110 ssl = false; 110 ssl = false;
111 connectionType = 1; 111 connectionType = 1;
112 offline = false;
112} 113}
113 114
114void Account::remove() 115void Account::remove()
115{ 116{
116 QFile file( getFileName() ); 117 QFile file( getFileName() );
117 file.remove(); 118 file.remove();
118} 119}
119 120
120IMAPaccount::IMAPaccount() 121IMAPaccount::IMAPaccount()
121 : Account() 122 : Account()
122{ 123{
123 file = IMAPaccount::getUniqueFileName(); 124 file = IMAPaccount::getUniqueFileName();
124 accountName = "New IMAP Account"; 125 accountName = "New IMAP Account";
125 ssl = false; 126 ssl = false;
126 connectionType = 1; 127 connectionType = 1;
127 type = "IMAP"; 128 type = "IMAP";
128 port = IMAP_PORT; 129 port = IMAP_PORT;
129} 130}
130 131
131IMAPaccount::IMAPaccount( QString filename ) 132IMAPaccount::IMAPaccount( QString filename )
132 : Account() 133 : Account()
133{ 134{
134 file = filename; 135 file = filename;
135 accountName = "New IMAP Account"; 136 accountName = "New IMAP Account";
136 ssl = false; 137 ssl = false;
137 connectionType = 1; 138 connectionType = 1;
138 type = "IMAP"; 139 type = "IMAP";
139 port = IMAP_PORT; 140 port = IMAP_PORT;
140} 141}
141 142
142QString IMAPaccount::getUniqueFileName() 143QString IMAPaccount::getUniqueFileName()
143{ 144{
144 int num = 0; 145 int num = 0;
145 QString unique; 146 QString unique;
146 147
147 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); 148 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
148 149
149 QStringList imap = dir.entryList( "imap-*" ); 150 QStringList imap = dir.entryList( "imap-*" );
150 do { 151 do {
151 unique.setNum( num++ ); 152 unique.setNum( num++ );
152 } while ( imap.contains( "imap-" + unique ) > 0 ); 153 } while ( imap.contains( "imap-" + unique ) > 0 );
153 154
154 return unique; 155 return unique;
155} 156}
156 157
157void IMAPaccount::read() 158void IMAPaccount::read()
158{ 159{
159 Config *conf = new Config( getFileName(), Config::File ); 160 Config *conf = new Config( getFileName(), Config::File );
160 conf->setGroup( "IMAP Account" ); 161 conf->setGroup( "IMAP Account" );
161 accountName = conf->readEntry( "Account","" ); 162 accountName = conf->readEntry( "Account","" );
162 if (accountName.isNull()) accountName = ""; 163 if (accountName.isNull()) accountName = "";
163 server = conf->readEntry( "Server","" ); 164 server = conf->readEntry( "Server","" );
164 if (server.isNull()) server=""; 165 if (server.isNull()) server="";
165 port = conf->readEntry( "Port","" ); 166 port = conf->readEntry( "Port","" );
166 if (port.isNull()) port="143"; 167 if (port.isNull()) port="143";
167 connectionType = conf->readNumEntry( "ConnectionType" ); 168 connectionType = conf->readNumEntry( "ConnectionType" );
168 ssl = conf->readBoolEntry( "SSL",false ); 169 ssl = conf->readBoolEntry( "SSL",false );
169 user = conf->readEntry( "User","" ); 170 user = conf->readEntry( "User","" );
170 if (user.isNull()) user = ""; 171 if (user.isNull()) user = "";
171 password = conf->readEntryCrypt( "Password","" ); 172 password = conf->readEntryCrypt( "Password","" );
172 if (password.isNull()) password = ""; 173 if (password.isNull()) password = "";
173 prefix = conf->readEntry("MailPrefix",""); 174 prefix = conf->readEntry("MailPrefix","");
174 if (prefix.isNull()) prefix = ""; 175 if (prefix.isNull()) prefix = "";
175 offline = conf->readBoolEntry("Offline",false); 176 offline = conf->readBoolEntry("Offline",false);
176 delete conf; 177 delete conf;
177} 178}
178 179
179void IMAPaccount::save() 180void IMAPaccount::save()
180{ 181{
181 qDebug( "saving " + getFileName() ); 182 qDebug( "saving " + getFileName() );
182 Settings::checkDirectory(); 183 Settings::checkDirectory();
183 184
184 Config *conf = new Config( getFileName(), Config::File ); 185 Config *conf = new Config( getFileName(), Config::File );
185 conf->setGroup( "IMAP Account" ); 186 conf->setGroup( "IMAP Account" );
186 conf->writeEntry( "Account", accountName ); 187 conf->writeEntry( "Account", accountName );
187 conf->writeEntry( "Server", server ); 188 conf->writeEntry( "Server", server );
188 conf->writeEntry( "Port", port ); 189 conf->writeEntry( "Port", port );
189 conf->writeEntry( "SSL", ssl ); 190 conf->writeEntry( "SSL", ssl );
190 conf->writeEntry( "ConnectionType", connectionType ); 191 conf->writeEntry( "ConnectionType", connectionType );
191 conf->writeEntry( "User", user ); 192 conf->writeEntry( "User", user );
192 conf->writeEntryCrypt( "Password", password ); 193 conf->writeEntryCrypt( "Password", password );
193 conf->writeEntry( "MailPrefix",prefix); 194 conf->writeEntry( "MailPrefix",prefix);
194 conf->writeEntry( "Offline",offline); 195 conf->writeEntry( "Offline",offline);
195 conf->write(); 196 conf->write();
196 delete conf; 197 delete conf;
197} 198}
198 199
199 200
200QString IMAPaccount::getFileName() 201QString IMAPaccount::getFileName()
201{ 202{
202 return (QString) getenv( "HOME" ) + "/Applications/opiemail/imap-" + file; 203 return (QString) getenv( "HOME" ) + "/Applications/opiemail/imap-" + file;
203} 204}
204 205
205POP3account::POP3account() 206POP3account::POP3account()
206 : Account() 207 : Account()
207{ 208{
208 file = POP3account::getUniqueFileName(); 209 file = POP3account::getUniqueFileName();
209 accountName = "New POP3 Account"; 210 accountName = "New POP3 Account";
210 ssl = false; 211 ssl = false;
211 connectionType = 1; 212 connectionType = 1;
212 type = "POP3"; 213 type = "POP3";
213 port = POP3_PORT; 214 port = POP3_PORT;
214} 215}
215 216
216POP3account::POP3account( QString filename ) 217POP3account::POP3account( QString filename )
217 : Account() 218 : Account()
218{ 219{
219 file = filename; 220 file = filename;
220 accountName = "New POP3 Account"; 221 accountName = "New POP3 Account";
221 ssl = false; 222 ssl = false;
222 connectionType = 1; 223 connectionType = 1;
223 type = "POP3"; 224 type = "POP3";
224 port = POP3_PORT; 225 port = POP3_PORT;
225} 226}
226 227
227QString POP3account::getUniqueFileName() 228QString POP3account::getUniqueFileName()
228{ 229{
229 int num = 0; 230 int num = 0;
230 QString unique; 231 QString unique;
231 232
232 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); 233 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
233 234
234 QStringList imap = dir.entryList( "pop3-*" ); 235 QStringList imap = dir.entryList( "pop3-*" );
235 do { 236 do {
236 unique.setNum( num++ ); 237 unique.setNum( num++ );
237 } while ( imap.contains( "pop3-" + unique ) > 0 ); 238 } while ( imap.contains( "pop3-" + unique ) > 0 );
238 239
239 return unique; 240 return unique;
240} 241}
241 242
242void POP3account::read() 243void POP3account::read()
243{ 244{
244 Config *conf = new Config( getFileName(), Config::File ); 245 Config *conf = new Config( getFileName(), Config::File );
245 conf->setGroup( "POP3 Account" ); 246 conf->setGroup( "POP3 Account" );
246 accountName = conf->readEntry( "Account" ); 247 accountName = conf->readEntry( "Account" );
247 server = conf->readEntry( "Server" ); 248 server = conf->readEntry( "Server" );
248 port = conf->readEntry( "Port" ); 249 port = conf->readEntry( "Port" );
249 ssl = conf->readBoolEntry( "SSL" ); 250 ssl = conf->readBoolEntry( "SSL" );
250 connectionType = conf->readNumEntry( "ConnectionType" ); 251 connectionType = conf->readNumEntry( "ConnectionType" );
251 user = conf->readEntry( "User" ); 252 user = conf->readEntry( "User" );
252 password = conf->readEntryCrypt( "Password" ); 253 password = conf->readEntryCrypt( "Password" );
253 offline = conf->readBoolEntry("Offline",false); 254 offline = conf->readBoolEntry("Offline",false);
254 delete conf; 255 delete conf;
255} 256}
256 257
257void POP3account::save() 258void POP3account::save()
258{ 259{
259 qDebug( "saving " + getFileName() ); 260 qDebug( "saving " + getFileName() );
260 Settings::checkDirectory(); 261 Settings::checkDirectory();
261 262
262 Config *conf = new Config( getFileName(), Config::File ); 263 Config *conf = new Config( getFileName(), Config::File );
263 conf->setGroup( "POP3 Account" ); 264 conf->setGroup( "POP3 Account" );
264 conf->writeEntry( "Account", accountName ); 265 conf->writeEntry( "Account", accountName );
265 conf->writeEntry( "Server", server ); 266 conf->writeEntry( "Server", server );
266 conf->writeEntry( "Port", port ); 267 conf->writeEntry( "Port", port );
267 conf->writeEntry( "SSL", ssl ); 268 conf->writeEntry( "SSL", ssl );
268 conf->writeEntry( "ConnectionType", connectionType ); 269 conf->writeEntry( "ConnectionType", connectionType );
269 conf->writeEntry( "User", user ); 270 conf->writeEntry( "User", user );
270 conf->writeEntryCrypt( "Password", password ); 271 conf->writeEntryCrypt( "Password", password );
271 conf->writeEntry( "Offline",offline); 272 conf->writeEntry( "Offline",offline);
272 conf->write(); 273 conf->write();
273 delete conf; 274 delete conf;
274} 275}
275 276
276 277
277QString POP3account::getFileName() 278QString POP3account::getFileName()
278{ 279{
279 return (QString) getenv( "HOME" ) + "/Applications/opiemail/pop3-" + file; 280 return (QString) getenv( "HOME" ) + "/Applications/opiemail/pop3-" + file;
280} 281}
281 282
282SMTPaccount::SMTPaccount() 283SMTPaccount::SMTPaccount()
283 : Account() 284 : Account()
284{ 285{
285 file = SMTPaccount::getUniqueFileName(); 286 file = SMTPaccount::getUniqueFileName();
286 accountName = "New SMTP Account"; 287 accountName = "New SMTP Account";
287 ssl = false; 288 ssl = false;
288 connectionType = 1; 289 connectionType = 1;
289 login = false; 290 login = false;
290 useCC = false; 291 useCC = false;
291 useBCC = false; 292 useBCC = false;
292 useReply = false; 293 useReply = false;
293 type = "SMTP"; 294 type = "SMTP";
294 port = SMTP_PORT; 295 port = SMTP_PORT;
295} 296}
296 297
297SMTPaccount::SMTPaccount( QString filename ) 298SMTPaccount::SMTPaccount( QString filename )
298 : Account() 299 : Account()
299{ 300{
300 file = filename; 301 file = filename;
301 accountName = "New SMTP Account"; 302 accountName = "New SMTP Account";
302 ssl = false; 303 ssl = false;
303 connectionType = 1; 304 connectionType = 1;
304 login = false; 305 login = false;
305 type = "SMTP"; 306 type = "SMTP";
306 port = SMTP_PORT; 307 port = SMTP_PORT;
307} 308}
308 309
309QString SMTPaccount::getUniqueFileName() 310QString SMTPaccount::getUniqueFileName()
310{ 311{
311 int num = 0; 312 int num = 0;
312 QString unique; 313 QString unique;
313 314
314 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); 315 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
315 316
316 QStringList imap = dir.entryList( "smtp-*" ); 317 QStringList imap = dir.entryList( "smtp-*" );
317 do { 318 do {
318 unique.setNum( num++ ); 319 unique.setNum( num++ );
319 } while ( imap.contains( "smtp-" + unique ) > 0 ); 320 } while ( imap.contains( "smtp-" + unique ) > 0 );
320 321
321 return unique; 322 return unique;
322} 323}
323 324
324void SMTPaccount::read() 325void SMTPaccount::read()
325{ 326{
326 Config *conf = new Config( getFileName(), Config::File ); 327 Config *conf = new Config( getFileName(), Config::File );
327 conf->setGroup( "SMTP Account" ); 328 conf->setGroup( "SMTP Account" );
328 accountName = conf->readEntry( "Account" ); 329 accountName = conf->readEntry( "Account" );
329 server = conf->readEntry( "Server" ); 330 server = conf->readEntry( "Server" );
330 port = conf->readEntry( "Port" ); 331 port = conf->readEntry( "Port" );
331 ssl = conf->readBoolEntry( "SSL" ); 332 ssl = conf->readBoolEntry( "SSL" );
332 connectionType = conf->readNumEntry( "ConnectionType" ); 333 connectionType = conf->readNumEntry( "ConnectionType" );
333 login = conf->readBoolEntry( "Login" ); 334 login = conf->readBoolEntry( "Login" );
334 user = conf->readEntry( "User" ); 335 user = conf->readEntry( "User" );
335 password = conf->readEntryCrypt( "Password" ); 336 password = conf->readEntryCrypt( "Password" );
336 delete conf; 337 delete conf;
337} 338}
338 339
339void SMTPaccount::save() 340void SMTPaccount::save()
340{ 341{
341 qDebug( "saving " + getFileName() ); 342 qDebug( "saving " + getFileName() );
342 Settings::checkDirectory(); 343 Settings::checkDirectory();
343 344
344 Config *conf = new Config( getFileName(), Config::File ); 345 Config *conf = new Config( getFileName(), Config::File );
345 conf->setGroup( "SMTP Account" ); 346 conf->setGroup( "SMTP Account" );
346 conf->writeEntry( "Account", accountName ); 347 conf->writeEntry( "Account", accountName );
347 conf->writeEntry( "Server", server ); 348 conf->writeEntry( "Server", server );
348 conf->writeEntry( "Port", port ); 349 conf->writeEntry( "Port", port );
349 conf->writeEntry( "SSL", ssl ); 350 conf->writeEntry( "SSL", ssl );
350 conf->writeEntry( "ConnectionType", connectionType ); 351 conf->writeEntry( "ConnectionType", connectionType );
351 conf->writeEntry( "Login", login ); 352 conf->writeEntry( "Login", login );
352 conf->writeEntry( "User", user ); 353 conf->writeEntry( "User", user );
353 conf->writeEntryCrypt( "Password", password ); 354 conf->writeEntryCrypt( "Password", password );
354 conf->write(); 355 conf->write();
355 delete conf; 356 delete conf;
356} 357}
357 358
358 359
359QString SMTPaccount::getFileName() 360QString SMTPaccount::getFileName()
360{ 361{
361 return (QString) getenv( "HOME" ) + "/Applications/opiemail/smtp-" + file; 362 return (QString) getenv( "HOME" ) + "/Applications/opiemail/smtp-" + file;
362} 363}
363 364
364NNTPaccount::NNTPaccount() 365NNTPaccount::NNTPaccount()
365 : Account() 366 : Account()
366{ 367{
367 file = NNTPaccount::getUniqueFileName(); 368 file = NNTPaccount::getUniqueFileName();
368 accountName = "New NNTP Account"; 369 accountName = "New NNTP Account";
369 ssl = false; 370 ssl = false;
370 login = false; 371 login = false;
371 type = "NNTP"; 372 type = "NNTP";
372 port = NNTP_PORT; 373 port = NNTP_PORT;
373} 374}
374 375
375NNTPaccount::NNTPaccount( QString filename ) 376NNTPaccount::NNTPaccount( QString filename )
376 : Account() 377 : Account()
377{ 378{
378 file = filename; 379 file = filename;
379 accountName = "New NNTP Account"; 380 accountName = "New NNTP Account";
380 ssl = false; 381 ssl = false;
381 login = false; 382 login = false;
382 type = "NNTP"; 383 type = "NNTP";
383 port = NNTP_PORT; 384 port = NNTP_PORT;
384} 385}
385 386
386QString NNTPaccount::getUniqueFileName() 387QString NNTPaccount::getUniqueFileName()
387{ 388{
388 int num = 0; 389 int num = 0;
389 QString unique; 390 QString unique;
390 391
391 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); 392 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
392 393
393 QStringList imap = dir.entryList( "nntp-*" ); 394 QStringList imap = dir.entryList( "nntp-*" );
394 do { 395 do {
395 unique.setNum( num++ ); 396 unique.setNum( num++ );
396 } while ( imap.contains( "nntp-" + unique ) > 0 ); 397 } while ( imap.contains( "nntp-" + unique ) > 0 );
397 398
398 return unique; 399 return unique;
399} 400}
400 401
401void NNTPaccount::read() 402void NNTPaccount::read()
402{ 403{
403 Config *conf = new Config( getFileName(), Config::File ); 404 Config *conf = new Config( getFileName(), Config::File );
404 conf->setGroup( "NNTP Account" ); 405 conf->setGroup( "NNTP Account" );
405 accountName = conf->readEntry( "Account" ); 406 accountName = conf->readEntry( "Account" );
406 server = conf->readEntry( "Server" ); 407 server = conf->readEntry( "Server" );
407 port = conf->readEntry( "Port" ); 408 port = conf->readEntry( "Port" );
408 ssl = conf->readBoolEntry( "SSL" ); 409 ssl = conf->readBoolEntry( "SSL" );
409 login = conf->readBoolEntry( "Login" ); 410 login = conf->readBoolEntry( "Login" );
410 user = conf->readEntry( "User" ); 411 user = conf->readEntry( "User" );
411 password = conf->readEntryCrypt( "Password" ); 412 password = conf->readEntryCrypt( "Password" );
412 delete conf; 413 delete conf;
413} 414}
414 415
415void NNTPaccount::save() 416void NNTPaccount::save()
416{ 417{
417 qDebug( "saving " + getFileName() ); 418 qDebug( "saving " + getFileName() );
418 Settings::checkDirectory(); 419 Settings::checkDirectory();
419 420
420 Config *conf = new Config( getFileName(), Config::File ); 421 Config *conf = new Config( getFileName(), Config::File );
421 conf->setGroup( "NNTP Account" ); 422 conf->setGroup( "NNTP Account" );
422 conf->writeEntry( "Account", accountName ); 423 conf->writeEntry( "Account", accountName );
423 conf->writeEntry( "Server", server ); 424 conf->writeEntry( "Server", server );
424 conf->writeEntry( "Port", port ); 425 conf->writeEntry( "Port", port );
425 conf->writeEntry( "SSL", ssl ); 426 conf->writeEntry( "SSL", ssl );
426 conf->writeEntry( "Login", login ); 427 conf->writeEntry( "Login", login );
427 conf->writeEntry( "User", user ); 428 conf->writeEntry( "User", user );
428 conf->writeEntryCrypt( "Password", password ); 429 conf->writeEntryCrypt( "Password", password );
429 conf->write(); 430 conf->write();
430 delete conf; 431 delete conf;
431} 432}
432 433
433 434
434QString NNTPaccount::getFileName() 435QString NNTPaccount::getFileName()
435{ 436{
436 return (QString) getenv( "HOME" ) + "/Applications/opiemail/nntp-" + file; 437 return (QString) getenv( "HOME" ) + "/Applications/opiemail/nntp-" + file;
437} 438}
438 439