From 8cc217bed9c122a7c7448e2cd59bfde330dfcfad Mon Sep 17 00:00:00 2001 From: groucho Date: Sun, 13 Apr 2003 10:29:05 +0000 Subject: - Uses mime types for attachment reading - Addresses are read from ocontactacess --- (limited to 'noncore/net/mailit/viewatt.cpp') diff --git a/noncore/net/mailit/viewatt.cpp b/noncore/net/mailit/viewatt.cpp index 86f119f..b6f5015 100644 --- a/noncore/net/mailit/viewatt.cpp +++ b/noncore/net/mailit/viewatt.cpp @@ -20,6 +20,7 @@ #include "resource.h" #include "viewatt.h" #include +#include ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f) : QMainWindow(parent, name, f) @@ -43,6 +44,8 @@ void ViewAtt::update(Email *mailIn, bool inbox) QListViewItem *item; Enclosure *ePtr; + + listView->clear(); if (inbox) { bar->clear(); @@ -60,11 +63,17 @@ void ViewAtt::update(Email *mailIn, bool inbox) isInstalled = "Yes"; item = new QListViewItem(listView, ePtr->originalName, ePtr->contentType, isInstalled); + const QString& mtypeDef=(const QString&) ePtr->contentType+"/"+ePtr->contentAttribute; + + MimeType mt(mtypeDef); + + item->setPixmap(0, mt.pixmap()); + + /* if (ePtr->contentType == "TEXT") { actions = new QAction( tr("View"), Resource::loadPixmap("TextEditor"), QString::null, CTRL + Key_C, this, 0); actions->addTo(bar); - item->setPixmap(0, Resource::loadPixmap("txt")); - } + } if (ePtr->contentType == "AUDIO") { actions = new QAction( tr("Play"), Resource::loadPixmap("SoundPlayer"), QString::null, CTRL + Key_C, this, 0); actions->addTo(bar); @@ -74,7 +83,7 @@ void ViewAtt::update(Email *mailIn, bool inbox) actions = new QAction( tr("Show"), Resource::loadPixmap("pixmap"), QString::null, CTRL + Key_C, this, 0); actions->addTo(bar); item->setPixmap(0, Resource::loadPixmap("pixmap")); - } + }*/ } } -- cgit v0.9.0.2