summaryrefslogtreecommitdiff
path: root/noncore/net/mail/editaccounts.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/editaccounts.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp
index 28d531b..5c4bdf7 100644
--- a/noncore/net/mail/editaccounts.cpp
+++ b/noncore/net/mail/editaccounts.cpp
@@ -13,13 +13,31 @@
13 13
14AccountListItem::AccountListItem( QListView *parent, Account *a) 14AccountListItem::AccountListItem( QListView *parent, Account *a)
15 : QListViewItem( parent ) 15 : QListViewItem( parent )
16{ 16{
17 account = a; 17 account = a;
18 setText( 0, account->getAccountName() ); 18 setText( 0, account->getAccountName() );
19 setText( 1, account->getType() ); 19 QString ttext = "";
20 switch (account->getType()) {
21 case MAILLIB::A_NNTP:
22 ttext="NNTP";
23 break;
24 case MAILLIB::A_POP3:
25 ttext = "POP3";
26 break;
27 case MAILLIB::A_IMAP:
28 ttext = "IMAP";
29 break;
30 case MAILLIB::A_SMTP:
31 ttext = "SMTP";
32 break;
33 default:
34 ttext = "UNKNOWN";
35 break;
36 }
37 setText( 1, ttext);
20} 38}
21 39
22EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 40EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
23 : EditAccountsUI( parent, name, modal, flags ) 41 : EditAccountsUI( parent, name, modal, flags )
24{ 42{
25 qDebug( "New Account Configuration Widget" ); 43 qDebug( "New Account Configuration Widget" );
@@ -46,13 +64,13 @@ void EditAccounts::slotFillLists()
46 newsList->clear(); 64 newsList->clear();
47 65
48 QList<Account> accounts = settings->getAccounts(); 66 QList<Account> accounts = settings->getAccounts();
49 Account *it; 67 Account *it;
50 for ( it = accounts.first(); it; it = accounts.next() ) 68 for ( it = accounts.first(); it; it = accounts.next() )
51 { 69 {
52 if ( it->getType().compare( "NNTP" ) == 0 ) 70 if ( it->getType()==MAILLIB::A_NNTP )
53 { 71 {
54 (void) new AccountListItem( newsList, it ); 72 (void) new AccountListItem( newsList, it );
55 } 73 }
56 else 74 else
57 { 75 {
58 (void) new AccountListItem( mailList, it ); 76 (void) new AccountListItem( mailList, it );
@@ -140,40 +158,40 @@ void EditAccounts::slotNewAccount( const QString &type )
140 } 158 }
141 } 159 }
142} 160}
143 161
144void EditAccounts::slotEditAccount( Account *account ) 162void EditAccounts::slotEditAccount( Account *account )
145{ 163{
146 if ( account->getType().compare( "IMAP" ) == 0 ) 164 if ( account->getType() == MAILLIB::A_IMAP )
147 { 165 {
148 IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); 166 IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account);
149 IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp ); 167 IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp );
150 if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) 168 if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) )
151 { 169 {
152 slotFillLists(); 170 slotFillLists();
153 } 171 }
154 } 172 }
155 else if ( account->getType().compare( "POP3" ) == 0 ) 173 else if ( account->getType()==MAILLIB::A_POP3 )
156 { 174 {
157 POP3account *pop3Acc = static_cast<POP3account *>(account); 175 POP3account *pop3Acc = static_cast<POP3account *>(account);
158 POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp ); 176 POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp );
159 if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) 177 if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) )
160 { 178 {
161 slotFillLists(); 179 slotFillLists();
162 } 180 }
163 } 181 }
164 else if ( account->getType().compare( "SMTP" ) == 0 ) 182 else if ( account->getType()==MAILLIB::A_SMTP )
165 { 183 {
166 SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); 184 SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account);
167 SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp ); 185 SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp );
168 if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) 186 if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) )
169 { 187 {
170 slotFillLists(); 188 slotFillLists();
171 } 189 }
172 } 190 }
173 else if ( account->getType().compare( "NNTP" ) == 0 ) 191 else if ( account->getType()==MAILLIB::A_NNTP)
174 { 192 {
175 NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); 193 NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account);
176 NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); 194 NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp );
177 if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) 195 if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) )
178 { 196 {
179 slotFillLists(); 197 slotFillLists();