Diffstat (limited to 'noncore/net/mailit/viewatt.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mailit/viewatt.cpp | 15 |
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 | |||
@@ -17,12 +17,13 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "resource.h" | 20 | #include "resource.h" |
21 | #include "viewatt.h" | 21 | #include "viewatt.h" |
22 | #include <qpe/applnk.h> | 22 | #include <qpe/applnk.h> |
23 | #include <qpe/mimetype.h> | ||
23 | 24 | ||
24 | ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f) | 25 | ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f) |
25 | : QMainWindow(parent, name, f) | 26 | : QMainWindow(parent, name, f) |
26 | { | 27 | { |
27 | setCaption("Exploring attatchments"); | 28 | setCaption("Exploring attatchments"); |
28 | 29 | ||
@@ -40,12 +41,14 @@ ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f) | |||
40 | 41 | ||
41 | void ViewAtt::update(Email *mailIn, bool inbox) | 42 | void ViewAtt::update(Email *mailIn, bool inbox) |
42 | { | 43 | { |
43 | QListViewItem *item; | 44 | QListViewItem *item; |
44 | Enclosure *ePtr; | 45 | Enclosure *ePtr; |
45 | 46 | ||
47 | |||
48 | |||
46 | listView->clear(); | 49 | listView->clear(); |
47 | if (inbox) { | 50 | if (inbox) { |
48 | bar->clear(); | 51 | bar->clear(); |
49 | installButton->addTo( bar ); | 52 | installButton->addTo( bar ); |
50 | bar->show(); | 53 | bar->show(); |
51 | } else { | 54 | } else { |
@@ -57,27 +60,33 @@ void ViewAtt::update(Email *mailIn, bool inbox) | |||
57 | 60 | ||
58 | QString isInstalled = "No"; | 61 | QString isInstalled = "No"; |
59 | if (ePtr->installed) | 62 | if (ePtr->installed) |
60 | isInstalled = "Yes"; | 63 | isInstalled = "Yes"; |
61 | item = new QListViewItem(listView, ePtr->originalName, ePtr->contentType, isInstalled); | 64 | item = new QListViewItem(listView, ePtr->originalName, ePtr->contentType, isInstalled); |
62 | 65 | ||
66 | const QString& mtypeDef=(const QString&) ePtr->contentType+"/"+ePtr->contentAttribute; | ||
67 | |||
68 | MimeType mt(mtypeDef); | ||
69 | |||
70 | item->setPixmap(0, mt.pixmap()); | ||
71 | |||
72 | /* | ||
63 | if (ePtr->contentType == "TEXT") { | 73 | if (ePtr->contentType == "TEXT") { |
64 | actions = new QAction( tr("View"), Resource::loadPixmap("TextEditor"), QString::null, CTRL + Key_C, this, 0); | 74 | actions = new QAction( tr("View"), Resource::loadPixmap("TextEditor"), QString::null, CTRL + Key_C, this, 0); |
65 | actions->addTo(bar); | 75 | actions->addTo(bar); |
66 | item->setPixmap(0, Resource::loadPixmap("txt")); | 76 | } |
67 | } | ||
68 | if (ePtr->contentType == "AUDIO") { | 77 | if (ePtr->contentType == "AUDIO") { |
69 | actions = new QAction( tr("Play"), Resource::loadPixmap("SoundPlayer"), QString::null, CTRL + Key_C, this, 0); | 78 | actions = new QAction( tr("Play"), Resource::loadPixmap("SoundPlayer"), QString::null, CTRL + Key_C, this, 0); |
70 | actions->addTo(bar); | 79 | actions->addTo(bar); |
71 | item->setPixmap(0, Resource::loadPixmap("play")); | 80 | item->setPixmap(0, Resource::loadPixmap("play")); |
72 | } | 81 | } |
73 | if (ePtr->contentType == "IMAGE") { | 82 | if (ePtr->contentType == "IMAGE") { |
74 | actions = new QAction( tr("Show"), Resource::loadPixmap("pixmap"), QString::null, CTRL + Key_C, this, 0); | 83 | actions = new QAction( tr("Show"), Resource::loadPixmap("pixmap"), QString::null, CTRL + Key_C, this, 0); |
75 | actions->addTo(bar); | 84 | actions->addTo(bar); |
76 | item->setPixmap(0, Resource::loadPixmap("pixmap")); | 85 | item->setPixmap(0, Resource::loadPixmap("pixmap")); |
77 | } | 86 | }*/ |
78 | } | 87 | } |
79 | } | 88 | } |
80 | 89 | ||
81 | void ViewAtt::install() | 90 | void ViewAtt::install() |
82 | { | 91 | { |
83 | Enclosure *ePtr, *selPtr; | 92 | Enclosure *ePtr, *selPtr; |