Diffstat (limited to 'noncore/net/mail/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 7af7d83..b25db97 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp @@ -10,4 +10,6 @@ #include "mainwindow.h" #include "viewmail.h" +#include "mailtypes.h" +#include "mailistviewitem.h" MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) @@ -101,5 +103,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) SLOT( displayMail( QListViewItem * ) ) ); - connect(folderView,SIGNAL(refreshMailview(Maillist*)),this,SLOT(refreshMailView(Maillist*))); + connect(folderView,SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); @@ -130,21 +132,12 @@ void MainWindow::slotShowFolders( bool show ) } -void MainWindow::refreshMailView(Maillist*list) +void MainWindow::refreshMailView(QList<RecMail>*list) { MailListViewItem*item = 0; mailView->clear(); -#if 0 - QFont f = mailView->getFont(); - QFont bf = f; -#endif for (unsigned int i = 0; i < list->count();++i) { item = new MailListViewItem(mailView,item); item->storeData(*(list->at(i))); item->showEntry(); -#if 0 - if (!list->at(i)->getFlags().testBit(FLAG_SEEN)) { - item->setFont(bf); - } -#endif } } @@ -154,12 +147,15 @@ void MainWindow::displayMail(QListViewItem*item) qDebug("View mail"); RecMail mail = ((MailListViewItem*)item)->data(); - QString body = folderView->fetchBody(mail); + RecBody body = folderView->fetchBody(mail); ViewMail readMail( this ); - readMail.setMailInfo( mail.getFrom(), "", mail.getSubject(), "", "", body ); + readMail.setMailInfo( mail.getFrom(), "", mail.getSubject(), "", "", body.Bodytext() ); readMail.showMaximized(); readMail.exec(); +} - qDebug(body ); +MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * after ) + :QListViewItem(parent,after),mail_data() +{ } @@ -170,2 +166,12 @@ void MailListViewItem::showEntry() setText(2,mail_data.getDate()); } + +void MailListViewItem::storeData(const RecMail&data) +{ + mail_data = data; +} + +const RecMail& MailListViewItem::data()const +{ + return mail_data; +} |