Diffstat (limited to 'noncore/net/mail/accountview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index df9fc11..6963027 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -1,8 +1,45 @@ | |||
1 | #include "accountview.h" | 1 | #include "accountview.h" |
2 | #include "imapwrapper.h" | 2 | #include "imapwrapper.h" |
3 | #include "pop3wrapper.h" | ||
3 | #include "mailtypes.h" | 4 | #include "mailtypes.h" |
4 | #include "defines.h" | 5 | #include "defines.h" |
5 | 6 | ||
7 | |||
8 | /** | ||
9 | * POP3 Account stuff | ||
10 | */ | ||
11 | |||
12 | POP3viewItem::POP3viewItem( POP3account *a, QListView *parent ) | ||
13 | : AccountViewItem( parent ) | ||
14 | { | ||
15 | account = a; | ||
16 | wrapper = new POP3wrapper( account ); | ||
17 | setPixmap( 0, PIXMAP_POP3FOLDER ); | ||
18 | setText( 0, account->getAccountName() ); | ||
19 | } | ||
20 | |||
21 | POP3viewItem::~POP3viewItem() | ||
22 | { | ||
23 | delete wrapper; | ||
24 | } | ||
25 | |||
26 | void POP3viewItem::refresh( QList<RecMail> &target ) | ||
27 | { | ||
28 | qDebug( "POP3: refresh" ); | ||
29 | wrapper->listMessages( target ); | ||
30 | } | ||
31 | |||
32 | |||
33 | RecBody POP3viewItem::fetchBody( const RecMail & ) | ||
34 | { | ||
35 | qDebug( "POP3 fetchBody: IMPLEMENT ME!!" ); | ||
36 | return RecBody(); | ||
37 | } | ||
38 | |||
39 | /** | ||
40 | * IMAP Account stuff | ||
41 | */ | ||
42 | |||
6 | IMAPviewItem::IMAPviewItem( IMAPaccount *a, QListView *parent ) | 43 | IMAPviewItem::IMAPviewItem( IMAPaccount *a, QListView *parent ) |
7 | : AccountViewItem( parent ) | 44 | : AccountViewItem( parent ) |
8 | { | 45 | { |
@@ -69,6 +106,10 @@ RecBody IMAPfolderItem::fetchBody(const RecMail&aMail) | |||
69 | return imap->getWrapper()->fetchBody(aMail); | 106 | return imap->getWrapper()->fetchBody(aMail); |
70 | } | 107 | } |
71 | 108 | ||
109 | /** | ||
110 | * Generic stuff | ||
111 | */ | ||
112 | |||
72 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) | 113 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) |
73 | : QListView( parent, name, flags ) | 114 | : QListView( parent, name, flags ) |
74 | { | 115 | { |
@@ -86,6 +127,10 @@ void AccountView::populate( QList<Account> list ) | |||
86 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); | 127 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); |
87 | qDebug( "added IMAP " + imap->getAccountName() ); | 128 | qDebug( "added IMAP " + imap->getAccountName() ); |
88 | (void) new IMAPviewItem( imap, this ); | 129 | (void) new IMAPviewItem( imap, this ); |
130 | } else if ( it->getType().compare( "POP3" ) == 0 ) { | ||
131 | POP3account *pop3 = static_cast<POP3account *>(it); | ||
132 | qDebug( "added POP3 " + pop3->getAccountName() ); | ||
133 | (void) new POP3viewItem( pop3, this ); | ||
89 | } | 134 | } |
90 | } | 135 | } |
91 | } | 136 | } |