summaryrefslogtreecommitdiff
path: root/noncore/net/mail/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mainwindow.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 8ef7ddd..c410829 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -62,2 +62,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
62 62
63 deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this);
64 deleteMails->addTo( toolBar );
65 deleteMails->addTo( mailMenu );
66 connect( deleteMails, SIGNAL( activated() ),
67 SLOT( slotDeleteMail() ) );
63 68
@@ -100,3 +105,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
100 105
101 connect(folderView,SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); 106 connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*)));
102 107
@@ -133,3 +138,3 @@ void MainWindow::slotShowFolders( bool show )
133{ 138{
134 qDebug( "Show Folders" ); 139 qDebug( "Show Folders" );
135 if ( show && folderView->isHidden() ) { 140 if ( show && folderView->isHidden() ) {
@@ -155,2 +160,5 @@ void MainWindow::displayMail(QListViewItem*item)
155{ 160{
161
162 m_currentItem = item;
163
156 if (!item) return; 164 if (!item) return;
@@ -164,5 +172,20 @@ void MainWindow::displayMail(QListViewItem*item)
164 readMail.exec(); 172 readMail.exec();
165 ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") ); 173
174 if ( readMail.deleted ) {
175 folderView->refreshCurrent();
176 } else {
177 ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") );
178 }
166} 179}
167 180
181void MainWindow::slotDeleteMail()
182{
183 if (!m_currentItem) return;
184 RecMail mail = ((MailListViewItem*)m_currentItem)->data();
185 mail.Wrapper()->deleteMail( mail );
186 folderView->refreshCurrent();
187}
188
189
190
168MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) 191MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item )