author | alwin <alwin> | 2003-12-13 20:39:07 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-13 20:39:07 (UTC) |
commit | 85444223acfafd9d7955032b2cbdad3279ba27ad (patch) (unidiff) | |
tree | 444063490a58ffc7ca085219827a577ad6213442 /noncore/net/mail/imapwrapper.cpp | |
parent | d161cb46c21ae6a9e9f74dc60fb6ac6ac8e62f1b (diff) | |
download | opie-85444223acfafd9d7955032b2cbdad3279ba27ad.zip opie-85444223acfafd9d7955032b2cbdad3279ba27ad.tar.gz opie-85444223acfafd9d7955032b2cbdad3279ba27ad.tar.bz2 |
imap/pop3 wrapper uses base virtual class so we can forward the pointer
independend of its later use.
ToDo: find a more general interface for it
Diffstat (limited to 'noncore/net/mail/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp index 48e476b..e5eb335 100644 --- a/noncore/net/mail/imapwrapper.cpp +++ b/noncore/net/mail/imapwrapper.cpp | |||
@@ -1,20 +1,21 @@ | |||
1 | 1 | ||
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | 3 | ||
4 | #include "imapwrapper.h" | 4 | #include "imapwrapper.h" |
5 | #include "mailtypes.h" | 5 | #include "mailtypes.h" |
6 | #include <libetpan/mailimap.h> | 6 | #include <libetpan/mailimap.h> |
7 | 7 | ||
8 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) | 8 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) |
9 | : AbstractMail() | ||
9 | { | 10 | { |
10 | account = a; | 11 | account = a; |
11 | m_imap = 0; | 12 | m_imap = 0; |
12 | } | 13 | } |
13 | 14 | ||
14 | IMAPwrapper::~IMAPwrapper() | 15 | IMAPwrapper::~IMAPwrapper() |
15 | { | 16 | { |
16 | logout(); | 17 | logout(); |
17 | } | 18 | } |
18 | 19 | ||
19 | void IMAPwrapper::imap_progress( size_t current, size_t maximum ) | 20 | void IMAPwrapper::imap_progress( size_t current, size_t maximum ) |
20 | { | 21 | { |
@@ -130,32 +131,32 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
130 | if (m) { | 131 | if (m) { |
131 | m->setNumber(i); | 132 | m->setNumber(i); |
132 | m->setMbox(mailbox); | 133 | m->setMbox(mailbox); |
133 | target.append(m); | 134 | target.append(m); |
134 | } | 135 | } |
135 | } | 136 | } |
136 | } else { | 137 | } else { |
137 | qDebug("Error fetching headers: %s",m_imap->imap_response); | 138 | qDebug("Error fetching headers: %s",m_imap->imap_response); |
138 | } | 139 | } |
139 | mailimap_fetch_list_free(result); | 140 | mailimap_fetch_list_free(result); |
140 | } | 141 | } |
141 | 142 | ||
142 | QList<IMAPFolder>* IMAPwrapper::listFolders() | 143 | QList<Folder>* IMAPwrapper::listFolders() |
143 | { | 144 | { |
144 | const char *path, *mask; | 145 | const char *path, *mask; |
145 | int err = MAILIMAP_NO_ERROR; | 146 | int err = MAILIMAP_NO_ERROR; |
146 | clist *result; | 147 | clist *result; |
147 | clistcell *current; | 148 | clistcell *current; |
148 | 149 | ||
149 | QList<IMAPFolder> * folders = new QList<IMAPFolder>(); | 150 | QList<Folder> * folders = new QList<Folder>(); |
150 | folders->setAutoDelete( true ); | 151 | folders->setAutoDelete( true ); |
151 | login(); | 152 | login(); |
152 | if (!m_imap) { | 153 | if (!m_imap) { |
153 | return folders; | 154 | return folders; |
154 | } | 155 | } |
155 | 156 | ||
156 | /* | 157 | /* |
157 | * First we have to check for INBOX 'cause it sometimes it's not inside the path. | 158 | * First we have to check for INBOX 'cause it sometimes it's not inside the path. |
158 | * We must not forget to filter them out in next loop! | 159 | * We must not forget to filter them out in next loop! |
159 | * it seems like ugly code. and yes - it is ugly code. but the best way. | 160 | * it seems like ugly code. and yes - it is ugly code. but the best way. |
160 | */ | 161 | */ |
161 | QString temp; | 162 | QString temp; |