Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 14 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 9ee0dff..912a412 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -149,7 +149,7 @@ QList<Folder>* IMAPwrapper::listFolders() | |||
149 | clistcell *current; | 149 | clistcell *current; |
150 | 150 | ||
151 | QList<Folder> * folders = new QList<Folder>(); | 151 | QList<Folder> * folders = new QList<Folder>(); |
152 | folders->setAutoDelete( true ); | 152 | folders->setAutoDelete( false ); |
153 | login(); | 153 | login(); |
154 | if (!m_imap) { | 154 | if (!m_imap) { |
155 | return folders; | 155 | return folders; |
@@ -188,19 +188,23 @@ QList<Folder>* IMAPwrapper::listFolders() | |||
188 | if (!path) path = ""; | 188 | if (!path) path = ""; |
189 | result = clist_new(); | 189 | result = clist_new(); |
190 | qDebug(path); | 190 | qDebug(path); |
191 | bool selectable = true; | ||
192 | mailimap_mbx_list_flags*bflags; | ||
191 | err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); | 193 | err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); |
192 | if ( err == MAILIMAP_NO_ERROR ) { | 194 | if ( err == MAILIMAP_NO_ERROR ) { |
193 | current = result->first; | 195 | current = result->first; |
194 | for ( int i = result->count; i > 0; i-- ) { | 196 | for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { |
195 | list = (mailimap_mailbox_list *) current->data; | 197 | list = (mailimap_mailbox_list *) current->data; |
196 | // it is better use the deep copy mechanism of qt itself | 198 | // it is better use the deep copy mechanism of qt itself |
197 | // instead of using strdup! | 199 | // instead of using strdup! |
198 | temp = list->mb_name; | 200 | temp = list->mb_name; |
199 | current = current->next; | ||
200 | if (temp.lower()=="inbox") | 201 | if (temp.lower()=="inbox") |
201 | continue; | 202 | continue; |
202 | folders->append(new IMAPFolder(temp)); | 203 | if ( (bflags = list->mb_flag) ) { |
203 | 204 | selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& | |
205 | bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); | ||
206 | } | ||
207 | folders->append(new IMAPFolder(temp,selectable)); | ||
204 | } | 208 | } |
205 | } else { | 209 | } else { |
206 | qDebug("error fetching folders %s",m_imap->imap_response); | 210 | qDebug("error fetching folders %s",m_imap->imap_response); |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 62523bf..5065d29 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -273,7 +273,7 @@ void POP3wrapper::logout() | |||
273 | QList<Folder>* POP3wrapper::listFolders() | 273 | QList<Folder>* POP3wrapper::listFolders() |
274 | { | 274 | { |
275 | QList<Folder> * folders = new QList<Folder>(); | 275 | QList<Folder> * folders = new QList<Folder>(); |
276 | folders->setAutoDelete( true ); | 276 | folders->setAutoDelete( false ); |
277 | Folder*inb=new Folder("INBOX"); | 277 | Folder*inb=new Folder("INBOX"); |
278 | folders->append(inb); | 278 | folders->append(inb); |
279 | return folders; | 279 | return folders; |