-rw-r--r-- | kmicromail/accountview.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index c9c4a0f..3ad3e9b 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp | |||
@@ -77,48 +77,66 @@ void AccountView::populate( QList<Account> list ) | |||
77 | POP3account *pop3 = static_cast<POP3account *>(it); | 77 | POP3account *pop3 = static_cast<POP3account *>(it); |
78 | /* must not be hold 'cause it isn't required */ | 78 | /* must not be hold 'cause it isn't required */ |
79 | (void) new POP3viewItem( pop3, this ); | 79 | (void) new POP3viewItem( pop3, this ); |
80 | } | 80 | } |
81 | else if ( it->getType() == MAILLIB::A_NNTP ) | 81 | else if ( it->getType() == MAILLIB::A_NNTP ) |
82 | { | 82 | { |
83 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); | 83 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); |
84 | /* must not be hold 'cause it isn't required */ | 84 | /* must not be hold 'cause it isn't required */ |
85 | (void) new NNTPviewItem( nntp, this ); | 85 | (void) new NNTPviewItem( nntp, this ); |
86 | } | 86 | } |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | void AccountView::refresh(QListViewItem *item) | 90 | void AccountView::refresh(QListViewItem *item) |
91 | { | 91 | { |
92 | if ( item ) | 92 | if ( item ) |
93 | { | 93 | { |
94 | m_currentItem = item; | 94 | m_currentItem = item; |
95 | QValueList<RecMailP> headerlist; | 95 | QValueList<RecMailP> headerlist; |
96 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 96 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
97 | view->refresh(headerlist); | 97 | view->refresh(headerlist); |
98 | emit refreshMailview(headerlist); | 98 | emit refreshMailview(headerlist); |
99 | } | 99 | } |
100 | } | 100 | } |
101 | void AccountView::refreshOutgoing() | ||
102 | { | ||
103 | m_currentItem = currentItem(); | ||
104 | if ( !m_currentItem ) return; | ||
105 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | ||
106 | QString bName = view->getFolder()->getDisplayName(); | ||
107 | if (bName.startsWith("/")&&bName.length()>1) | ||
108 | { | ||
109 | bName.replace(0,1,""); | ||
110 | } | ||
111 | int pos = bName.findRev("/"); | ||
112 | if (pos > 0) | ||
113 | { | ||
114 | bName.replace(0,pos+1,""); | ||
115 | } | ||
116 | if ( bName.lower() == "outgoing" ) | ||
117 | refreshCurrent(); | ||
118 | } | ||
101 | 119 | ||
102 | void AccountView::refreshCurrent() | 120 | void AccountView::refreshCurrent() |
103 | { | 121 | { |
104 | m_currentItem = currentItem(); | 122 | m_currentItem = currentItem(); |
105 | if ( !m_currentItem ) return; | 123 | if ( !m_currentItem ) return; |
106 | QValueList<RecMailP> headerlist; | 124 | QValueList<RecMailP> headerlist; |
107 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | 125 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); |
108 | view->refresh(headerlist); | 126 | view->refresh(headerlist); |
109 | emit refreshMailview(headerlist); | 127 | emit refreshMailview(headerlist); |
110 | } | 128 | } |
111 | 129 | ||
112 | void AccountView::refreshAll() | 130 | void AccountView::refreshAll() |
113 | { | 131 | { |
114 | } | 132 | } |
115 | 133 | ||
116 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) | 134 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) |
117 | { | 135 | { |
118 | QListViewItem*item = selectedItem (); | 136 | QListViewItem*item = selectedItem (); |
119 | if (!item) return new RecBody(); | 137 | if (!item) return new RecBody(); |
120 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 138 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
121 | return view->fetchBody(aMail); | 139 | return view->fetchBody(aMail); |
122 | } | 140 | } |
123 | 141 | ||
124 | void AccountView::setupFolderselect(Selectstore*sels) | 142 | void AccountView::setupFolderselect(Selectstore*sels) |