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) (unidiff)
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 @@
4// 4//
5// Description: 5// Description:
6// 6//
@@ -15,2 +15,4 @@
15#include <qpe/applnk.h> 15#include <qpe/applnk.h>
16#include <qfile.h>
17#include <qtextstream.h>
16 18
@@ -23,3 +25,2 @@ DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app)
23 25
24
25DocLnkItem::~DocLnkItem() 26DocLnkItem::~DocLnkItem()
@@ -28,3 +29,2 @@ DocLnkItem::~DocLnkItem()
28 29
29
30QString DocLnkItem::toRichText() 30QString DocLnkItem::toRichText()
@@ -32,9 +32,24 @@ QString DocLnkItem::toRichText()
32 QString text; 32 QString text;
33 text += "<b><h3>"; 33 text += "<b><h3>" + _doc->name() + "</b></h3><br>";
34 text += _doc->name(); 34 text += _doc->comment() + "<br>";
35 text += "</b></h3><br>"; 35 text += "File: " + _doc->file() + "<br>";
36 text += _doc->comment(); 36 text += "Mimetype: " + _doc->type() + "<br>";
37 text += "<br><br>`"; 37 if ( _doc->type().contains( "text" ) ){
38 text += "<br><br><hr><br>";
39 QFile f(_doc->file());
40 if ( f.open(IO_ReadOnly) ) {
41 QTextStream t( &f );
42 while ( !t.eof() )
43 text += t.readLine() + "<br>";
44 }
45 f.close();
46 }
47 /* text += "<br><br>`";
38 text += _doc->exec(); 48 text += _doc->exec();
39 text += "`"; 49 text += "`";*/
50 QStringList list = _doc->mimeTypes();
51 int i = 0;
52 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
53 text += QString::number( i++) + " - " + *it ;
54 }
40 return text; 55 return text;
@@ -42,13 +57,14 @@ QString DocLnkItem::toRichText()
42 57
43void DocLnkItem::editItem() 58void DocLnkItem::action( int act )
44{ 59{
45 _doc->execute(); 60 qDebug("action %i",act);
61 if (!_doc->isValid()) qDebug("INVALID");
62 if (act == 0) _doc->execute();
46} 63}
47 64
48void DocLnkItem::showItem() 65QIntDict<QString> DocLnkItem::actions()
49{ 66{
50 /* QCopEnvelope e("QPE/Application/addressbook", "edit(int)"); 67 QIntDict<QString> result;
51 e << _contact->uid();*/ 68 result.insert( 0, new QString( QObject::tr("open with ") + _doc->exec() ) );
52 ResultItem::showItem(); 69 return result;
53} 70}
54