Diffstat (limited to 'noncore/net/mail/viewmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index 894a386..f00d2cb 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -9,24 +9,25 @@ | |||
9 | #include <opie2/ofiledialog.h> | 9 | #include <opie2/ofiledialog.h> |
10 | #include <qpe/config.h> | 10 | #include <qpe/config.h> |
11 | #include <qpe/qpeapplication.h> | 11 | #include <qpe/qpeapplication.h> |
12 | 12 | ||
13 | /* QT */ | 13 | /* QT */ |
14 | #include <qtextbrowser.h> | 14 | #include <qtextbrowser.h> |
15 | #include <qmessagebox.h> | 15 | #include <qmessagebox.h> |
16 | #include <qtextstream.h> | 16 | #include <qtextstream.h> |
17 | #include <qaction.h> | 17 | #include <qaction.h> |
18 | #include <qpopupmenu.h> | 18 | #include <qpopupmenu.h> |
19 | #include <qfile.h> | 19 | #include <qfile.h> |
20 | 20 | ||
21 | using namespace Opie::Ui; | ||
21 | AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, | 22 | AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, |
22 | const QString&fsize,int num,const QValueList<int>&path) | 23 | const QString&fsize,int num,const QValueList<int>&path) |
23 | : QListViewItem(parent,after),_partNum(num) | 24 | : QListViewItem(parent,after),_partNum(num) |
24 | { | 25 | { |
25 | _path=path; | 26 | _path=path; |
26 | setText(0, mime); | 27 | setText(0, mime); |
27 | setText(1, desc); | 28 | setText(1, desc); |
28 | setText(2, file); | 29 | setText(2, file); |
29 | setText(3, fsize); | 30 | setText(3, fsize); |
30 | } | 31 | } |
31 | 32 | ||
32 | AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, | 33 | AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, |
@@ -211,25 +212,25 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
211 | } | 212 | } |
212 | menu->insertItem( tr( "Save Attachment" ), 0 ); | 213 | menu->insertItem( tr( "Save Attachment" ), 0 ); |
213 | menu->insertSeparator(1); | 214 | menu->insertSeparator(1); |
214 | 215 | ||
215 | ret = menu->exec( point, 0 ); | 216 | ret = menu->exec( point, 0 ); |
216 | 217 | ||
217 | switch(ret) | 218 | switch(ret) |
218 | { | 219 | { |
219 | case 0: | 220 | case 0: |
220 | { | 221 | { |
221 | MimeTypes types; | 222 | MimeTypes types; |
222 | types.insert( "all", "*" ); | 223 | types.insert( "all", "*" ); |
223 | QString str = Opie::OFileDialog::getSaveFileName( 1, | 224 | QString str = OFileDialog::getSaveFileName( 1, |
224 | "/", item->text( 2 ) , types, 0 ); | 225 | "/", item->text( 2 ) , types, 0 ); |
225 | 226 | ||
226 | if( !str.isEmpty() ) | 227 | if( !str.isEmpty() ) |
227 | { | 228 | { |
228 | encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); | 229 | encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); |
229 | if (content) | 230 | if (content) |
230 | { | 231 | { |
231 | QFile output(str); | 232 | QFile output(str); |
232 | output.open(IO_WriteOnly); | 233 | output.open(IO_WriteOnly); |
233 | output.writeBlock(content->Content(),content->Length()); | 234 | output.writeBlock(content->Content(),content->Length()); |
234 | output.close(); | 235 | output.close(); |
235 | delete content; | 236 | delete content; |