Diffstat (limited to 'noncore/net/mail/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp index 9ee0dff..912a412 100644 --- a/noncore/net/mail/imapwrapper.cpp +++ b/noncore/net/mail/imapwrapper.cpp | |||
@@ -150,5 +150,5 @@ QList<Folder>* IMAPwrapper::listFolders() | |||
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) { |
@@ -189,17 +189,21 @@ QList<Folder>* IMAPwrapper::listFolders() | |||
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 { |