summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/viewatt.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/mailit/viewatt.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mailit/viewatt.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/noncore/unsupported/mailit/viewatt.cpp b/noncore/unsupported/mailit/viewatt.cpp
index 293e137..3515ba5 100644
--- a/noncore/unsupported/mailit/viewatt.cpp
+++ b/noncore/unsupported/mailit/viewatt.cpp
@@ -14,13 +14,13 @@
** 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 <qpe/resource.h>
#include "viewatt.h"
#include <qwhatsthis.h>
#include <qpe/applnk.h>
#include <qpe/mimetype.h>
ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f)
@@ -30,49 +30,49 @@ ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f)
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()) );
installButton->setWhatsThis(tr("Click here to install the attachment to your Documents"));
-
+
listView = new QListView(this, "AttView");
listView->addColumn( tr("Attatchment") );
listView->addColumn( tr("Type") );
listView->addColumn( tr("Installed") );
setCentralWidget(listView);
QWhatsThis::add(listView,QWidget::tr("This is an overview about all attachments in the mail"));
}
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 = tr("No");
if (ePtr->installed)
isInstalled = tr("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);
@@ -93,27 +93,27 @@ void ViewAtt::update(Email *mailIn, bool inbox)
void ViewAtt::install()
{
Enclosure *ePtr, *selPtr;
QListViewItem *item;
QString filename;
DocLnk d;
-
+
item = listView->selectedItem();
if (item != NULL) {
filename = item->text(0);
selPtr = NULL;
for ( ePtr=mail->files.first(); ePtr != 0; ePtr=mail->files.next() ) {
if (ePtr->originalName == filename)
selPtr = ePtr;
}
-
+
if (selPtr == NULL) {
qWarning("Internal error, file is not installed to documents");
return;
}
-
+
d.setName(selPtr->originalName);
d.setFile(selPtr->path + selPtr->name);
d.setType(selPtr->contentType + "/" + selPtr->contentAttribute);
d.writeLink();
selPtr->installed = TRUE;
item->setText(2, tr("Yes"));