summaryrefslogtreecommitdiff
path: root/noncore/net/mailit/viewatt.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mailit/viewatt.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/viewatt.cpp15
1 files changed, 12 insertions, 3 deletions
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
@@ -11,79 +11,88 @@
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "resource.h"
#include "viewatt.h"
#include <qpe/applnk.h>
+#include <qpe/mimetype.h>
ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f)
: QMainWindow(parent, name, f)
{
setCaption("Exploring attatchments");
setToolBarsMovable( FALSE );
bar = new QToolBar(this);
installButton = new QAction( tr( "Install" ), Resource::loadPixmap( "exec" ), QString::null, CTRL + Key_C, this, 0 );
connect(installButton, SIGNAL(activated()), this, SLOT(install()) );
listView = new QListView(this, "AttView");
listView->addColumn( "Attatchment" );
listView->addColumn( "Type" );
listView->addColumn( "Installed" );
setCentralWidget(listView);
}
void ViewAtt::update(Email *mailIn, bool inbox)
{
QListViewItem *item;
Enclosure *ePtr;
+
+
listView->clear();
if (inbox) {
bar->clear();
installButton->addTo( bar );
bar->show();
} else {
bar->hide();
}
mail = mailIn;
for ( ePtr=mail->files.first(); ePtr != 0; ePtr=mail->files.next() ) {
QString isInstalled = "No";
if (ePtr->installed)
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);
item->setPixmap(0, Resource::loadPixmap("play"));
}
if (ePtr->contentType == "IMAGE") {
actions = new QAction( tr("Show"), Resource::loadPixmap("pixmap"), QString::null, CTRL + Key_C, this, 0);
actions->addTo(bar);
item->setPixmap(0, Resource::loadPixmap("pixmap"));
- }
+ }*/
}
}
void ViewAtt::install()
{
Enclosure *ePtr, *selPtr;
QListViewItem *item;
QString filename;
DocLnk d;
item = listView->selectedItem();
if (item != NULL) {