summaryrefslogtreecommitdiff
path: root/core
authortille <tille>2003-05-12 14:31:12 (UTC)
committer tille <tille>2003-05-12 14:31:12 (UTC)
commitca02db5ebfc5e44c3b216c12757683bac246ba23 (patch) (unidiff)
tree76ac70e5ae3a434b195d2eb42885357984f0a1fd /core
parent0529ba8905f07e3eafaa36920e13b8619b09d5b1 (diff)
downloadopie-ca02db5ebfc5e44c3b216c12757683bac246ba23.zip
opie-ca02db5ebfc5e44c3b216c12757683bac246ba23.tar.gz
opie-ca02db5ebfc5e44c3b216c12757683bac246ba23.tar.bz2
add open in filemanager
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/applnkitem.cpp11
-rw-r--r--core/pim/osearch/doclnkitem.cpp11
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
@@ -4,24 +4,26 @@
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 "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
17AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app) 19AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app)
18 : ResultItem(parent) 20 : ResultItem(parent)
19{ 21{
20 _app = app; 22 _app = app;
21 setText(0, _app->name() ); 23 setText(0, _app->name() );
22} 24}
23 25
24 26
25AppLnkItem::~AppLnkItem() 27AppLnkItem::~AppLnkItem()
26{ 28{
27} 29}
@@ -31,20 +33,29 @@ QString AppLnkItem::toRichText()
31{ 33{
32 QString text; 34 QString text;
33 text += "<b><h3>" + _app->name() + "</b></h3><br>"; 35 text += "<b><h3>" + _app->name() + "</b></h3><br>";
34 text += _app->comment() + "<br>"; 36 text += _app->comment() + "<br>";
35 text += "<br>`" + _app->exec() + "`<br>"; 37 text += "<br>`" + _app->exec() + "`<br>";
36 return text; 38 return text;
37} 39}
38 40
39void AppLnkItem::action( int act ) 41void 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
45QIntDict<QString> AppLnkItem::actions() 55QIntDict<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
@@ -6,24 +6,26 @@
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>
19#include <qpe/qcopenvelope_qws.h>
18 20
19DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app) 21DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app)
20 : ResultItem(parent) 22 : ResultItem(parent)
21{ 23{
22 _doc = app; 24 _doc = app;
23 setText(0, _doc->name() ); 25 setText(0, _doc->name() );
24} 26}
25 27
26DocLnkItem::~DocLnkItem() 28DocLnkItem::~DocLnkItem()
27{ 29{
28} 30}
29 31
@@ -51,20 +53,29 @@ QString DocLnkItem::toRichText()
51 int i = 0; 53 int i = 0;
52 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { 54 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
53 text += QString::number( i++) + " - " + *it ; 55 text += QString::number( i++) + " - " + *it ;
54 } 56 }
55 return text; 57 return text;
56} 58}
57 59
58void DocLnkItem::action( int act ) 60void DocLnkItem::action( int act )
59{ 61{
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
65QIntDict<QString> DocLnkItem::actions() 75QIntDict<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}