Diffstat (limited to 'noncore/net/mail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index d56d7f9..8a86c95 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -156,32 +156,34 @@ QList<Folder>* IMAPwrapper::listFolders() | |||
156 | } | 156 | } |
157 | 157 | ||
158 | /* | 158 | /* |
159 | * First we have to check for INBOX 'cause it sometimes it's not inside the path. | 159 | * First we have to check for INBOX 'cause it sometimes it's not inside the path. |
160 | * We must not forget to filter them out in next loop! | 160 | * We must not forget to filter them out in next loop! |
161 | * it seems like ugly code. and yes - it is ugly code. but the best way. | 161 | * it seems like ugly code. and yes - it is ugly code. but the best way. |
162 | */ | 162 | */ |
163 | QString temp; | 163 | QString temp; |
164 | mask = "INBOX" ; | 164 | mask = "INBOX" ; |
165 | result = clist_new(); | 165 | result = clist_new(); |
166 | mailimap_mailbox_list *list; | 166 | mailimap_mailbox_list *list; |
167 | err = mailimap_list( m_imap, (char*)"", (char*)mask, &result ); | 167 | err = mailimap_list( m_imap, (char*)"", (char*)mask, &result ); |
168 | QString del; | ||
168 | if ( err == MAILIMAP_NO_ERROR ) { | 169 | if ( err == MAILIMAP_NO_ERROR ) { |
169 | current = result->first; | 170 | current = result->first; |
170 | for ( int i = result->count; i > 0; i-- ) { | 171 | for ( int i = result->count; i > 0; i-- ) { |
171 | list = (mailimap_mailbox_list *) current->data; | 172 | list = (mailimap_mailbox_list *) current->data; |
172 | // it is better use the deep copy mechanism of qt itself | 173 | // it is better use the deep copy mechanism of qt itself |
173 | // instead of using strdup! | 174 | // instead of using strdup! |
174 | temp = list->mb_name; | 175 | temp = list->mb_name; |
175 | folders->append( new IMAPFolder(temp)); | 176 | del = list->mb_delimiter; |
177 | folders->append( new IMAPFolder(temp,del,true,account->getPrefix())); | ||
176 | current = current->next; | 178 | current = current->next; |
177 | } | 179 | } |
178 | } else { | 180 | } else { |
179 | qDebug("error fetching folders: %s",m_imap->imap_response); | 181 | qDebug("error fetching folders: %s",m_imap->imap_response); |
180 | } | 182 | } |
181 | mailimap_list_result_free( result ); | 183 | mailimap_list_result_free( result ); |
182 | 184 | ||
183 | /* | 185 | /* |
184 | * second stage - get the other then inbox folders | 186 | * second stage - get the other then inbox folders |
185 | */ | 187 | */ |
186 | mask = "*" ; | 188 | mask = "*" ; |
187 | path = account->getPrefix().latin1(); | 189 | path = account->getPrefix().latin1(); |
@@ -197,25 +199,26 @@ QList<Folder>* IMAPwrapper::listFolders() | |||
197 | list = (mailimap_mailbox_list *) current->data; | 199 | list = (mailimap_mailbox_list *) current->data; |
198 | // it is better use the deep copy mechanism of qt itself | 200 | // it is better use the deep copy mechanism of qt itself |
199 | // instead of using strdup! | 201 | // instead of using strdup! |
200 | temp = list->mb_name; | 202 | temp = list->mb_name; |
201 | if (temp.lower()=="inbox") | 203 | if (temp.lower()=="inbox") |
202 | continue; | 204 | continue; |
203 | if (temp.lower()==account->getPrefix().lower()) | 205 | if (temp.lower()==account->getPrefix().lower()) |
204 | continue; | 206 | continue; |
205 | if ( (bflags = list->mb_flag) ) { | 207 | if ( (bflags = list->mb_flag) ) { |
206 | selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& | 208 | selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& |
207 | bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); | 209 | bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); |
208 | } | 210 | } |
209 | folders->append(new IMAPFolder(temp,selectable,account->getPrefix())); | 211 | del = list->mb_delimiter; |
212 | folders->append(new IMAPFolder(temp,del,selectable,account->getPrefix())); | ||
210 | } | 213 | } |
211 | } else { | 214 | } else { |
212 | qDebug("error fetching folders %s",m_imap->imap_response); | 215 | qDebug("error fetching folders %s",m_imap->imap_response); |
213 | } | 216 | } |
214 | mailimap_list_result_free( result ); | 217 | mailimap_list_result_free( result ); |
215 | return folders; | 218 | return folders; |
216 | } | 219 | } |
217 | 220 | ||
218 | RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | 221 | RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) |
219 | { | 222 | { |
220 | RecMail * m = 0; | 223 | RecMail * m = 0; |
221 | mailimap_msg_att_item *item=0; | 224 | mailimap_msg_att_item *item=0; |