-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index f19f93d..3edfff1 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -136,49 +136,49 @@ void MainWindow::slotShowFolders( bool show ) | |||
136 | qDebug( "-> hiding" ); | 136 | qDebug( "-> hiding" ); |
137 | folderView->hide(); | 137 | folderView->hide(); |
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
141 | void MainWindow::refreshMailView(QList<RecMail>*list) | 141 | void MainWindow::refreshMailView(QList<RecMail>*list) |
142 | { | 142 | { |
143 | MailListViewItem*item = 0; | 143 | MailListViewItem*item = 0; |
144 | mailView->clear(); | 144 | mailView->clear(); |
145 | for (unsigned int i = 0; i < list->count();++i) { | 145 | for (unsigned int i = 0; i < list->count();++i) { |
146 | item = new MailListViewItem(mailView,item); | 146 | item = new MailListViewItem(mailView,item); |
147 | item->storeData(*(list->at(i))); | 147 | item->storeData(*(list->at(i))); |
148 | item->showEntry(); | 148 | item->showEntry(); |
149 | } | 149 | } |
150 | } | 150 | } |
151 | void MainWindow::displayMail(QListViewItem*item) | 151 | void MainWindow::displayMail(QListViewItem*item) |
152 | { | 152 | { |
153 | if (!item) return; | 153 | if (!item) return; |
154 | qDebug("View mail"); | 154 | qDebug("View mail"); |
155 | RecMail mail = ((MailListViewItem*)item)->data(); | 155 | RecMail mail = ((MailListViewItem*)item)->data(); |
156 | RecBody body = folderView->fetchBody(mail); | 156 | RecBody body = folderView->fetchBody(mail); |
157 | 157 | ||
158 | ViewMail readMail( this ); | 158 | ViewMail readMail( this ); |
159 | 159 | ||
160 | readMail.setMailInfo( mail.getFrom(), mail.To(), mail.getSubject(), mail.CC(), mail.Bcc(), mail.getDate(), body.Bodytext() ); | 160 | readMail.setMailInfo( mail.getFrom(), mail.To(), mail.getSubject(), mail.CC(), mail.Bcc(), mail.getDate(), body.Bodytext(), mail.Msgid() ); |
161 | readMail.showMaximized(); | 161 | readMail.showMaximized(); |
162 | readMail.exec(); | 162 | readMail.exec(); |
163 | } | 163 | } |
164 | 164 | ||
165 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * after ) | 165 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * after ) |
166 | :QListViewItem(parent,after),mail_data() | 166 | :QListViewItem(parent,after),mail_data() |
167 | { | 167 | { |
168 | } | 168 | } |
169 | 169 | ||
170 | void MailListViewItem::showEntry() | 170 | void MailListViewItem::showEntry() |
171 | { | 171 | { |
172 | setText(0,mail_data.getSubject()); | 172 | setText(0,mail_data.getSubject()); |
173 | setText(1,mail_data.getFrom()); | 173 | setText(1,mail_data.getFrom()); |
174 | setText(2,mail_data.getDate()); | 174 | setText(2,mail_data.getDate()); |
175 | } | 175 | } |
176 | 176 | ||
177 | void MailListViewItem::storeData(const RecMail&data) | 177 | void MailListViewItem::storeData(const RecMail&data) |
178 | { | 178 | { |
179 | mail_data = data; | 179 | mail_data = data; |
180 | } | 180 | } |
181 | 181 | ||
182 | const RecMail& MailListViewItem::data()const | 182 | const RecMail& MailListViewItem::data()const |
183 | { | 183 | { |
184 | return mail_data; | 184 | return mail_data; |
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index 8f9ea07..7969235 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -2,60 +2,60 @@ | |||
2 | #include <qmessagebox.h> | 2 | #include <qmessagebox.h> |
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qapplication.h> | 4 | #include <qapplication.h> |
5 | 5 | ||
6 | #include "settings.h" | 6 | #include "settings.h" |
7 | #include "composemail.h" | 7 | #include "composemail.h" |
8 | #include "viewmail.h" | 8 | #include "viewmail.h" |
9 | 9 | ||
10 | AttachItem::AttachItem(QListView *parent, AttachItemStore &attachItemStore) | 10 | AttachItem::AttachItem(QListView *parent, AttachItemStore &attachItemStore) |
11 | : QListViewItem(parent), _attachItemStore(attachItemStore) | 11 | : QListViewItem(parent), _attachItemStore(attachItemStore) |
12 | { | 12 | { |
13 | setText(0, _attachItemStore.mimeType()); | 13 | setText(0, _attachItemStore.mimeType()); |
14 | setText(1, _attachItemStore.fileName()); | 14 | setText(1, _attachItemStore.fileName()); |
15 | setText(2, _attachItemStore.description()); | 15 | setText(2, _attachItemStore.description()); |
16 | } | 16 | } |
17 | 17 | ||
18 | AttachItem::AttachItem(QListViewItem *parent, AttachItemStore &attachItemStore) | 18 | AttachItem::AttachItem(QListViewItem *parent, AttachItemStore &attachItemStore) |
19 | : QListViewItem(parent), _attachItemStore(attachItemStore) | 19 | : QListViewItem(parent), _attachItemStore(attachItemStore) |
20 | { | 20 | { |
21 | setText(0, _attachItemStore.mimeType()); | 21 | setText(0, _attachItemStore.mimeType()); |
22 | setText(1, _attachItemStore.fileName()); | 22 | setText(1, _attachItemStore.fileName()); |
23 | setText(2, _attachItemStore.description()); | 23 | setText(2, _attachItemStore.description()); |
24 | } | 24 | } |
25 | 25 | ||
26 | void ViewMail::setMailInfo( const QString & from, const QStringList & to, const QString & subject, const QStringList & cc, const QStringList & bcc, const QString & date, const QString & bodytext ) { | 26 | void ViewMail::setMailInfo( const QString & from, const QStringList & to, const QString & subject, const QStringList & cc, const QStringList & bcc, const QString & date, const QString & bodytext, const QString & messageID ) { |
27 | 27 | ||
28 | m_mail[0] = from; | 28 | m_mail[0] = from; |
29 | m_mail2[0] = to; | 29 | m_mail2[0] = to; |
30 | m_mail[1] = subject; | 30 | m_mail[1] = subject; |
31 | m_mail2[1] = cc; | 31 | m_mail2[1] = cc; |
32 | m_mail2[2] = bcc; | 32 | m_mail2[2] = bcc; |
33 | m_mail[2] = bodytext; | 33 | m_mail[2] = bodytext; |
34 | m_mail[3] = date; | 34 | m_mail[3] = date; |
35 | m_mail[4] = messageID; | ||
35 | 36 | ||
36 | setText(); | 37 | setText(); |
37 | |||
38 | } | 38 | } |
39 | 39 | ||
40 | 40 | ||
41 | ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | 41 | ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) |
42 | : ViewMailBase(parent, name, fl), _inLoop(false) | 42 | : ViewMailBase(parent, name, fl), _inLoop(false) |
43 | { | 43 | { |
44 | _gotBody = false; | 44 | _gotBody = false; |
45 | 45 | ||
46 | connect(reply, SIGNAL(activated()), SLOT(slotReply())); | 46 | connect(reply, SIGNAL(activated()), SLOT(slotReply())); |
47 | connect(forward, SIGNAL(activated()), SLOT(slotForward())); | 47 | connect(forward, SIGNAL(activated()), SLOT(slotForward())); |
48 | 48 | ||
49 | attachments->setEnabled(_gotBody); | 49 | attachments->setEnabled(_gotBody); |
50 | 50 | ||
51 | //_handler->iUid("FETCH", QString("%1 (BODY[1])").arg(mail.uid())); | 51 | //_handler->iUid("FETCH", QString("%1 (BODY[1])").arg(mail.uid())); |
52 | //connect(_handler, SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPUid(IMAPResponse &))); | 52 | //connect(_handler, SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPUid(IMAPResponse &))); |
53 | } | 53 | } |
54 | 54 | ||
55 | void ViewMail::setText() | 55 | void ViewMail::setText() |
56 | { | 56 | { |
57 | 57 | ||
58 | QString toString; | 58 | QString toString; |
59 | QString ccString; | 59 | QString ccString; |
60 | QString bccString; | 60 | QString bccString; |
61 | 61 | ||
diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h index 615939a..258c09b 100644 --- a/noncore/net/mail/viewmail.h +++ b/noncore/net/mail/viewmail.h | |||
@@ -29,49 +29,49 @@ private: | |||
29 | class AttachItem : public QListViewItem | 29 | class AttachItem : public QListViewItem |
30 | { | 30 | { |
31 | public: | 31 | public: |
32 | AttachItem(QListView *parent, AttachItemStore &attachment); | 32 | AttachItem(QListView *parent, AttachItemStore &attachment); |
33 | AttachItem(QListViewItem *parent, AttachItemStore &attachment); | 33 | AttachItem(QListViewItem *parent, AttachItemStore &attachment); |
34 | 34 | ||
35 | AttachItemStore attachItemStore() { return _attachItemStore; } | 35 | AttachItemStore attachItemStore() { return _attachItemStore; } |
36 | 36 | ||
37 | private: | 37 | private: |
38 | AttachItemStore _attachItemStore; | 38 | AttachItemStore _attachItemStore; |
39 | 39 | ||
40 | }; | 40 | }; |
41 | 41 | ||
42 | class ViewMail : public ViewMailBase | 42 | class ViewMail : public ViewMailBase |
43 | { | 43 | { |
44 | Q_OBJECT | 44 | Q_OBJECT |
45 | 45 | ||
46 | public: | 46 | public: |
47 | ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = Qt::WType_Modal); | 47 | ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = Qt::WType_Modal); |
48 | ~ViewMail(); | 48 | ~ViewMail(); |
49 | 49 | ||
50 | void hide(); | 50 | void hide(); |
51 | void exec(); | 51 | void exec(); |
52 | static QString appName() { return QString::fromLatin1("mail"); } | 52 | static QString appName() { return QString::fromLatin1("mail"); } |
53 | void setMailInfo( const QString & from, const QStringList & to, const QString & subject, const QStringList & cc, const QStringList & bcc,const QString & date, const QString & bodytext ); | 53 | void setMailInfo( const QString & from, const QStringList & to, const QString & subject, const QStringList & cc, const QStringList & bcc,const QString & date, const QString & bodytext, const QString & messageID ); |
54 | 54 | ||
55 | protected: | 55 | protected: |
56 | //void fillList(IMAPResponseBODYSTRUCTURE &structure); | 56 | //void fillList(IMAPResponseBODYSTRUCTURE &structure); |
57 | QString deHtml(const QString &string); | 57 | QString deHtml(const QString &string); |
58 | 58 | ||
59 | protected slots: | 59 | protected slots: |
60 | void slotReply(); | 60 | void slotReply(); |
61 | void slotForward(); | 61 | void slotForward(); |
62 | void setText(); | 62 | void setText(); |
63 | 63 | ||
64 | //void slotIMAPUid(IMAPResponse &response); | 64 | //void slotIMAPUid(IMAPResponse &response); |
65 | 65 | ||
66 | private: | 66 | private: |
67 | bool _inLoop; | 67 | bool _inLoop; |
68 | //IMAPResponseFETCH _mail; | 68 | //IMAPResponseFETCH _mail; |
69 | //IMAPHandler *_handler; | 69 | //IMAPHandler *_handler; |
70 | QString _mailHtml; | 70 | QString _mailHtml; |
71 | bool _gotBody; | 71 | bool _gotBody; |
72 | 72 | ||
73 | // 0 from | 73 | // 0 from |
74 | // 1 subject | 74 | // 1 subject |
75 | // 2 bodytext | 75 | // 2 bodytext |
76 | // 3 date | 76 | // 3 date |
77 | QMap <int,QString> m_mail; | 77 | QMap <int,QString> m_mail; |