adaptormodel.cpp
author insilmaril
Thu, 17 Sep 2009 09:41:09 +0000
changeset 795 6b0a5f4923d3
parent 785 5987f9f15bac
child 804 14f2b1b15242
permissions -rw-r--r--
Fixed sort children and addMapReplaceInt
     1 #include "adaptormodel.h"
     2 #include <QtCore/QMetaObject>
     3 #include <QtCore/QString>
     4 #include <QtCore/QVariant>
     5 
     6 #include "vymmodel.h"
     7 
     8 AdaptorModel::AdaptorModel(QObject *obj)
     9          : QDBusAbstractAdaptor(obj)
    10 {
    11 	model=static_cast <VymModel*> (obj);
    12 	setAutoRelaySignals (true);
    13 }
    14 
    15 AdaptorModel::~AdaptorModel()
    16 {
    17     // destructor
    18 }
    19 
    20 void AdaptorModel::setModel(VymModel *vm)
    21 {
    22 	model=vm;
    23 }
    24 
    25 QString AdaptorModel::caption()
    26 {
    27 	return m_caption;
    28 }
    29 
    30 void AdaptorModel::setCaption (const QString &newCaption)
    31 {
    32 	m_caption=newCaption;
    33 }
    34 
    35 QDBusVariant AdaptorModel::query(const QString &query)
    36 {
    37 	QString s;
    38 	if (model)
    39 		s=model->getHeading();
    40 	else
    41 		s="oops, no vymModel?";
    42 
    43 	return QDBusVariant (s);
    44 }
    45 
    46 QDBusVariant AdaptorModel::getHeading()
    47 {
    48 	QString s;
    49 	if (model)
    50 		s=model->getHeading();
    51 	else
    52 		s="oops, no vymModel?";
    53 
    54 	return QDBusVariant (s);
    55 }
    56 
    57