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
@@ -4,3 +4,3 @@
//
-// Description:
+// Description:
//
@@ -15,2 +15,4 @@
#include <qpe/applnk.h>
+#include <qfile.h>
+#include <qtextstream.h>
@@ -23,3 +25,2 @@ DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app)
-
DocLnkItem::~DocLnkItem()
@@ -28,3 +29,2 @@ DocLnkItem::~DocLnkItem()
-
QString DocLnkItem::toRichText()
@@ -32,9 +32,24 @@ 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;
@@ -42,13 +57,14 @@ QString DocLnkItem::toRichText()
-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;
}
-