Fix duplicate calculation at Task validation
This commit is contained in:
committed by
Yorik van Havre
parent
866a274268
commit
151be5af1a
@@ -90,7 +90,7 @@ TaskDlgFeatureParameters::~TaskDlgFeatureParameters() = default;
|
||||
bool TaskDlgFeatureParameters::accept()
|
||||
{
|
||||
App::DocumentObject* feature = getObject();
|
||||
|
||||
bool isUpdateBlocked = false;
|
||||
try {
|
||||
// Iterate over parameter dialogs and apply all parameters from them
|
||||
for ( QWidget *wgt : Content ) {
|
||||
@@ -100,6 +100,7 @@ bool TaskDlgFeatureParameters::accept()
|
||||
|
||||
param->saveHistory ();
|
||||
param->apply ();
|
||||
isUpdateBlocked |= param->isUpdateBlocked();
|
||||
}
|
||||
// Make sure the feature is what we are expecting
|
||||
// Should be fine but you never know...
|
||||
@@ -107,7 +108,12 @@ bool TaskDlgFeatureParameters::accept()
|
||||
throw Base::TypeError("Bad object processed in the feature dialog.");
|
||||
}
|
||||
|
||||
Gui::cmdAppDocument(feature, "recompute()");
|
||||
if(isUpdateBlocked){
|
||||
Gui::cmdAppDocument(feature, "recompute()");
|
||||
} else {
|
||||
// object was already computed
|
||||
Gui::cmdAppDocument(feature, "purgeTouched()");
|
||||
}
|
||||
|
||||
if (!feature->isValid()) {
|
||||
throw Base::RuntimeError(getObject()->getStatusString());
|
||||
|
||||
@@ -51,6 +51,11 @@ public:
|
||||
|
||||
void recomputeFeature();
|
||||
|
||||
bool isUpdateBlocked() const
|
||||
{
|
||||
return blockUpdate;
|
||||
}
|
||||
|
||||
protected Q_SLOTS:
|
||||
// TODO Add update view to all dialogs (2015-12-05, Fat-Zer)
|
||||
void onUpdateView(bool on);
|
||||
@@ -88,11 +93,6 @@ protected:
|
||||
return obj ? obj->getDocument() : nullptr;
|
||||
}
|
||||
|
||||
bool isUpdateBlocked() const
|
||||
{
|
||||
return blockUpdate;
|
||||
}
|
||||
|
||||
bool& getUpdateBlockRef()
|
||||
{
|
||||
return blockUpdate;
|
||||
|
||||
Reference in New Issue
Block a user