Diffstat (limited to 'noncore/net/mail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 24 |
1 files changed, 13 insertions, 11 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 | |||
@@ -142,13 +142,13 @@ void OpieMail::slotEditAccounts() | |||
142 | } | 142 | } |
143 | 143 | ||
144 | void OpieMail::displayMail() | 144 | 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 ); |
152 | readMail.setMail( mail ); | 152 | readMail.setMail( mail ); |
153 | readMail.showMaximized(); | 153 | readMail.showMaximized(); |
154 | readMail.exec(); | 154 | readMail.exec(); |
@@ -163,16 +163,16 @@ void OpieMail::displayMail() | |||
163 | } | 163 | } |
164 | } | 164 | } |
165 | 165 | ||
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 | } |
176 | 176 | ||
177 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | 177 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) |
178 | { | 178 | { |
@@ -214,20 +214,22 @@ void OpieMail::slotShowFolders( bool show ) | |||
214 | { | 214 | { |
215 | qDebug( "-> hiding" ); | 215 | qDebug( "-> hiding" ); |
216 | folderView->hide(); | 216 | folderView->hide(); |
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 | } |
231 | 233 | ||
232 | void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int ) | 234 | void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int ) |
233 | { | 235 | { |
@@ -241,38 +243,38 @@ void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int | |||
241 | } | 243 | } |
242 | } | 244 | } |
243 | 245 | ||
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; |
251 | folderView->setupFolderselect(&sels); | 253 | folderView->setupFolderselect(&sels); |
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; |
259 | } | 261 | } |
260 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 262 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
261 | { | 263 | { |
262 | QMessageBox::critical(0,tr("Error creating new Folder"), | 264 | QMessageBox::critical(0,tr("Error creating new Folder"), |
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 | ||
270 | void OpieMail::reEditMail() | 272 | void OpieMail::reEditMail() |
271 | { | 273 | { |
272 | if (!mailView->currentItem()) return; | 274 | if (!mailView->currentItem()) return; |
273 | 275 | ||
274 | ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); | 276 | ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); |
275 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); | 277 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); |
276 | compose.slotAdjustColumns(); | 278 | compose.slotAdjustColumns(); |
277 | QPEApplication::execDialog( &compose ); | 279 | QPEApplication::execDialog( &compose ); |
278 | } | 280 | } |