Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 7 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.cpp | 11 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.h | 7 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 2 |
4 files changed, 18 insertions, 9 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 | |||
@@ -165,6 +165,7 @@ QList<Folder>* IMAPwrapper::listFolders() | |||
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-- ) { |
@@ -172,7 +173,8 @@ QList<Folder>* IMAPwrapper::listFolders() | |||
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 { |
@@ -206,7 +208,8 @@ QList<Folder>* IMAPwrapper::listFolders() | |||
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); |
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp index 96602c2..858283f 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp | |||
@@ -17,7 +17,7 @@ Attachment::Attachment( DocLnk lnk ) | |||
17 | size = QFileInfo( doc.file() ).size(); | 17 | size = QFileInfo( doc.file() ).size(); |
18 | } | 18 | } |
19 | 19 | ||
20 | Folder::Folder(const QString&tmp_name ) | 20 | Folder::Folder(const QString&tmp_name, const QString&sep ) |
21 | { | 21 | { |
22 | name = tmp_name; | 22 | name = tmp_name; |
23 | nameDisplay = name; | 23 | nameDisplay = name; |
@@ -35,11 +35,16 @@ Folder::Folder(const QString&tmp_name ) | |||
35 | } | 35 | } |
36 | } | 36 | } |
37 | qDebug( "folder " + name + " - displayed as " + nameDisplay ); | 37 | qDebug( "folder " + name + " - displayed as " + nameDisplay ); |
38 | separator = sep; | ||
38 | } | 39 | } |
39 | 40 | ||
41 | const QString& Folder::Separator()const | ||
42 | { | ||
43 | return separator; | ||
44 | } | ||
40 | 45 | ||
41 | IMAPFolder::IMAPFolder(const QString&name,bool select,const QString&prefix ) | 46 | IMAPFolder::IMAPFolder(const QString&name,const QString&sep, bool select,const QString&prefix ) |
42 | : Folder( name ),m_MaySelect(select) | 47 | : Folder( name,sep ),m_MaySelect(select) |
43 | { | 48 | { |
44 | if (prefix.length()>0) { | 49 | if (prefix.length()>0) { |
45 | if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) { | 50 | if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) { |
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.h b/noncore/net/mail/libmailwrapper/mailwrapper.h index 6994dd8..d78f8e9 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.h +++ b/noncore/net/mail/libmailwrapper/mailwrapper.h | |||
@@ -71,20 +71,21 @@ class Folder : public QObject | |||
71 | Q_OBJECT | 71 | Q_OBJECT |
72 | 72 | ||
73 | public: | 73 | public: |
74 | Folder( const QString&init_name ); | 74 | Folder( const QString&init_name,const QString&sep ); |
75 | const QString&getDisplayName()const { return nameDisplay; } | 75 | const QString&getDisplayName()const { return nameDisplay; } |
76 | const QString&getName()const { return name; } | 76 | const QString&getName()const { return name; } |
77 | virtual bool may_select()const{return true;}; | 77 | virtual bool may_select()const{return true;}; |
78 | const QString&Separator()const; | ||
78 | 79 | ||
79 | protected: | 80 | protected: |
80 | QString nameDisplay, name; | 81 | QString nameDisplay, name, separator; |
81 | 82 | ||
82 | }; | 83 | }; |
83 | 84 | ||
84 | class IMAPFolder : public Folder | 85 | class IMAPFolder : public Folder |
85 | { | 86 | { |
86 | public: | 87 | public: |
87 | IMAPFolder(const QString&name,bool select=true,const QString&prefix="" ); | 88 | IMAPFolder(const QString&name, const QString&sep, bool select=true,const QString&prefix="" ); |
88 | virtual bool may_select()const{return m_MaySelect;} | 89 | virtual bool may_select()const{return m_MaySelect;} |
89 | private: | 90 | private: |
90 | bool m_MaySelect; | 91 | bool m_MaySelect; |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 075d8c7..4508a95 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -323,7 +323,7 @@ QList<Folder>* POP3wrapper::listFolders() | |||
323 | */ | 323 | */ |
324 | QList<Folder> * folders = new QList<Folder>(); | 324 | QList<Folder> * folders = new QList<Folder>(); |
325 | folders->setAutoDelete( false ); | 325 | folders->setAutoDelete( false ); |
326 | Folder*inb=new Folder("INBOX"); | 326 | Folder*inb=new Folder("INBOX","/"); |
327 | folders->append(inb); | 327 | folders->append(inb); |
328 | return folders; | 328 | return folders; |
329 | } | 329 | } |