TaskDlgEditSketch: Remove unnecessary recompute

===============================================

On Undo/Redo there should not be an unconditional recompute.

The need for this recompute is probably related to the fact that PropertyConstraintList
has invalid geometry keys.
This commit is contained in:
Abdullah Tahiri
2020-06-11 20:09:02 +02:00
committed by wwmayer
parent 7ae2fc7b05
commit 58e459cde1
2 changed files with 2 additions and 24 deletions

View File

@@ -32,7 +32,6 @@
#include <Gui/Command.h>
using namespace SketcherGui;
namespace bp = boost::placeholders;
//**************************************************************************
@@ -73,19 +72,10 @@ TaskDlgEditSketch::TaskDlgEditSketch(ViewProviderSketch *sketchView)
Constraints->hideGroupBox();
if (!hGrp->GetBool("ExpandedElementsWidget",true))
Elements->hideGroupBox();
App::Document* document = sketchView->getObject()->getDocument();
connectUndoDocument =
document->signalUndo.connect(boost::bind(&TaskDlgEditSketch::slotUndoDocument, this, bp::_1));
connectRedoDocument =
document->signalRedo.connect(boost::bind(&TaskDlgEditSketch::slotRedoDocument, this, bp::_1));
}
TaskDlgEditSketch::~TaskDlgEditSketch()
{
connectUndoDocument.disconnect();
connectRedoDocument.disconnect();
// to make sure to delete the advanced solver panel
// it must be part to the 'Content' array
std::vector<QWidget*>::iterator it = std::find(Content.begin(), Content.end(), SolverAdvanced);
@@ -93,16 +83,6 @@ TaskDlgEditSketch::~TaskDlgEditSketch()
Content.push_back(SolverAdvanced);
}
void TaskDlgEditSketch::slotUndoDocument(const App::Document& doc)
{
const_cast<App::Document&>(doc).recomputeFeature(sketchView->getObject());
}
void TaskDlgEditSketch::slotRedoDocument(const App::Document& doc)
{
const_cast<App::Document&>(doc).recomputeFeature(sketchView->getObject());
}
//==== calls from the TaskView ===============================================================
@@ -129,7 +109,7 @@ bool TaskDlgEditSketch::reject()
hGrp->SetBool("ExpandedEditControlWidget",General->isGroupVisible());
hGrp->SetBool("ExpandedConstraintsWidget",Constraints->isGroupVisible());
hGrp->SetBool("ExpandedElementsWidget",Elements->isGroupVisible());
std::string document = getDocumentName(); // needed because resetEdit() deletes this instance
Gui::Command::doCommand(Gui::Command::Gui,"Gui.getDocument('%s').resetEdit()", document.c_str());
Gui::Command::doCommand(Gui::Command::Doc,"App.getDocument('%s').recompute()", document.c_str());

View File

@@ -62,7 +62,7 @@ public:
virtual bool isAllowedAlterDocument(void) const
{ return false; }
/// returns for Close and Help button
/// returns for Close and Help button
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
{ return QDialogButtonBox::Close; }
@@ -77,8 +77,6 @@ protected:
TaskSketcherGeneral *General;
TaskSketcherMessages *Messages;
TaskSketcherSolverAdvanced *SolverAdvanced;
Connection connectUndoDocument;
Connection connectRedoDocument;
};