-rw-r--r-- | noncore/net/mail/opiemail.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index d95b3c9..dd305df 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -145,7 +145,7 @@ void OpieMail::displayMail() | |||
145 | { | 145 | { |
146 | QListViewItem*item = mailView->currentItem(); | 146 | QListViewItem*item = mailView->currentItem(); |
147 | if (!item) return; | 147 | if (!item) return; |
148 | RecMail mail = ((MailListViewItem*)item)->data(); | 148 | RecMailP mail = ((MailListViewItem*)item)->data(); |
149 | RecBody body = folderView->fetchBody(mail); | 149 | RecBody body = folderView->fetchBody(mail); |
150 | ViewMail readMail( this,"", Qt::WType_Modal | WStyle_ContextHelp ); | 150 | ViewMail readMail( this,"", Qt::WType_Modal | WStyle_ContextHelp ); |
151 | readMail.setBody( body ); | 151 | readMail.setBody( body ); |
@@ -166,10 +166,10 @@ void OpieMail::displayMail() | |||
166 | void OpieMail::slotDeleteMail() | 166 | void OpieMail::slotDeleteMail() |
167 | { | 167 | { |
168 | if (!mailView->currentItem()) return; | 168 | if (!mailView->currentItem()) return; |
169 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 169 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
170 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail.getFrom() + " - " + mail.getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 170 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
171 | { | 171 | { |
172 | mail.Wrapper()->deleteMail( mail ); | 172 | mail->Wrapper()->deleteMail( mail ); |
173 | folderView->refreshCurrent(); | 173 | folderView->refreshCurrent(); |
174 | } | 174 | } |
175 | } | 175 | } |
@@ -217,14 +217,16 @@ void OpieMail::slotShowFolders( bool show ) | |||
217 | } | 217 | } |
218 | } | 218 | } |
219 | 219 | ||
220 | void OpieMail::refreshMailView(QList<RecMail>*list) | 220 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) |
221 | { | 221 | { |
222 | MailListViewItem*item = 0; | 222 | MailListViewItem*item = 0; |
223 | mailView->clear(); | 223 | mailView->clear(); |
224 | for (unsigned int i = 0; i < list->count();++i) | 224 | |
225 | QValueList<RecMailP>::ConstIterator it; | ||
226 | for (it = list.begin(); it != list.end();++it) | ||
225 | { | 227 | { |
226 | item = new MailListViewItem(mailView,item); | 228 | item = new MailListViewItem(mailView,item); |
227 | item->storeData(*(list->at(i))); | 229 | item->storeData((*it)); |
228 | item->showEntry(); | 230 | item->showEntry(); |
229 | } | 231 | } |
230 | } | 232 | } |
@@ -244,7 +246,7 @@ void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int | |||
244 | void OpieMail::slotMoveCopyMail() | 246 | void OpieMail::slotMoveCopyMail() |
245 | { | 247 | { |
246 | if (!mailView->currentItem()) return; | 248 | if (!mailView->currentItem()) return; |
247 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 249 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
248 | AbstractMail*targetMail = 0; | 250 | AbstractMail*targetMail = 0; |
249 | QString targetFolder = ""; | 251 | QString targetFolder = ""; |
250 | Selectstore sels; | 252 | Selectstore sels; |
@@ -252,7 +254,7 @@ void OpieMail::slotMoveCopyMail() | |||
252 | if (!sels.exec()) return; | 254 | if (!sels.exec()) return; |
253 | targetMail = sels.currentMail(); | 255 | targetMail = sels.currentMail(); |
254 | targetFolder = sels.currentFolder(); | 256 | targetFolder = sels.currentFolder(); |
255 | if ( (mail.Wrapper()==targetMail && mail.getMbox()==targetFolder) || | 257 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || |
256 | targetFolder.isEmpty()) | 258 | targetFolder.isEmpty()) |
257 | { | 259 | { |
258 | return; | 260 | return; |
@@ -263,7 +265,7 @@ void OpieMail::slotMoveCopyMail() | |||
263 | tr("<center>Error while creating<br>new folder - breaking.</center>")); | 265 | tr("<center>Error while creating<br>new folder - breaking.</center>")); |
264 | return; | 266 | return; |
265 | } | 267 | } |
266 | mail.Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); | 268 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); |
267 | folderView->refreshCurrent(); | 269 | folderView->refreshCurrent(); |
268 | } | 270 | } |
269 | 271 | ||