summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-12-14 00:20:38 (UTC)
committer harlekin <harlekin>2003-12-14 00:20:38 (UTC)
commitff2b84787e454f8a11aaef7a4ce18941ac0d28fd (patch) (unidiff)
tree44bf51f9a3935542cdcfa5dafcc212e4f01ee8ce
parentb0a71314013a3367767526b68928a7168b4ad460 (diff)
downloadopie-ff2b84787e454f8a11aaef7a4ce18941ac0d28fd.zip
opie-ff2b84787e454f8a11aaef7a4ce18941ac0d28fd.tar.gz
opie-ff2b84787e454f8a11aaef7a4ce18941ac0d28fd.tar.bz2
deleting of mails working
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountview.cpp26
-rw-r--r--noncore/net/mail/accountview.h6
-rw-r--r--noncore/net/mail/mainwindow.cpp29
-rw-r--r--noncore/net/mail/mainwindow.h4
-rw-r--r--noncore/net/mail/viewmail.cpp8
-rw-r--r--noncore/net/mail/viewmail.h3
6 files changed, 64 insertions, 12 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
@@ -52,107 +52,119 @@ IMAPviewItem::~IMAPviewItem()
52{ 52{
53 delete wrapper; 53 delete wrapper;
54} 54}
55 55
56AbstractMail *IMAPviewItem::getWrapper() 56AbstractMail *IMAPviewItem::getWrapper()
57{ 57{
58 return wrapper; 58 return wrapper;
59} 59}
60 60
61void IMAPviewItem::refresh(QList<RecMail>&) 61void 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 }
76} 76}
77 77
78RecBody IMAPviewItem::fetchBody(const RecMail&) 78RecBody IMAPviewItem::fetchBody(const RecMail&)
79{ 79{
80 return RecBody(); 80 return RecBody();
81} 81}
82 82
83IMAPfolderItem::~IMAPfolderItem() 83IMAPfolderItem::~IMAPfolderItem()
84{ 84{
85 delete folder; 85 delete folder;
86} 86}
87 87
88IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent ) 88IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent )
89 : AccountViewItem( parent ) 89 : AccountViewItem( parent )
90{ 90{
91 folder = folderInit; 91 folder = folderInit;
92 imap = parent; 92 imap = 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
97void IMAPfolderItem::refresh(QList<RecMail>&target) 97void 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
102RecBody IMAPfolderItem::fetchBody(const RecMail&aMail) 102RecBody IMAPfolderItem::fetchBody(const RecMail&aMail)
103{ 103{
104 return imap->getWrapper()->fetchBody(aMail); 104 return imap->getWrapper()->fetchBody(aMail);
105} 105}
106 106
107/** 107/**
108 * Generic stuff 108 * Generic stuff
109 */ 109 */
110 110
111AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) 111AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
112 : QListView( parent, name, flags ) 112 : QListView( parent, name, flags )
113{ 113{
114 connect( this, SIGNAL( clicked( QListViewItem * ) ), 114 connect( this, SIGNAL( clicked( QListViewItem * ) ),
115 SLOT( refresh( QListViewItem * ) ) ); 115 SLOT( refresh( QListViewItem * ) ) );
116} 116}
117 117
118void AccountView::populate( QList<Account> list ) 118void 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);
126 qDebug( "added IMAP " + imap->getAccountName() ); 126 qDebug( "added IMAP " + imap->getAccountName() );
127 (void) new IMAPviewItem( imap, this ); 127 (void) new IMAPviewItem( imap, this );
128 } else if ( it->getType().compare( "POP3" ) == 0 ) { 128 } else if ( it->getType().compare( "POP3" ) == 0 ) {
129 POP3account *pop3 = static_cast<POP3account *>(it); 129 POP3account *pop3 = static_cast<POP3account *>(it);
130 qDebug( "added POP3 " + pop3->getAccountName() ); 130 qDebug( "added POP3 " + pop3->getAccountName() );
131 (void) new POP3viewItem( pop3, this ); 131 (void) new POP3viewItem( pop3, this );
132 } 132 }
133 } 133 }
134} 134}
135 135
136void AccountView::refresh(QListViewItem *item) { 136void 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
149void 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
147void AccountView::refreshAll() 159void AccountView::refreshAll()
148{ 160{
149 161
150} 162}
151 163
152RecBody AccountView::fetchBody(const RecMail&aMail) 164RecBody AccountView::fetchBody(const RecMail&aMail)
153{ 165{
154 QListViewItem*item = selectedItem (); 166 QListViewItem*item = selectedItem ();
155 if (!item) return RecBody(); 167 if (!item) return RecBody();
156 AccountViewItem *view = static_cast<AccountViewItem *>(item); 168 AccountViewItem *view = static_cast<AccountViewItem *>(item);
157 return view->fetchBody(aMail); 169 return view->fetchBody(aMail);
158} 170}
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h
index 83d49af..cdc87ce 100644
--- a/noncore/net/mail/accountview.h
+++ b/noncore/net/mail/accountview.h
@@ -68,18 +68,22 @@ private:
68class AccountView : public QListView 68class AccountView : public QListView
69{ 69{
70 Q_OBJECT 70 Q_OBJECT
71 71
72public: 72public:
73 AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); 73 AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
74 void populate( QList<Account> list ); 74 void populate( QList<Account> list );
75 RecBody fetchBody(const RecMail&aMail); 75 RecBody fetchBody(const RecMail&aMail);
76 76
77public slots: 77public slots:
78 void refreshAll(); 78 void refreshAll();
79 void refresh(QListViewItem *item); 79 void refresh(QListViewItem *item);
80 void refreshCurrent();
80 81
81signals: 82signals:
82 void refreshMailview(QList<RecMail>*); 83 void refreshMailview(QList<RecMail>*);
84
85private:
86 QListViewItem* m_currentItem;
83}; 87};
84 88
85#endif 89#endif
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
@@ -51,24 +51,29 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
51 showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, 51 showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS,
52 0, 0, this, 0, true ); 52 0, 0, this, 0, true );
53 showFolders->addTo( toolBar ); 53 showFolders->addTo( toolBar );
54 showFolders->addTo( mailMenu ); 54 showFolders->addTo( mailMenu );
55 connect(showFolders, SIGNAL( toggled( bool ) ), 55 connect(showFolders, SIGNAL( toggled( bool ) ),
56 SLOT( slotShowFolders( bool ) ) ); 56 SLOT( slotShowFolders( bool ) ) );
57 57
58 searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, 58 searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS,
59 0, 0, this ); 59 0, 0, this );
60 searchMails->addTo( toolBar ); 60 searchMails->addTo( toolBar );
61 searchMails->addTo( mailMenu ); 61 searchMails->addTo( mailMenu );
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
64 editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS, 69 editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS,
65 0, 0, this ); 70 0, 0, this );
66 editSettings->addTo( settingsMenu ); 71 editSettings->addTo( settingsMenu );
67 72
68 editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, 73 editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS,
69 0, 0, this ); 74 0, 0, this );
70 editAccounts->addTo( settingsMenu ); 75 editAccounts->addTo( settingsMenu );
71 76
72 QWidget *view = new QWidget( this ); 77 QWidget *view = new QWidget( this );
73 setCentralWidget( view ); 78 setCentralWidget( view );
74 79
@@ -89,25 +94,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
89 mailView->setAllColumnsShowFocus(true); 94 mailView->setAllColumnsShowFocus(true);
90 mailView->setSorting(-1); 95 mailView->setSorting(-1);
91 96
92 layout->addWidget( mailView ); 97 layout->addWidget( mailView );
93 layout->setStretchFactor( folderView, 1 ); 98 layout->setStretchFactor( folderView, 1 );
94 layout->setStretchFactor( mailView, 2 ); 99 layout->setStretchFactor( mailView, 2 );
95 100
96 slotAdjustLayout(); 101 slotAdjustLayout();
97 102
98 connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, 103 connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this,
99 SLOT( displayMail( QListViewItem * ) ) ); 104 SLOT( displayMail( QListViewItem * ) ) );
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
103 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); 108 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) );
104} 109}
105 110
106 111
107void MainWindow::slotAdjustLayout() { 112void MainWindow::slotAdjustLayout() {
108 113
109 QWidget *d = QApplication::desktop(); 114 QWidget *d = QApplication::desktop();
110 115
111 if ( d->width() < d->height() ) { 116 if ( d->width() < d->height() ) {
112 layout->setDirection( QBoxLayout::TopToBottom ); 117 layout->setDirection( QBoxLayout::TopToBottom );
113 } else { 118 } else {
@@ -122,58 +127,76 @@ void MainWindow::slotAdjustColumns()
122 if ( hidden ) folderView->show(); 127 if ( hidden ) folderView->show();
123 folderView->setColumnWidth( 0, folderView->visibleWidth() ); 128 folderView->setColumnWidth( 0, folderView->visibleWidth() );
124 if ( hidden ) folderView->hide(); 129 if ( hidden ) folderView->hide();
125 130
126 mailView->setColumnWidth( 0, 10 ); 131 mailView->setColumnWidth( 0, 10 );
127 mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); 132 mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 );
128 mailView->setColumnWidth( 2, 80 ); 133 mailView->setColumnWidth( 2, 80 );
129 mailView->setColumnWidth( 3, 50 ); 134 mailView->setColumnWidth( 3, 50 );
130} 135}
131 136
132void MainWindow::slotShowFolders( bool show ) 137void MainWindow::slotShowFolders( bool show )
133{ 138{
134 qDebug( "Show Folders" ); 139 qDebug( "Show Folders" );
135 if ( show && folderView->isHidden() ) { 140 if ( show && folderView->isHidden() ) {
136 qDebug( "-> showing" ); 141 qDebug( "-> showing" );
137 folderView->show(); 142 folderView->show();
138 } else if ( !show && !folderView->isHidden() ) { 143 } else if ( !show && !folderView->isHidden() ) {
139 qDebug( "-> hiding" ); 144 qDebug( "-> hiding" );
140 folderView->hide(); 145 folderView->hide();
141 } 146 }
142} 147}
143 148
144void MainWindow::refreshMailView(QList<RecMail>*list) 149void MainWindow::refreshMailView(QList<RecMail>*list)
145{ 150{
146 MailListViewItem*item = 0; 151 MailListViewItem*item = 0;
147 mailView->clear(); 152 mailView->clear();
148 for (unsigned int i = 0; i < list->count();++i) { 153 for (unsigned int i = 0; i < list->count();++i) {
149 item = new MailListViewItem(mailView,item); 154 item = new MailListViewItem(mailView,item);
150 item->storeData(*(list->at(i))); 155 item->storeData(*(list->at(i)));
151 item->showEntry(); 156 item->showEntry();
152 } 157 }
153} 158}
154void MainWindow::displayMail(QListViewItem*item) 159void MainWindow::displayMail(QListViewItem*item)
155{ 160{
161
162 m_currentItem = item;
163
156 if (!item) return; 164 if (!item) return;
157 RecMail mail = ((MailListViewItem*)item)->data(); 165 RecMail mail = ((MailListViewItem*)item)->data();
158 RecBody body = folderView->fetchBody(mail); 166 RecBody body = folderView->fetchBody(mail);
159 167
160 ViewMail readMail( this ); 168 ViewMail readMail( this );
161 readMail.setBody( body ); 169 readMail.setBody( body );
162 readMail.setMail( mail ); 170 readMail.setMail( mail );
163 readMail.showMaximized(); 171 readMail.showMaximized();
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 )
169 :QListViewItem(parent,item),mail_data() 192 :QListViewItem(parent,item),mail_data()
170{ 193{
171} 194}
172 195
173void MailListViewItem::showEntry() 196void MailListViewItem::showEntry()
174{ 197{
175 if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { 198 if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) {
176 setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") ); 199 setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") );
177 } else { 200 } else {
178 setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgnew") ); 201 setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgnew") );
179 } 202 }
diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h
index 6c1cda0..8641510 100644
--- a/noncore/net/mail/mainwindow.h
+++ b/noncore/net/mail/mainwindow.h
@@ -17,26 +17,28 @@ class MainWindow : public QMainWindow
17 Q_OBJECT 17 Q_OBJECT
18 18
19public: 19public:
20 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); 20 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
21 21
22public slots: 22public slots:
23 void slotAdjustColumns(); 23 void slotAdjustColumns();
24 24
25protected slots: 25protected slots:
26 virtual void slotShowFolders( bool show ); 26 virtual void slotShowFolders( bool show );
27 virtual void refreshMailView(QList<RecMail>*); 27 virtual void refreshMailView(QList<RecMail>*);
28 virtual void displayMail(QListViewItem*); 28 virtual void displayMail(QListViewItem*);
29 virtual void slotDeleteMail();
29 void slotAdjustLayout(); 30 void slotAdjustLayout();
30 31
31protected: 32protected:
32 QToolBar *toolBar; 33 QToolBar *toolBar;
33 QMenuBar *menuBar; 34 QMenuBar *menuBar;
34 QPopupMenu *mailMenu, *settingsMenu; 35 QPopupMenu *mailMenu, *settingsMenu;
35 QAction *composeMail, *sendQueued, *showFolders, *searchMails, 36 QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails,
36 *editSettings, *editAccounts, *syncFolders; 37 *editSettings, *editAccounts, *syncFolders;
37 AccountView *folderView; 38 AccountView *folderView;
38 QListView *mailView; 39 QListView *mailView;
40 QListViewItem* m_currentItem;
39 QBoxLayout *layout; 41 QBoxLayout *layout;
40}; 42};
41 43
42#endif 44#endif
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 42707e3..163ffb7 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -2,24 +2,25 @@
2#include <qmessagebox.h> 2#include <qmessagebox.h>
3#include <qtextstream.h> 3#include <qtextstream.h>
4#include <qaction.h> 4#include <qaction.h>
5#include <qpopupmenu.h> 5#include <qpopupmenu.h>
6#include <qapplication.h> 6#include <qapplication.h>
7 7
8#include <opie/ofiledialog.h> 8#include <opie/ofiledialog.h>
9 9
10#include "settings.h" 10#include "settings.h"
11#include "composemail.h" 11#include "composemail.h"
12#include "viewmail.h" 12#include "viewmail.h"
13#include "abstractmail.h" 13#include "abstractmail.h"
14#include "accountview.h"
14 15
15AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&file,const QString&desc,int num) 16AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&file,const QString&desc,int num)
16 : QListViewItem(parent,after),_partNum(num) 17 : QListViewItem(parent,after),_partNum(num)
17{ 18{
18 setText(0, mime); 19 setText(0, mime);
19 setText(1, file); 20 setText(1, file);
20 setText(2, desc); 21 setText(2, desc);
21} 22}
22 23
23void ViewMail::setBody( RecBody body ) { 24void ViewMail::setBody( RecBody body ) {
24 25
25m_body = body; 26m_body = body;
@@ -160,24 +161,25 @@ m_mail2[2] = mail.Bcc();
160setText(); 161setText();
161} 162}
162 163
163 164
164 165
165ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) 166ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
166 : ViewMailBase(parent, name, fl), _inLoop(false) 167 : ViewMailBase(parent, name, fl), _inLoop(false)
167{ 168{
168 m_gotBody = false; 169 m_gotBody = false;
169 170
170 connect(reply, SIGNAL(activated()), SLOT(slotReply())); 171 connect(reply, SIGNAL(activated()), SLOT(slotReply()));
171 connect(forward, SIGNAL(activated()), SLOT(slotForward())); 172 connect(forward, SIGNAL(activated()), SLOT(slotForward()));
173 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) );
172 174
173 attachments->setEnabled(m_gotBody); 175 attachments->setEnabled(m_gotBody);
174 connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) ); 176 connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) );
175 177
176} 178}
177 179
178void ViewMail::setText() 180void ViewMail::setText()
179{ 181{
180 182
181 QString toString; 183 QString toString;
182 QString ccString; 184 QString ccString;
183 QString bccString; 185 QString bccString;
@@ -306,12 +308,18 @@ void ViewMail::slotForward()
306 .arg( m_mail[2]); 308 .arg( m_mail[2]);
307 309
308 ftext += QString("----- End forwarded message -----\n"); 310 ftext += QString("----- End forwarded message -----\n");
309 311
310 Settings *settings = new Settings(); 312 Settings *settings = new Settings();
311 ComposeMail composer( settings ,this, 0, true); 313 ComposeMail composer( settings ,this, 0, true);
312 composer.setSubject( "Fwd: " + m_mail[1] ); 314 composer.setSubject( "Fwd: " + m_mail[1] );
313 composer.setMessage( ftext ); 315 composer.setMessage( ftext );
314 composer.showMaximized(); 316 composer.showMaximized();
315 composer.exec(); 317 composer.exec();
316} 318}
317 319
320void ViewMail::slotDeleteMail( )
321{
322 m_recMail.Wrapper()->deleteMail( m_recMail );
323 hide();
324 deleted = true;
325}
diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h
index bc12da1..765464c 100644
--- a/noncore/net/mail/viewmail.h
+++ b/noncore/net/mail/viewmail.h
@@ -21,33 +21,36 @@ private:
21class ViewMail : public ViewMailBase 21class ViewMail : public ViewMailBase
22{ 22{
23 Q_OBJECT 23 Q_OBJECT
24 24
25public: 25public:
26 ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = Qt::WType_Modal); 26 ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = Qt::WType_Modal);
27 ~ViewMail(); 27 ~ViewMail();
28 28
29 void hide(); 29 void hide();
30 void exec(); 30 void exec();
31 void setMail( RecMail mail ); 31 void setMail( RecMail mail );
32 void setBody( RecBody body ); 32 void setBody( RecBody body );
33 bool deleted;
33 34
34protected: 35protected:
35 QString deHtml(const QString &string); 36 QString deHtml(const QString &string);
36 37
37protected slots: 38protected slots:
38 void slotReply(); 39 void slotReply();
39 void slotForward(); 40 void slotForward();
40 void setText(); 41 void setText();
41 void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); 42 void slotItemClicked( QListViewItem * item , const QPoint & point, int c );
43 void slotDeleteMail( );
44
42 45
43private: 46private:
44 bool _inLoop; 47 bool _inLoop;
45 QString m_mailHtml; 48 QString m_mailHtml;
46 bool m_gotBody; 49 bool m_gotBody;
47 RecBody m_body; 50 RecBody m_body;
48 RecMail m_recMail; 51 RecMail m_recMail;
49 52
50 // 0 from 1 subject 2 bodytext 3 date 53 // 0 from 1 subject 2 bodytext 3 date
51 QMap <int,QString> m_mail; 54 QMap <int,QString> m_mail;
52 // 0 to 1 cc 2 bcc 55 // 0 to 1 cc 2 bcc
53 QMap <int,QStringList> m_mail2; 56 QMap <int,QStringList> m_mail2;