author | tille <tille> | 2003-05-12 14:31:12 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-12 14:31:12 (UTC) |
commit | ca02db5ebfc5e44c3b216c12757683bac246ba23 (patch) (unidiff) | |
tree | 76ac70e5ae3a434b195d2eb42885357984f0a1fd | |
parent | 0529ba8905f07e3eafaa36920e13b8619b09d5b1 (diff) | |
download | opie-ca02db5ebfc5e44c3b216c12757683bac246ba23.zip opie-ca02db5ebfc5e44c3b216c12757683bac246ba23.tar.gz opie-ca02db5ebfc5e44c3b216c12757683bac246ba23.tar.bz2 |
add open in filemanager
-rw-r--r-- | core/pim/osearch/applnkitem.cpp | 11 | ||||
-rw-r--r-- | core/pim/osearch/doclnkitem.cpp | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/core/pim/osearch/applnkitem.cpp b/core/pim/osearch/applnkitem.cpp index 2152da4..1e7b1fb 100644 --- a/core/pim/osearch/applnkitem.cpp +++ b/core/pim/osearch/applnkitem.cpp | |||
@@ -13,6 +13,8 @@ | |||
13 | #include "applnkitem.h" | 13 | #include "applnkitem.h" |
14 | 14 | ||
15 | #include <qpe/applnk.h> | 15 | #include <qpe/applnk.h> |
16 | #include <qfileinfo.h> | ||
17 | #include <qpe/qcopenvelope_qws.h> | ||
16 | 18 | ||
17 | AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app) | 19 | AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app) |
18 | : ResultItem(parent) | 20 | : ResultItem(parent) |
@@ -40,11 +42,20 @@ void AppLnkItem::action( int act ) | |||
40 | { | 42 | { |
41 | if (!_app->isValid()) qDebug("INVALID"); | 43 | if (!_app->isValid()) qDebug("INVALID"); |
42 | if (act == 0) _app->execute(); | 44 | if (act == 0) _app->execute(); |
45 | else if (act == 1){ | ||
46 | QFileInfo file( _app->file() ); | ||
47 | qDebug("opening %s in filemanager", file.dirPath().latin1()); | ||
48 | QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); | ||
49 | e << file.dirPath(); | ||
50 | // QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); | ||
51 | // e << _app->file(); | ||
52 | } | ||
43 | } | 53 | } |
44 | 54 | ||
45 | QIntDict<QString> AppLnkItem::actions() | 55 | QIntDict<QString> AppLnkItem::actions() |
46 | { | 56 | { |
47 | QIntDict<QString> result; | 57 | QIntDict<QString> result; |
48 | result.insert( 0, new QString( QObject::tr("execute") ) ); | 58 | result.insert( 0, new QString( QObject::tr("execute") ) ); |
59 | result.insert( 1, new QString( QObject::tr("open in filemanager") ) ); | ||
49 | return result; | 60 | return result; |
50 | } | 61 | } |
diff --git a/core/pim/osearch/doclnkitem.cpp b/core/pim/osearch/doclnkitem.cpp index 75dee58..04d08ca 100644 --- a/core/pim/osearch/doclnkitem.cpp +++ b/core/pim/osearch/doclnkitem.cpp | |||
@@ -15,6 +15,8 @@ | |||
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> | ||
19 | #include <qpe/qcopenvelope_qws.h> | ||
18 | 20 | ||
19 | DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app) | 21 | DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app) |
20 | : ResultItem(parent) | 22 | : ResultItem(parent) |
@@ -60,11 +62,20 @@ void DocLnkItem::action( int act ) | |||
60 | qDebug("action %i",act); | 62 | qDebug("action %i",act); |
61 | if (!_doc->isValid()) qDebug("INVALID"); | 63 | if (!_doc->isValid()) qDebug("INVALID"); |
62 | if (act == 0) _doc->execute(); | 64 | if (act == 0) _doc->execute(); |
65 | else if (act == 1){ | ||
66 | QFileInfo file( _doc->file() ); | ||
67 | qDebug("opening %s in filemanager", file.dirPath().latin1()); | ||
68 | QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); | ||
69 | e << file.dirPath(); | ||
70 | // QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); | ||
71 | // e << _doc->file(); | ||
72 | } | ||
63 | } | 73 | } |
64 | 74 | ||
65 | QIntDict<QString> DocLnkItem::actions() | 75 | QIntDict<QString> DocLnkItem::actions() |
66 | { | 76 | { |
67 | QIntDict<QString> result; | 77 | QIntDict<QString> result; |
68 | result.insert( 0, new QString( QObject::tr("open with ") + _doc->exec() ) ); | 78 | result.insert( 0, new QString( QObject::tr("open with ") + _doc->exec() ) ); |
79 | result.insert( 1, new QString( QObject::tr("open in filemanager") ) ); | ||
69 | return result; | 80 | return result; |
70 | } | 81 | } |