Diffstat (limited to 'core/pim/osearch/doclnkitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/osearch/doclnkitem.cpp | 46 |
1 files changed, 31 insertions, 15 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 | |||
@@ -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 | |||
25 | DocLnkItem::~DocLnkItem() | 26 | DocLnkItem::~DocLnkItem() |
@@ -28,3 +29,2 @@ DocLnkItem::~DocLnkItem() | |||
28 | 29 | ||
29 | |||
30 | QString DocLnkItem::toRichText() | 30 | QString 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 | ||
43 | void DocLnkItem::editItem() | 58 | void 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 | ||
48 | void DocLnkItem::showItem() | 65 | QIntDict<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 | |||