#endif
ModuleBase_OperationFeature::ModuleBase_OperationFeature(const QString& theId, QObject* theParent)
-: ModuleBase_Operation(theId, theParent),
- myIsEditing(false)
+: ModuleBase_Operation(theId, theParent), myIsEditing(false), myNeedToBeAborted(false)
{
}
}*/
}
- if (theFlushMessage) {
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
- }
+ //if (theFlushMessage) {
+ // Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
+ // Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+ //}
return myFeature;
}
if (aFeature) {
if (aFeature == theObj)
return true;
- std::list<ResultPtr> aResults;
- ModelAPI_Tools::allResults(aFeature, aResults);
- std::list<ResultPtr>::const_iterator aIt;
- for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
- ResultPtr aResult = *aIt;
- if (theObj == aResult)
- return true;
+ ResultPtr anObjRes = std::dynamic_pointer_cast<ModelAPI_Result>(theObj);
+ if (anObjRes.get() && aFeature == aFeature->document()->feature(anObjRes)) {
+ return true;
}
#ifdef DEBUG_DO_NOT_ACTIVATE_SUB_FEATURE
if (aFeature->isMacro()) {
if (anActiveWidget && anActiveWidget->getValueState() == ModuleBase_ModelWidget::ModifiedInPP) {
anActiveWidget->storeValue();
}
+ aPanel->onAcceptData();
}
if (canBeCommitted()) {
emit beforeCommitted();
myFeature->setStable(true);
- SessionPtr aMgr = ModelAPI_Session::get();
- /// Set current feature and remeber old current feature
-
commitOperation();
- aMgr->finishOperation();
stopOperation();
+
+ SessionPtr aMgr = ModelAPI_Session::get();
+ aMgr->finishOperation();
+ // Finish operation has to be before stopped because stopped caused update of Object browser
+ // If it will be done before of cleaning of obsolete objects it will cause crash
emit stopped();
emit committed();