Minor changes to improve remote execution of commands via DBUS
authorinsilmaril
Tue, 09 Mar 2010 09:37:57 +0000
changeset 8326a6018ba4cc7
parent 831 25a950c2eb98
child 833 bfacef6f29c1
Minor changes to improve remote execution of commands via DBUS
adaptormodel.cpp
adaptormodel.h
mainwindow.cpp
mainwindow.h
vymmodel.cpp
     1.1 --- a/adaptormodel.cpp	Tue Mar 09 08:29:09 2010 +0000
     1.2 +++ b/adaptormodel.cpp	Tue Mar 09 09:37:57 2010 +0000
     1.3 @@ -3,9 +3,11 @@
     1.4  #include <QtCore/QString>
     1.5  #include <QtCore/QVariant>
     1.6  
     1.7 +#include "mainwindow.h"
     1.8  #include "vymmodel.h"
     1.9  
    1.10  extern QString vymInstanceName;
    1.11 +extern Main *mainWindow;
    1.12  
    1.13  AdaptorModel::AdaptorModel(QObject *obj)
    1.14           : QDBusAbstractAdaptor(obj)
    1.15 @@ -45,6 +47,11 @@
    1.16  	return QDBusVariant (s);
    1.17  }
    1.18  
    1.19 +QDBusVariant AdaptorModel::getCurrentModelID()
    1.20 +{
    1.21 +	return QDBusVariant (mainWindow->currentModelID());
    1.22 +}
    1.23 +
    1.24  QDBusVariant AdaptorModel::getHeading()
    1.25  {
    1.26  	QString s;
     2.1 --- a/adaptormodel.h	Tue Mar 09 08:29:09 2010 +0000
     2.2 +++ b/adaptormodel.h	Tue Mar 09 09:37:57 2010 +0000
     2.3 @@ -28,6 +28,7 @@
     2.4  	void setCaption(const QString &newCaption);
     2.5  public slots: // METHODS
     2.6     QDBusVariant query(const QString &query);
     2.7 +   QDBusVariant getCurrentModelID();
     2.8     QDBusVariant getHeading();
     2.9     void setHeading (const QString &s);
    2.10     QDBusVariant getInstanceName();
     3.1 --- a/mainwindow.cpp	Tue Mar 09 08:29:09 2010 +0000
     3.2 +++ b/mainwindow.cpp	Tue Mar 09 09:37:57 2010 +0000
     3.3 @@ -1913,6 +1913,13 @@
     3.4  	return NULL;	
     3.5  }
     3.6  
     3.7 +uint  Main::currentModelID() const
     3.8 +{
     3.9 +	if (currentModel())
    3.10 +		return currentModel()->getID();
    3.11 +	return 0;	
    3.12 +}
    3.13 +
    3.14  VymModel* Main::currentModel() const
    3.15  {
    3.16  	if ( tabWidget->currentPage())
     4.1 --- a/mainwindow.h	Tue Mar 09 08:29:09 2010 +0000
     4.2 +++ b/mainwindow.h	Tue Mar 09 09:37:57 2010 +0000
     4.3 @@ -74,6 +74,7 @@
     4.4  	MapEditor* currentMapEditor() const;
     4.5  	VymModel* currentModel() const;
     4.6  public:	
     4.7 +	uint currentModelID() const;
     4.8  	VymModel* getModel(uint) const;
     4.9      
    4.10  private slots:
     5.1 --- a/vymmodel.cpp	Tue Mar 09 08:29:09 2010 +0000
     5.2 +++ b/vymmodel.cpp	Tue Mar 09 09:37:57 2010 +0000
     5.3 @@ -3149,7 +3149,7 @@
     5.4  	double x,y;
     5.5  	int n;
     5.6  	bool b,ok;
     5.7 -	QVariant returnValue;
     5.8 +	QVariant returnValue="";
     5.9  
    5.10  	// Split string s into command and parameters
    5.11  	parser.parseAtom (atom);
    5.12 @@ -4183,6 +4183,7 @@
    5.13  		qWarning(parser.errorMessage());
    5.14  		noErr=false;
    5.15  		errorMsg=parser.errorMessage();
    5.16 +		returnValue=errorMsg;
    5.17  	} 
    5.18  	return returnValue;
    5.19  }