author | alwin <alwin> | 2004-03-08 01:00:18 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-08 01:00:18 (UTC) |
commit | eddc5184f5be6a067b077d18e240a1fe982bbcf4 (patch) (side-by-side diff) | |
tree | 0d9458a10520ca23e1d5d041d9d2ca4150bd8f1c /noncore/net/mail/editaccounts.cpp | |
parent | eedafdf1a1d973c083cb108a913005d14a78a9ae (diff) | |
download | opie-eddc5184f5be6a067b077d18e240a1fe982bbcf4.zip opie-eddc5184f5be6a067b077d18e240a1fe982bbcf4.tar.gz opie-eddc5184f5be6a067b077d18e240a1fe982bbcf4.tar.bz2 |
type of mail account will be defined by a enum not with string - comparing
strings all the time makes no sense.
Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 30 |
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 @@ -18,3 +18,21 @@ AccountListItem::AccountListItem( QListView *parent, Account *a) setText( 0, account->getAccountName() ); - setText( 1, account->getType() ); + QString ttext = ""; + switch (account->getType()) { + case MAILLIB::A_NNTP: + ttext="NNTP"; + break; + case MAILLIB::A_POP3: + ttext = "POP3"; + break; + case MAILLIB::A_IMAP: + ttext = "IMAP"; + break; + case MAILLIB::A_SMTP: + ttext = "SMTP"; + break; + default: + ttext = "UNKNOWN"; + break; + } + setText( 1, ttext); } @@ -51,3 +69,3 @@ void EditAccounts::slotFillLists() { - if ( it->getType().compare( "NNTP" ) == 0 ) + if ( it->getType()==MAILLIB::A_NNTP ) { @@ -145,3 +163,3 @@ void EditAccounts::slotEditAccount( Account *account ) { - if ( account->getType().compare( "IMAP" ) == 0 ) + if ( account->getType() == MAILLIB::A_IMAP ) { @@ -154,3 +172,3 @@ void EditAccounts::slotEditAccount( Account *account ) } - else if ( account->getType().compare( "POP3" ) == 0 ) + else if ( account->getType()==MAILLIB::A_POP3 ) { @@ -163,3 +181,3 @@ void EditAccounts::slotEditAccount( Account *account ) } - else if ( account->getType().compare( "SMTP" ) == 0 ) + else if ( account->getType()==MAILLIB::A_SMTP ) { @@ -172,3 +190,3 @@ void EditAccounts::slotEditAccount( Account *account ) } - else if ( account->getType().compare( "NNTP" ) == 0 ) + else if ( account->getType()==MAILLIB::A_NNTP) { |