Diffstat (limited to 'core/pim/osearch/doclnkitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/doclnkitem.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/pim/osearch/doclnkitem.cpp b/core/pim/osearch/doclnkitem.cpp index a1d0384..56eb26a 100644 --- a/core/pim/osearch/doclnkitem.cpp +++ b/core/pim/osearch/doclnkitem.cpp | |||
@@ -1,79 +1,79 @@ | |||
1 | // | 1 | // |
2 | // | 2 | // |
3 | // C++ Implementation: $MODULE$ | 3 | // C++ Implementation: $MODULE$ |
4 | // | 4 | // |
5 | // Description: | 5 | // Description: |
6 | // | 6 | // |
7 | // | 7 | // |
8 | // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 | 8 | // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 |
9 | // | 9 | // |
10 | // Copyright: See COPYING file that comes with this distribution | 10 | // Copyright: See COPYING file that comes with this distribution |
11 | // | 11 | // |
12 | // | 12 | // |
13 | #include "doclnkitem.h" | 13 | #include "doclnkitem.h" |
14 | 14 | ||
15 | #include <qpe/applnk.h> | 15 | #include <qpe/applnk.h> |
16 | #include <qfile.h> | 16 | #include <qfile.h> |
17 | #include <qtextstream.h> | 17 | #include <qtextstream.h> |
18 | #include <qfileinfo.h> | 18 | #include <qfileinfo.h> |
19 | #include <qpe/qcopenvelope_qws.h> | 19 | #include <qpe/qcopenvelope_qws.h> |
20 | 20 | ||
21 | DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app) | 21 | DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app) |
22 | : ResultItem(parent) | 22 | : ResultItem(parent) |
23 | { | 23 | { |
24 | _doc = app; | 24 | _doc = app; |
25 | setText(0, _doc->name() ); | 25 | setText(0, _doc->name() ); |
26 | setPixmap(0, _doc->pixmap() ); | 26 | setPixmap(0, _doc->pixmap() ); |
27 | } | 27 | } |
28 | 28 | ||
29 | DocLnkItem::~DocLnkItem() | 29 | DocLnkItem::~DocLnkItem() |
30 | { | 30 | { |
31 | } | 31 | } |
32 | 32 | ||
33 | QString DocLnkItem::toRichText() | 33 | QString DocLnkItem::toRichText() |
34 | { | 34 | { |
35 | QString text; | 35 | QString text; |
36 | text += "<b><h3>" + _doc->name() + "</b></h3><br>"; | 36 | text += "<b><h3>" + _doc->name() + "</b></h3><br>"; |
37 | text += _doc->comment() + "<br>"; | 37 | text += _doc->comment() + "<br>"; |
38 | text += "File: " + _doc->file() + "<br>"; | 38 | text += QObject::tr("File: ") + _doc->file() + "<br>"; |
39 | text += "Link: " + _doc->linkFile() + "<br>"; | 39 | text += QObject::tr("Link: ") + _doc->linkFile() + "<br>"; |
40 | text += "Mimetype: " + _doc->type() + "<br>"; | 40 | text += QObject::tr("Mimetype: ") + _doc->type() + "<br>"; |
41 | if ( _doc->type().contains( "text" ) ){ | 41 | if ( _doc->type().contains( "text" ) ){ |
42 | text += "<br><br><hr><br>"; | 42 | text += "<br><br><hr><br>"; |
43 | QFile f(_doc->file()); | 43 | QFile f(_doc->file()); |
44 | if ( f.open(IO_ReadOnly) ) { | 44 | if ( f.open(IO_ReadOnly) ) { |
45 | QTextStream t( &f ); | 45 | QTextStream t( &f ); |
46 | while ( !t.eof() ) | 46 | while ( !t.eof() ) |
47 | text += t.readLine() + "<br>"; | 47 | text += t.readLine() + "<br>"; |
48 | } | 48 | } |
49 | f.close(); | 49 | f.close(); |
50 | } | 50 | } |
51 | /* text += "<br><br>`"; | 51 | /* text += "<br><br>`"; |
52 | text += _doc->exec(); | 52 | text += _doc->exec(); |
53 | text += "`";*/ | 53 | text += "`";*/ |
54 | QStringList list = _doc->mimeTypes(); | 54 | QStringList list = _doc->mimeTypes(); |
55 | int i = 0; | 55 | int i = 0; |
56 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 56 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
57 | text += QString::number( i++) + " - " + *it ; | 57 | text += QString::number( i++) + " - " + *it ; |
58 | } | 58 | } |
59 | return text; | 59 | return text; |
60 | } | 60 | } |
61 | 61 | ||
62 | void DocLnkItem::action( int act ) | 62 | void DocLnkItem::action( int act ) |
63 | { | 63 | { |
64 | qDebug("action %i",act); | 64 | qDebug("action %i",act); |
65 | if (!_doc->isValid()) qDebug("INVALID"); | 65 | if (!_doc->isValid()) qDebug("INVALID"); |
66 | if (act == 0) _doc->execute(); | 66 | if (act == 0) _doc->execute(); |
67 | else if (act == 1){ | 67 | else if (act == 1){ |
68 | QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); | 68 | QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); |
69 | e << _doc->file(); | 69 | e << _doc->file(); |
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | QIntDict<QString> DocLnkItem::actions() | 73 | QIntDict<QString> DocLnkItem::actions() |
74 | { | 74 | { |
75 | QIntDict<QString> result; | 75 | QIntDict<QString> result; |
76 | result.insert( 0, new QString( QObject::tr("open with ") + _doc->exec() ) ); | 76 | result.insert( 0, new QString( QObject::tr("open with ") + _doc->exec() ) ); |
77 | result.insert( 1, new QString( QObject::tr("open in filemanager") ) ); | 77 | result.insert( 1, new QString( QObject::tr("open in filemanager") ) ); |
78 | return result; | 78 | return result; |
79 | } | 79 | } |