summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/viewmail.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 0947879..d86454c 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -163,56 +163,58 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
163 163
164 164
165void ViewMail::setMail( RecMail mail ) { 165void ViewMail::setMail( RecMail mail ) {
166 166
167m_recMail = mail; 167m_recMail = mail;
168 168
169m_mail[0] = mail.getFrom(); 169m_mail[0] = mail.getFrom();
170m_mail[1] = mail.getSubject(); 170m_mail[1] = mail.getSubject();
171m_mail[3] = mail.getDate(); 171m_mail[3] = mail.getDate();
172m_mail[4] = mail.Msgid(); 172m_mail[4] = mail.Msgid();
173 173
174m_mail2[0] = mail.To(); 174m_mail2[0] = mail.To();
175m_mail2[1] = mail.CC(); 175m_mail2[1] = mail.CC();
176m_mail2[2] = mail.Bcc(); 176m_mail2[2] = mail.Bcc();
177 177
178setText(); 178setText();
179} 179}
180 180
181 181
182 182
183ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) 183ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
184 : ViewMailBase(parent, name, fl), _inLoop(false) 184 : ViewMailBase(parent, name, fl), _inLoop(false)
185{ 185{
186 m_gotBody = false; 186 m_gotBody = false;
187 deleted = false;
187 188
188 connect(reply, SIGNAL(activated()), SLOT(slotReply())); 189 connect(reply, SIGNAL(activated()), SLOT(slotReply()));
189 connect(forward, SIGNAL(activated()), SLOT(slotForward())); 190 connect(forward, SIGNAL(activated()), SLOT(slotForward()));
190 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) ); 191 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) );
191 192
192 attachments->setEnabled(m_gotBody); 193 attachments->setEnabled(m_gotBody);
193 connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) ); 194 connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) );
194 195
196
195} 197}
196 198
197void ViewMail::setText() 199void ViewMail::setText()
198{ 200{
199 201
200 QString toString; 202 QString toString;
201 QString ccString; 203 QString ccString;
202 QString bccString; 204 QString bccString;
203 205
204 for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) { 206 for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) {
205 toString += (*it); 207 toString += (*it);
206 } 208 }
207 for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) { 209 for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) {
208 ccString += (*it); 210 ccString += (*it);
209 } 211 }
210 for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) { 212 for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) {
211 bccString += (*it); 213 bccString += (*it);
212 } 214 }
213 215
214 setCaption( caption().arg( m_mail[0] ) ); 216 setCaption( caption().arg( m_mail[0] ) );
215 217
216 m_mailHtml = "<html><body>" 218 m_mailHtml = "<html><body>"
217 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" 219 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>"
218 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" 220 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>"
@@ -312,36 +314,36 @@ void ViewMail::slotForward()
312 QString ftext; 314 QString ftext;
313 ftext += QString("\n----- Forwarded message from %1 -----\n\n") 315 ftext += QString("\n----- Forwarded message from %1 -----\n\n")
314 .arg( m_mail[0] ); 316 .arg( m_mail[0] );
315 if (!m_mail[3].isNull()) 317 if (!m_mail[3].isNull())
316 ftext += QString("Date: %1\n") 318 ftext += QString("Date: %1\n")
317 .arg( m_mail[3] ); 319 .arg( m_mail[3] );
318 if (!m_mail[0].isNull()) 320 if (!m_mail[0].isNull())
319 ftext += QString("From: %1\n") 321 ftext += QString("From: %1\n")
320 .arg( m_mail[0] ); 322 .arg( m_mail[0] );
321 if (!m_mail[1].isNull()) 323 if (!m_mail[1].isNull())
322 ftext += QString("Subject: %1\n") 324 ftext += QString("Subject: %1\n")
323 .arg( m_mail[1] ); 325 .arg( m_mail[1] );
324 326
325 ftext += QString("\n%1\n") 327 ftext += QString("\n%1\n")
326 .arg( m_mail[2]); 328 .arg( m_mail[2]);
327 329
328 ftext += QString("----- End forwarded message -----\n"); 330 ftext += QString("----- End forwarded message -----\n");
329 331
330 Settings *settings = new Settings(); 332 Settings *settings = new Settings();
331 ComposeMail composer( settings ,this, 0, true); 333 ComposeMail composer( settings ,this, 0, true);
332 composer.setSubject( "Fwd: " + m_mail[1] ); 334 composer.setSubject( "Fwd: " + m_mail[1] );
333 composer.setMessage( ftext ); 335 composer.setMessage( ftext );
334 composer.showMaximized(); 336 composer.showMaximized();
335 if ( QDialog::Accepted==composer.exec()) { 337 if ( QDialog::Accepted==composer.exec()) {
336 338
337 } 339 }
338} 340}
339 341
340void ViewMail::slotDeleteMail( ) 342void ViewMail::slotDeleteMail( )
341{ 343{
342 if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { 344 if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) {
343 m_recMail.Wrapper()->deleteMail( m_recMail ); 345 m_recMail.Wrapper()->deleteMail( m_recMail );
344 hide(); 346 hide();
345 deleted = true; 347 deleted = true;
346 } 348 }
347} 349}