1 #include "adaptormodel.h"
2 #include <QtCore/QMetaObject>
3 #include <QtCore/QString>
4 #include <QtCore/QVariant>
8 extern QString vymInstanceName;
10 AdaptorModel::AdaptorModel(QObject *obj)
11 : QDBusAbstractAdaptor(obj)
13 model=static_cast <VymModel*> (obj);
14 setAutoRelaySignals (true);
17 AdaptorModel::~AdaptorModel()
22 void AdaptorModel::setModel(VymModel *vm)
27 QString AdaptorModel::caption()
32 void AdaptorModel::setCaption (const QString &newCaption)
37 QDBusVariant AdaptorModel::query(const QString &query)
41 s=model->getHeading();
43 s="oops, no vymModel?";
45 return QDBusVariant (s);
48 QDBusVariant AdaptorModel::getHeading()
52 s=model->getHeading();
54 s="oops, no vymModel?";
56 return QDBusVariant (s);
60 void AdaptorModel::setHeading (const QString &s)
65 QDBusVariant AdaptorModel::getInstanceName()
67 return QDBusVariant (vymInstanceName);
70 QDBusVariant AdaptorModel::execute (const QString &s)
73 return QDBusVariant (model->runScript (s));
75 return QDBusVariant ("No model.");