Fixed Valentina crash after undo deleting detail.
Emitting signal in lambda was not really good idea. --HG-- branch : develop
This commit is contained in:
parent
8b438daa6c
commit
fc7e0bb6cb
|
@ -1052,6 +1052,18 @@ void VAbstractPattern::haveLiteChange()
|
|||
emit patternChanged(false);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractPattern::NeedFullParsing()
|
||||
{
|
||||
emit UndoCommand();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractPattern::ClearScene()
|
||||
{
|
||||
emit ClearMainWindow();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractPattern::ToolExists(const quint32 &id) const
|
||||
{
|
||||
|
|
|
@ -253,6 +253,8 @@ signals:
|
|||
public slots:
|
||||
virtual void LiteParseTree(const Document &parse)=0;
|
||||
void haveLiteChange();
|
||||
void NeedFullParsing();
|
||||
void ClearScene();
|
||||
|
||||
protected:
|
||||
/** @brief nameActivDraw name current pattern peace. */
|
||||
|
|
|
@ -143,8 +143,8 @@ void VToolBasePoint::AddToFile()
|
|||
patternPiece.appendChild(doc->createElement(VAbstractPattern::TagDetails));
|
||||
|
||||
AddPatternPiece *addPP = new AddPatternPiece(patternPiece, doc, namePP);
|
||||
connect(addPP, &AddPatternPiece::ClearScene, [this](){emit doc->ClearMainWindow();});
|
||||
connect(addPP, &AddPatternPiece::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
connect(addPP, &AddPatternPiece::ClearScene, doc, &VAbstractPattern::ClearScene);
|
||||
connect(addPP, &AddPatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
qApp->getUndoStack()->push(addPP);
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ void VToolBasePoint::DeleteTool(bool ask)
|
|||
|
||||
qCDebug(vTool, "Begin deleting.");
|
||||
DeletePatternPiece *deletePP = new DeletePatternPiece(doc, nameActivDraw);
|
||||
connect(deletePP, &DeletePatternPiece::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
connect(deletePP, &DeletePatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
qApp->getUndoStack()->push(deletePP);
|
||||
|
||||
// Throw exception, this will help prevent case when we forget to immediately quit function.
|
||||
|
|
|
@ -372,7 +372,7 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine
|
|||
void VDrawTool::AddToCalculation(const QDomElement &domElement)
|
||||
{
|
||||
AddToCalc *addToCal = new AddToCalc(domElement, doc);
|
||||
connect(addToCal, &AddToCalc::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
connect(addToCal, &AddToCalc::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
qApp->getUndoStack()->push(addToCal);
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ void VAbstractTool::DeleteTool(bool ask)
|
|||
|
||||
qCDebug(vTool, "Begin deleting.");
|
||||
DelTool *delTool = new DelTool(doc, id);
|
||||
connect(delTool, &DelTool::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
connect(delTool, &DelTool::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
qApp->getUndoStack()->push(delTool);
|
||||
|
||||
// Throw exception, this will help prevent case when we forget to immediately quit function.
|
||||
|
|
|
@ -331,7 +331,7 @@ void VToolDetail::AddToFile()
|
|||
}
|
||||
|
||||
AddDet *addDet = new AddDet(domElement, doc, detail, drawName);
|
||||
connect(addDet, &AddDet::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
connect(addDet, &AddDet::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
qApp->getUndoStack()->push(addDet);
|
||||
}
|
||||
|
||||
|
@ -680,7 +680,7 @@ void VToolDetail::DeleteTool(bool ask)
|
|||
return;
|
||||
}
|
||||
/* If UnionDetails tool delete detail no need emit FullParsing.*/
|
||||
connect(delDet, &DeleteDetail::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
connect(delDet, &DeleteDetail::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
}
|
||||
qApp->getUndoStack()->push(delDet);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user