-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.h | 1 |
2 files changed, 2 insertions, 5 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index c410829..2b5870a 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -156,14 +156,12 @@ void MainWindow::refreshMailView(QList<RecMail>*list) | |||
156 | item->showEntry(); | 156 | item->showEntry(); |
157 | } | 157 | } |
158 | } | 158 | } |
159 | void MainWindow::displayMail(QListViewItem*item) | 159 | void MainWindow::displayMail(QListViewItem*item) |
160 | { | 160 | { |
161 | 161 | ||
162 | m_currentItem = item; | ||
163 | |||
164 | if (!item) return; | 162 | if (!item) return; |
165 | RecMail mail = ((MailListViewItem*)item)->data(); | 163 | RecMail mail = ((MailListViewItem*)item)->data(); |
166 | RecBody body = folderView->fetchBody(mail); | 164 | RecBody body = folderView->fetchBody(mail); |
167 | 165 | ||
168 | ViewMail readMail( this ); | 166 | ViewMail readMail( this ); |
169 | readMail.setBody( body ); | 167 | readMail.setBody( body ); |
@@ -177,14 +175,14 @@ void MainWindow::displayMail(QListViewItem*item) | |||
177 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") ); | 175 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") ); |
178 | } | 176 | } |
179 | } | 177 | } |
180 | 178 | ||
181 | void MainWindow::slotDeleteMail() | 179 | void MainWindow::slotDeleteMail() |
182 | { | 180 | { |
183 | if (!m_currentItem) return; | 181 | if (!mailView->currentItem()) return; |
184 | RecMail mail = ((MailListViewItem*)m_currentItem)->data(); | 182 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
185 | mail.Wrapper()->deleteMail( mail ); | 183 | mail.Wrapper()->deleteMail( mail ); |
186 | folderView->refreshCurrent(); | 184 | folderView->refreshCurrent(); |
187 | } | 185 | } |
188 | 186 | ||
189 | 187 | ||
190 | 188 | ||
diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h index 8641510..21af190 100644 --- a/noncore/net/mail/mainwindow.h +++ b/noncore/net/mail/mainwindow.h | |||
@@ -34,11 +34,10 @@ protected: | |||
34 | QMenuBar *menuBar; | 34 | QMenuBar *menuBar; |
35 | QPopupMenu *mailMenu, *settingsMenu; | 35 | QPopupMenu *mailMenu, *settingsMenu; |
36 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, | 36 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, |
37 | *editSettings, *editAccounts, *syncFolders; | 37 | *editSettings, *editAccounts, *syncFolders; |
38 | AccountView *folderView; | 38 | AccountView *folderView; |
39 | QListView *mailView; | 39 | QListView *mailView; |
40 | QListViewItem* m_currentItem; | ||
41 | QBoxLayout *layout; | 40 | QBoxLayout *layout; |
42 | }; | 41 | }; |
43 | 42 | ||
44 | #endif | 43 | #endif |