author | alwin <alwin> | 2004-02-13 13:30:59 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-13 13:30:59 (UTC) |
commit | a5fe5b3b4b9e3336cfa197afc4d47a4158d6bb5a (patch) (unidiff) | |
tree | dcca941b96511910b108e8e0e55341007317ca66 /noncore/net/mail/selectsmtp.cpp | |
parent | b2a7fc6676ce0ded770eda518a8eb93a64477b4f (diff) | |
download | opie-a5fe5b3b4b9e3336cfa197afc4d47a4158d6bb5a.zip opie-a5fe5b3b4b9e3336cfa197afc4d47a4158d6bb5a.tar.gz opie-a5fe5b3b4b9e3336cfa197afc4d47a4158d6bb5a.tar.bz2 |
pre-select the first account on setting a new account list.
Diffstat (limited to 'noncore/net/mail/selectsmtp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/selectsmtp.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/net/mail/selectsmtp.cpp b/noncore/net/mail/selectsmtp.cpp index e82c6ca..79b10ef 100644 --- a/noncore/net/mail/selectsmtp.cpp +++ b/noncore/net/mail/selectsmtp.cpp | |||
@@ -36,21 +36,27 @@ void selectsmtp::slotAccountselected(int which) | |||
36 | { | 36 | { |
37 | if (!m_smtpList || (unsigned)which>=m_smtpList->count() || which < 0) { | 37 | if (!m_smtpList || (unsigned)which>=m_smtpList->count() || which < 0) { |
38 | m_current_smtp = 0; | 38 | m_current_smtp = 0; |
39 | return; | 39 | return; |
40 | } | 40 | } |
41 | m_current_smtp = m_smtpList->at(which); | 41 | m_current_smtp = m_smtpList->at(which); |
42 | } | 42 | } |
43 | 43 | ||
44 | void selectsmtp::setSelectionlist(QList<SMTPaccount>*list) | 44 | void selectsmtp::setSelectionlist(QList<SMTPaccount>*list) |
45 | { | 45 | { |
46 | m_smtpList = list; | 46 | m_smtpList = list; |
47 | accountSelection->clear(); | 47 | accountSelection->clear(); |
48 | if (!m_smtpList || m_smtpList->count()==0) { | ||
49 | accountSelection->setEnabled(false); | ||
50 | return; | ||
51 | } | ||
52 | accountSelection->setEnabled(true); | ||
48 | for (unsigned i = 0; m_smtpList!=0 && i < m_smtpList->count(); ++i) { | 53 | for (unsigned i = 0; m_smtpList!=0 && i < m_smtpList->count(); ++i) { |
49 | accountSelection->insertItem( m_smtpList->at(i)->getAccountName()); | 54 | accountSelection->insertItem( m_smtpList->at(i)->getAccountName()); |
50 | } | 55 | } |
56 | m_current_smtp = m_smtpList->at(0); | ||
51 | } | 57 | } |
52 | 58 | ||
53 | SMTPaccount*selectsmtp::selected_smtp() | 59 | SMTPaccount*selectsmtp::selected_smtp() |
54 | { | 60 | { |
55 | return m_current_smtp; | 61 | return m_current_smtp; |
56 | } | 62 | } |