// // // C++ Implementation: $MODULE$ // // Description: // // // Author: Patrick S. Vogt , (C) 2003 // // Copyright: See COPYING file that comes with this distribution // // #include "applnkitem.h" #include #include #include AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app) : ResultItem(parent) { _app = app; setText(0, _app->name() ); setPixmap(0, _app->pixmap() ); } AppLnkItem::~AppLnkItem() { } QString AppLnkItem::toRichText() { QString text; text += "

" + _app->name() + "


"; text += _app->comment() + "
"; text += "
`" + _app->exec() + "`
"; text += "
`" + _app->file() + "`
"; text += "
`" + _app->linkFile() + "`
"; return text; } void AppLnkItem::action( int act ) { if (!_app->isValid()) qDebug("INVALID"); if (act == 0) _app->execute(); else if (act == 1){ QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); e << _app->linkFile(); } } QIntDict AppLnkItem::actions() { QIntDict result; result.insert( 0, new QString( QObject::tr("execute") ) ); result.insert( 1, new QString( QObject::tr("open in filemanager") ) ); return result; }