author | harlekin <harlekin> | 2003-12-14 00:20:38 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-14 00:20:38 (UTC) |
commit | ff2b84787e454f8a11aaef7a4ce18941ac0d28fd (patch) (unidiff) | |
tree | 44bf51f9a3935542cdcfa5dafcc212e4f01ee8ce /noncore/net/mail/accountview.cpp | |
parent | b0a71314013a3367767526b68928a7168b4ad460 (diff) | |
download | opie-ff2b84787e454f8a11aaef7a4ce18941ac0d28fd.zip opie-ff2b84787e454f8a11aaef7a4ce18941ac0d28fd.tar.gz opie-ff2b84787e454f8a11aaef7a4ce18941ac0d28fd.tar.bz2 |
deleting of mails working
Diffstat (limited to 'noncore/net/mail/accountview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index 1069b9f..ac4f0e0 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -60,16 +60,16 @@ AbstractMail *IMAPviewItem::getWrapper() | |||
60 | 60 | ||
61 | void IMAPviewItem::refresh(QList<RecMail>&) | 61 | void IMAPviewItem::refresh(QList<RecMail>&) |
62 | { | 62 | { |
63 | QList<Folder> *folders = wrapper->listFolders(); | 63 | QList<Folder> *folders = wrapper->listFolders(); |
64 | 64 | ||
65 | QListViewItem *child = firstChild(); | 65 | QListViewItem *child = firstChild(); |
66 | while ( child ) { | 66 | while ( child ) { |
67 | QListViewItem *tmp = child; | 67 | QListViewItem *tmp = child; |
68 | child = child->nextSibling(); | 68 | child = child->nextSibling(); |
69 | delete tmp; | 69 | delete tmp; |
70 | } | 70 | } |
71 | 71 | ||
72 | Folder *it; | 72 | Folder *it; |
73 | for ( it = folders->first(); it; it = folders->next() ) { | 73 | for ( it = folders->first(); it; it = folders->next() ) { |
74 | (void) new IMAPfolderItem( it, this ); | 74 | (void) new IMAPfolderItem( it, this ); |
75 | } | 75 | } |
@@ -79,9 +79,9 @@ RecBody IMAPviewItem::fetchBody(const RecMail&) | |||
79 | { | 79 | { |
80 | return RecBody(); | 80 | return RecBody(); |
81 | } | 81 | } |
82 | 82 | ||
83 | IMAPfolderItem::~IMAPfolderItem() | 83 | IMAPfolderItem::~IMAPfolderItem() |
84 | { | 84 | { |
85 | delete folder; | 85 | delete folder; |
86 | } | 86 | } |
87 | 87 | ||
@@ -93,9 +93,9 @@ IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent ) | |||
93 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 93 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
94 | setText( 0, folder->getDisplayName() ); | 94 | setText( 0, folder->getDisplayName() ); |
95 | } | 95 | } |
96 | 96 | ||
97 | void IMAPfolderItem::refresh(QList<RecMail>&target) | 97 | void IMAPfolderItem::refresh(QList<RecMail>&target) |
98 | { | 98 | { |
99 | imap->getWrapper()->listMessages( folder->getName(),target ); | 99 | imap->getWrapper()->listMessages( folder->getName(),target ); |
100 | } | 100 | } |
101 | 101 | ||
@@ -117,9 +117,9 @@ AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) | |||
117 | 117 | ||
118 | void AccountView::populate( QList<Account> list ) | 118 | void AccountView::populate( QList<Account> list ) |
119 | { | 119 | { |
120 | clear(); | 120 | clear(); |
121 | 121 | ||
122 | Account *it; | 122 | Account *it; |
123 | for ( it = list.first(); it; it = list.next() ) { | 123 | for ( it = list.first(); it; it = list.next() ) { |
124 | if ( it->getType().compare( "IMAP" ) == 0 ) { | 124 | if ( it->getType().compare( "IMAP" ) == 0 ) { |
125 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); | 125 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); |
@@ -133,21 +133,33 @@ void AccountView::populate( QList<Account> list ) | |||
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | void AccountView::refresh(QListViewItem *item) { | 136 | void AccountView::refresh(QListViewItem *item) { |
137 | |||
137 | qDebug("AccountView refresh..."); | 138 | qDebug("AccountView refresh..."); |
138 | if ( item ) { | 139 | if ( item ) { |
140 | m_currentItem = item; | ||
139 | QList<RecMail> headerlist; | 141 | QList<RecMail> headerlist; |
140 | headerlist.setAutoDelete(true); | 142 | headerlist.setAutoDelete(true); |
141 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 143 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
142 | view->refresh(headerlist); | 144 | view->refresh(headerlist); |
143 | emit refreshMailview(&headerlist); | 145 | emit refreshMailview(&headerlist); |
144 | } | 146 | } |
145 | } | 147 | } |
146 | 148 | ||
149 | void AccountView::refreshCurrent() | ||
150 | { | ||
151 | if ( !m_currentItem ) return; | ||
152 | QList<RecMail> headerlist; | ||
153 | headerlist.setAutoDelete(true); | ||
154 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | ||
155 | view->refresh(headerlist); | ||
156 | emit refreshMailview(&headerlist); | ||
157 | } | ||
158 | |||
147 | void AccountView::refreshAll() | 159 | void AccountView::refreshAll() |
148 | { | 160 | { |
149 | 161 | ||
150 | } | 162 | } |
151 | 163 | ||
152 | RecBody AccountView::fetchBody(const RecMail&aMail) | 164 | RecBody AccountView::fetchBody(const RecMail&aMail) |
153 | { | 165 | { |