author | alwin <alwin> | 2003-12-14 19:36:09 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-14 19:36:09 (UTC) |
commit | aa2c19611a347a3945d403e20bcef01977d68b6a (patch) (side-by-side diff) | |
tree | 669bf39c587f9ee22e17fe2c61ed0fec78f356d3 | |
parent | 353e1da81b235d7798763bce76428fb473108fb6 (diff) | |
download | opie-aa2c19611a347a3945d403e20bcef01977d68b6a.zip opie-aa2c19611a347a3945d403e20bcef01977d68b6a.tar.gz opie-aa2c19611a347a3945d403e20bcef01977d68b6a.tar.bz2 |
if a mailbox-prefix is set than it will not displayed in folderview
-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.h | 4 | ||||
-rw-r--r-- | noncore/net/mail/mailwrapper.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/mailwrapper.h | 4 |
6 files changed, 32 insertions, 8 deletions
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp index b253b49..0ce2c6c 100644 --- a/noncore/net/mail/imapwrapper.cpp +++ b/noncore/net/mail/imapwrapper.cpp @@ -202,2 +202,4 @@ QList<Folder>* IMAPwrapper::listFolders() continue; + if (temp.lower()==account->getPrefix().lower()) + continue; if ( (bflags = list->mb_flag) ) { @@ -206,3 +208,3 @@ QList<Folder>* IMAPwrapper::listFolders() } - folders->append(new IMAPFolder(temp,selectable)); + folders->append(new IMAPFolder(temp,selectable,account->getPrefix())); } diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index b253b49..0ce2c6c 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp @@ -202,2 +202,4 @@ QList<Folder>* IMAPwrapper::listFolders() continue; + if (temp.lower()==account->getPrefix().lower()) + continue; if ( (bflags = list->mb_flag) ) { @@ -206,3 +208,3 @@ QList<Folder>* IMAPwrapper::listFolders() } - folders->append(new IMAPFolder(temp,selectable)); + folders->append(new IMAPFolder(temp,selectable,account->getPrefix())); } diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp index 3ffc274..96602c2 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp @@ -36,3 +36,2 @@ Folder::Folder(const QString&tmp_name ) } - qDebug( "folder " + name + " - displayed as " + nameDisplay ); @@ -40,2 +39,13 @@ Folder::Folder(const QString&tmp_name ) + +IMAPFolder::IMAPFolder(const QString&name,bool select,const QString&prefix ) + : Folder( name ),m_MaySelect(select) +{ + if (prefix.length()>0) { + if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) { + nameDisplay=nameDisplay.right(nameDisplay.length()-prefix.length()); + } + } +} + MailWrapper::MailWrapper( Settings *s ) diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.h b/noncore/net/mail/libmailwrapper/mailwrapper.h index 34fd5c5..6994dd8 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.h +++ b/noncore/net/mail/libmailwrapper/mailwrapper.h @@ -78,3 +78,3 @@ public: -private: +protected: QString nameDisplay, name; @@ -86,3 +86,3 @@ class IMAPFolder : public Folder public: - IMAPFolder( QString name,bool select=true ) : Folder( name ),m_MaySelect(select) {} + IMAPFolder(const QString&name,bool select=true,const QString&prefix="" ); virtual bool may_select()const{return m_MaySelect;} diff --git a/noncore/net/mail/mailwrapper.cpp b/noncore/net/mail/mailwrapper.cpp index 3ffc274..96602c2 100644 --- a/noncore/net/mail/mailwrapper.cpp +++ b/noncore/net/mail/mailwrapper.cpp @@ -36,3 +36,2 @@ Folder::Folder(const QString&tmp_name ) } - qDebug( "folder " + name + " - displayed as " + nameDisplay ); @@ -40,2 +39,13 @@ Folder::Folder(const QString&tmp_name ) + +IMAPFolder::IMAPFolder(const QString&name,bool select,const QString&prefix ) + : Folder( name ),m_MaySelect(select) +{ + if (prefix.length()>0) { + if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) { + nameDisplay=nameDisplay.right(nameDisplay.length()-prefix.length()); + } + } +} + MailWrapper::MailWrapper( Settings *s ) diff --git a/noncore/net/mail/mailwrapper.h b/noncore/net/mail/mailwrapper.h index 34fd5c5..6994dd8 100644 --- a/noncore/net/mail/mailwrapper.h +++ b/noncore/net/mail/mailwrapper.h @@ -78,3 +78,3 @@ public: -private: +protected: QString nameDisplay, name; @@ -86,3 +86,3 @@ class IMAPFolder : public Folder public: - IMAPFolder( QString name,bool select=true ) : Folder( name ),m_MaySelect(select) {} + IMAPFolder(const QString&name,bool select=true,const QString&prefix="" ); virtual bool may_select()const{return m_MaySelect;} |