From: sbh Date: Tue, 8 Apr 2014 14:41:44 +0000 (+0400) Subject: Creation of feature moved from constructor into "startOperation" method. X-Git-Tag: V_0.1~35 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2e305d9260f4e150955f25e570838fd45952f2cb;p=modules%2Fshaper.git Creation of feature moved from constructor into "startOperation" method. --- diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index b3250ff01..1fc489795 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -13,6 +13,10 @@ #include #include +#ifdef _DEBUG +#include +#endif + /*! \brief Constructor \param XGUI_Workshop - workshop for this operation @@ -29,7 +33,6 @@ ModuleBase_Operation::ModuleBase_Operation(const QString& theId, QObject* parent myExecStatus(Rejected), myOperationId(theId) { - myFeature = ModelAPI_PluginManager::get()->createFeature(theId.toStdString()); } /*! @@ -251,6 +254,13 @@ void ModuleBase_Operation::commit() */ void ModuleBase_Operation::storeReal(double theValue) { + if(!myFeature){ + #ifdef _DEBUG + qDebug() << "ModuleBase_Operation::storeReal: " << + "trying to store value without opening a transaction."; + #endif + return; + } QString anId = sender()->objectName(); std::shared_ptr aData = myFeature->data(); std::shared_ptr aReal = aData->real(anId.toStdString()); @@ -276,6 +286,7 @@ bool ModuleBase_Operation::isReadyToStart() const */ void ModuleBase_Operation::startOperation() { + myFeature = ModelAPI_PluginManager::get()->createFeature(myOperationId.toStdString()); //emit callSlot(); //commit(); }