Refactor methods names for better readability.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-10-19 11:24:21 +03:00
parent 8eecfe78a3
commit 71b5a17aa1
14 changed files with 20 additions and 20 deletions

View file

@ -433,7 +433,7 @@ void VAbstractOperation::DeleteFromLabel()
{
try
{
DeleteTool();
DeleteToolWithConfirm();
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -253,7 +253,7 @@ void VAbstractSpline::keyReleaseEvent(QKeyEvent *event)
case Qt::Key_Delete:
try
{
DeleteTool();
DeleteToolWithConfirm();
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -326,7 +326,7 @@ void VToolDoublePoint::keyReleaseEvent(QKeyEvent *event)
case Qt::Key_Delete:
try
{
DeleteTool();
DeleteToolWithConfirm();
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -257,7 +257,7 @@ void VToolBasePoint::SetBasePointPos(const QPointF &pos)
}
//---------------------------------------------------------------------------------------------------------------------
void VToolBasePoint::DeleteTool(bool ask)
void VToolBasePoint::DeleteToolWithConfirm(bool ask)
{
qCDebug(vTool, "Deleting base point.");
qApp->getSceneView()->itemClicked(nullptr);

View file

@ -89,7 +89,7 @@ signals:
protected:
virtual void AddToFile() Q_DECL_OVERRIDE;
virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value ) Q_DECL_OVERRIDE;
virtual void DeleteTool(bool ask = true) Q_DECL_OVERRIDE;
virtual void DeleteToolWithConfirm(bool ask = true) Q_DECL_OVERRIDE;
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE;
virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;

View file

@ -280,7 +280,7 @@ void VToolSinglePoint::keyReleaseEvent(QKeyEvent *event)
case Qt::Key_Delete:
try
{
DeleteTool();
DeleteToolWithConfirm();
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -62,7 +62,7 @@ void VAbstractPoint::DeleteFromLabel()
{
try
{
DeleteTool();
DeleteToolWithConfirm();
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -207,7 +207,7 @@ void VDrawTool::ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemI
else if (selectedAction == actionRemove)
{
qCDebug(vTool, "Deleting tool.");
DeleteTool(); // do not catch exception here
DeleteToolWithConfirm(); // do not catch exception here
return; //Leave this method immediately after call!!!
}
else if (selectedAction == actionShowLabel)

View file

@ -346,7 +346,7 @@ void VToolLine::keyReleaseEvent(QKeyEvent *event)
case Qt::Key_Delete:
try
{
DeleteTool();
DeleteToolWithConfirm();
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -236,7 +236,7 @@ qreal VAbstractTool::CheckFormula(const quint32 &toolId, QString &formula, VCont
/**
* @brief DeleteTool full delete object form scene and file.
*/
void VAbstractTool::DeleteTool(bool ask)
void VAbstractTool::DeleteToolWithConfirm(bool ask)
{
qCDebug(vTool, "Deleting abstract tool.");
if (_referens <= 1)

View file

@ -158,7 +158,7 @@ protected:
* @brief RemoveReferens decrement value of reference.
*/
virtual void RemoveReferens() {}
virtual void DeleteTool(bool ask = true);
virtual void DeleteToolWithConfirm(bool ask = true);
static int ConfirmDeletion();
template <typename T>

View file

@ -153,11 +153,11 @@ VToolSeamAllowance *VToolSeamAllowance::Create(VToolSeamAllowanceInitData &initD
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::Remove(bool ask)
void VToolSeamAllowance::RemoveWithConfirm(bool ask)
{
try
{
DeleteTool(ask);
DeleteToolWithConfirm(ask);
}
catch(const VExceptionToolWasDeleted &e)
{
@ -1129,7 +1129,7 @@ void VToolSeamAllowance::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
try
{
DeleteTool();
DeleteToolWithConfirm();
}
catch(const VExceptionToolWasDeleted &e)
{
@ -1158,10 +1158,10 @@ void VToolSeamAllowance::keyReleaseEvent(QKeyEvent *event)
for(int i=0; i < toolList.size(); ++i)
{
toolList.at(i)->Remove(false);
toolList.at(i)->RemoveWithConfirm(false);
}
}
DeleteTool(false);
DeleteToolWithConfirm(false);
}
catch(const VExceptionToolWasDeleted &e)
{
@ -1585,7 +1585,7 @@ void VToolSeamAllowance::InitPins(const VPiece &detail)
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::DeleteTool(bool ask)
void VToolSeamAllowance::DeleteToolWithConfirm(bool ask)
{
QScopedPointer<DeletePiece> delDet(new DeletePiece(doc, m_id, VAbstractTool::data, m_sceneDetails));
if (ask)

View file

@ -86,7 +86,7 @@ public:
static const QString AttrTopPin;
static const QString AttrBottomPin;
void Remove(bool ask);
void RemoveWithConfirm(bool ask);
static void InsertNode(VPieceNode node, quint32 pieceId, VMainGraphicsScene *scene, VContainer *data,
VAbstractPattern *doc);
@ -149,7 +149,7 @@ protected:
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) Q_DECL_OVERRIDE;
virtual void keyReleaseEvent(QKeyEvent * event) Q_DECL_OVERRIDE;
virtual void SetVisualization() Q_DECL_OVERRIDE {}
virtual void DeleteTool(bool ask = true) Q_DECL_OVERRIDE;
virtual void DeleteToolWithConfirm(bool ask = true) Q_DECL_OVERRIDE;
virtual void ToolCreation(const Source &typeCreation) Q_DECL_OVERRIDE;
virtual void SetDialog() Q_DECL_FINAL;
virtual void SaveDialogChange() Q_DECL_FINAL;

View file

@ -1368,7 +1368,7 @@ void CreateUnitedDetail(const VToolUnionDetailsInitData &initData, qreal dx, qre
VToolSeamAllowance *toolDet = qobject_cast<VToolSeamAllowance*>(VAbstractPattern::getTool(id));
SCASSERT(toolDet != nullptr);
bool ask = false;
toolDet->Remove(ask);
toolDet->RemoveWithConfirm(ask);
};
if (not initData.retainPieces)