summaryrefslogtreecommitdiff
path: root/core/pim/osearch/doclnkitem.cpp
authortille <tille>2003-05-11 19:19:30 (UTC)
committer tille <tille>2003-05-11 19:19:30 (UTC)
commit43c18630840a98aed8deb96b454957c40f0a4344 (patch) (side-by-side diff)
tree60e5b68d1d172c77560d5af7bea83e81be7144a6 /core/pim/osearch/doclnkitem.cpp
parent38dc2fd6258f11ba0507c7bd8f8dfd5b39bc0df5 (diff)
downloadopie-43c18630840a98aed8deb96b454957c40f0a4344.zip
opie-43c18630840a98aed8deb96b454957c40f0a4344.tar.gz
opie-43c18630840a98aed8deb96b454957c40f0a4344.tar.bz2
improved applnk and doclnk searching
clean up: - mainwindow: handling of searchgroups - searchgroups: introduced load, search and insertItem functions - flexible actions handling - doclnksearch inherits applnksearch
Diffstat (limited to 'core/pim/osearch/doclnkitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/doclnkitem.cpp48
1 files changed, 32 insertions, 16 deletions
diff --git a/core/pim/osearch/doclnkitem.cpp b/core/pim/osearch/doclnkitem.cpp
index fd19727..75dee58 100644
--- a/core/pim/osearch/doclnkitem.cpp
+++ b/core/pim/osearch/doclnkitem.cpp
@@ -2,7 +2,7 @@
//
// C++ Implementation: $MODULE$
//
-// Description:
+// Description:
//
//
// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
@@ -13,6 +13,8 @@
#include "doclnkitem.h"
#include <qpe/applnk.h>
+#include <qfile.h>
+#include <qtextstream.h>
DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app)
: ResultItem(parent)
@@ -21,34 +23,48 @@ DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app)
setText(0, _doc->name() );
}
-
DocLnkItem::~DocLnkItem()
{
}
-
QString DocLnkItem::toRichText()
{
QString text;
- text += "<b><h3>";
- text += _doc->name();
- text += "</b></h3><br>";
- text += _doc->comment();
- text += "<br><br>`";
+ text += "<b><h3>" + _doc->name() + "</b></h3><br>";
+ text += _doc->comment() + "<br>";
+ text += "File: " + _doc->file() + "<br>";
+ text += "Mimetype: " + _doc->type() + "<br>";
+ if ( _doc->type().contains( "text" ) ){
+ text += "<br><br><hr><br>";
+ QFile f(_doc->file());
+ if ( f.open(IO_ReadOnly) ) {
+ QTextStream t( &f );
+ while ( !t.eof() )
+ text += t.readLine() + "<br>";
+ }
+ f.close();
+ }
+ /* text += "<br><br>`";
text += _doc->exec();
- text += "`";
+ text += "`";*/
+ QStringList list = _doc->mimeTypes();
+ int i = 0;
+ for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ text += QString::number( i++) + " - " + *it ;
+ }
return text;
}
-void DocLnkItem::editItem()
+void DocLnkItem::action( int act )
{
- _doc->execute();
+ qDebug("action %i",act);
+ if (!_doc->isValid()) qDebug("INVALID");
+ if (act == 0) _doc->execute();
}
-void DocLnkItem::showItem()
+QIntDict<QString> DocLnkItem::actions()
{
-/* QCopEnvelope e("QPE/Application/addressbook", "edit(int)");
- e << _contact->uid();*/
- ResultItem::showItem();
+ QIntDict<QString> result;
+ result.insert( 0, new QString( QObject::tr("open with ") + _doc->exec() ) );
+ return result;
}
-