[TD] make pointers to the UI std::unique_ptr
as noted in https://github.com/FreeCAD/FreeCAD/pull/4271#discussion_r554673632 the pointer to the UI should be a unique pointer. This PR does this for all TD dialogs that don't already use a unique_ptr.
This commit is contained in:
@@ -89,7 +89,6 @@ TaskActiveView::TaskActiveView(TechDraw::DrawPage* pageFeat) :
|
||||
|
||||
TaskActiveView::~TaskActiveView()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskActiveView::updateTask()
|
||||
|
||||
@@ -80,7 +80,7 @@ protected:
|
||||
TechDraw::DrawViewSymbol* createActiveView(void);
|
||||
|
||||
private:
|
||||
Ui_TaskActiveView* ui;
|
||||
std::unique_ptr<Ui_TaskActiveView> ui;
|
||||
|
||||
TechDraw::DrawPage* m_pageFeat;
|
||||
TechDraw::DrawViewSymbol* m_symbolFeat;
|
||||
|
||||
@@ -111,7 +111,6 @@ TaskBalloon::TaskBalloon(QGIViewBalloon *parent, ViewProviderBalloon *balloonVP)
|
||||
|
||||
TaskBalloon::~TaskBalloon()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool TaskBalloon::accept()
|
||||
|
||||
@@ -63,7 +63,7 @@ private Q_SLOTS:
|
||||
void onKinkLengthChanged();
|
||||
|
||||
private:
|
||||
Ui_TaskBalloon *ui;
|
||||
std::unique_ptr<Ui_TaskBalloon> ui;
|
||||
QGIViewBalloon *m_parent;
|
||||
ViewProviderBalloon* m_balloonVP;
|
||||
};
|
||||
|
||||
@@ -156,7 +156,6 @@ TaskCenterLine::TaskCenterLine(TechDraw::DrawViewPart* partFeat,
|
||||
|
||||
TaskCenterLine::~TaskCenterLine()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskCenterLine::updateTask()
|
||||
|
||||
@@ -130,7 +130,7 @@ private Q_SLOTS:
|
||||
void onFlipChanged();
|
||||
|
||||
private:
|
||||
Ui_TaskCenterLine * ui;
|
||||
std::unique_ptr<Ui_TaskCenterLine> ui;
|
||||
|
||||
TechDraw::DrawViewPart* m_partFeat;
|
||||
TechDraw::DrawPage* m_basePage;
|
||||
|
||||
@@ -115,7 +115,6 @@ TaskCosVertex::TaskCosVertex(TechDraw::DrawViewPart* baseFeat,
|
||||
|
||||
TaskCosVertex::~TaskCosVertex()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskCosVertex::updateTask()
|
||||
|
||||
@@ -100,7 +100,7 @@ protected:
|
||||
QGIView* findParentQGIV();
|
||||
|
||||
private:
|
||||
Ui_TaskCosVertex * ui;
|
||||
std::unique_ptr<Ui_TaskCosVertex> ui;
|
||||
bool blockUpdate;
|
||||
|
||||
QGTracker* m_tracker;
|
||||
|
||||
@@ -126,7 +126,6 @@ TaskCosmeticLine::TaskCosmeticLine(TechDraw::DrawViewPart* partFeat,
|
||||
|
||||
TaskCosmeticLine::~TaskCosmeticLine()
|
||||
{
|
||||
delete ui;
|
||||
if (m_saveCE != nullptr) {
|
||||
delete m_saveCE;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ protected:
|
||||
void updateCosmeticLine(void);
|
||||
|
||||
private:
|
||||
Ui_TaskCosmeticLine * ui;
|
||||
std::unique_ptr<Ui_TaskCosmeticLine> ui;
|
||||
|
||||
TechDraw::DrawViewPart* m_partFeat;
|
||||
|
||||
|
||||
@@ -238,7 +238,6 @@ TaskDetail::TaskDetail(TechDraw::DrawViewDetail* detailFeat):
|
||||
TaskDetail::~TaskDetail()
|
||||
{
|
||||
m_ghost->deleteLater(); //this might not exist if scene is destroyed before TaskDetail is deleted?
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskDetail::updateTask()
|
||||
|
||||
@@ -110,7 +110,7 @@ protected:
|
||||
TechDraw::DrawViewDetail* getDetailFeat();
|
||||
|
||||
private:
|
||||
Ui_TaskDetail * ui;
|
||||
std::unique_ptr<Ui_TaskDetail> ui;
|
||||
bool blockUpdate;
|
||||
|
||||
QGIGhostHighlight* m_ghost;
|
||||
|
||||
@@ -68,7 +68,6 @@ TaskGeomHatch::TaskGeomHatch(TechDraw::DrawGeomHatch* inHatch,TechDrawGui::ViewP
|
||||
|
||||
TaskGeomHatch::~TaskGeomHatch()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ private Q_SLOTS:
|
||||
void onColorChanged();
|
||||
|
||||
private:
|
||||
Ui_TaskGeomHatch * ui;
|
||||
std::unique_ptr<Ui_TaskGeomHatch> ui;
|
||||
TechDraw::DrawGeomHatch* m_hatch;
|
||||
TechDrawGui::ViewProviderGeomHatch* m_Vp;
|
||||
App::DocumentObject* m_source;
|
||||
|
||||
@@ -68,7 +68,6 @@ TaskHatch::TaskHatch(TechDraw::DrawHatch* inHatch, TechDrawGui::ViewProviderHatc
|
||||
|
||||
TaskHatch::~TaskHatch()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskHatch::initUi()
|
||||
|
||||
@@ -73,7 +73,7 @@ private Q_SLOTS:
|
||||
void onColorChanged();
|
||||
|
||||
private:
|
||||
Ui_TaskHatch * ui;
|
||||
std::unique_ptr<Ui_TaskHatch> ui;
|
||||
TechDraw::DrawHatch* m_hatch;
|
||||
TechDrawGui::ViewProviderHatch* m_Vp;
|
||||
App::DocumentObject* m_source;
|
||||
|
||||
@@ -233,7 +233,6 @@ TaskLeaderLine::TaskLeaderLine(TechDraw::DrawView* baseFeat,
|
||||
|
||||
TaskLeaderLine::~TaskLeaderLine()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskLeaderLine::saveState()
|
||||
|
||||
@@ -130,7 +130,7 @@ private Q_SLOTS:
|
||||
void onLineStyleChanged();
|
||||
|
||||
private:
|
||||
Ui_TaskLeaderLine * ui;
|
||||
std::unique_ptr<Ui_TaskLeaderLine> ui;
|
||||
bool blockUpdate;
|
||||
|
||||
QGTracker* m_tracker;
|
||||
|
||||
@@ -280,7 +280,6 @@ TaskRestoreLines::TaskRestoreLines(TechDraw::DrawViewPart* partFeat,
|
||||
|
||||
TaskRestoreLines::~TaskRestoreLines()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskRestoreLines::initUi()
|
||||
|
||||
@@ -112,7 +112,7 @@ protected:
|
||||
void restoreInvisibleCenters(void);
|
||||
|
||||
private:
|
||||
Ui_TaskRestoreLines* ui;
|
||||
std::unique_ptr<Ui_TaskRestoreLines> ui;
|
||||
TechDraw::DrawViewPart* m_partFeat;
|
||||
TaskLineDecor* m_parent;
|
||||
};
|
||||
|
||||
@@ -86,7 +86,6 @@ TaskLinkDim::TaskLinkDim(std::vector<App::DocumentObject*> parts, std::vector<st
|
||||
|
||||
TaskLinkDim::~TaskLinkDim()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskLinkDim::loadAvailDims()
|
||||
|
||||
@@ -63,7 +63,7 @@ protected:
|
||||
bool dimReferencesSelection(const TechDraw::DrawViewDimension* dim) const;
|
||||
|
||||
private:
|
||||
Ui_TaskLinkDim * ui;
|
||||
std::unique_ptr<Ui_TaskLinkDim> ui;
|
||||
const std::vector<App::DocumentObject*> m_parts;
|
||||
const std::vector<std::string> m_subs;
|
||||
TechDraw::DrawPage* m_page;
|
||||
|
||||
@@ -138,7 +138,6 @@ TaskProjGroup::TaskProjGroup(TechDraw::DrawProjGroup* featView, bool mode) :
|
||||
|
||||
TaskProjGroup::~TaskProjGroup()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskProjGroup::saveGroupState()
|
||||
|
||||
@@ -109,7 +109,7 @@ protected:
|
||||
MDIViewPage* m_mdi;
|
||||
|
||||
private:
|
||||
Ui_TaskProjGroup * ui;
|
||||
std::unique_ptr<Ui_TaskProjGroup> ui;
|
||||
TechDraw::DrawProjGroup* multiView;
|
||||
bool m_createMode;
|
||||
|
||||
|
||||
@@ -202,7 +202,6 @@ TaskRichAnno::TaskRichAnno(TechDraw::DrawView* baseFeat,
|
||||
|
||||
TaskRichAnno::~TaskRichAnno()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskRichAnno::updateTask()
|
||||
|
||||
@@ -103,7 +103,7 @@ protected:
|
||||
App::Color prefLineColor(void);
|
||||
|
||||
private:
|
||||
Ui_TaskRichAnno * ui;
|
||||
std::unique_ptr<Ui_TaskRichAnno> ui;
|
||||
bool blockUpdate;
|
||||
|
||||
MDIViewPage* m_mdi;
|
||||
|
||||
@@ -152,7 +152,6 @@ TaskSectionView::TaskSectionView(TechDraw::DrawViewSection* section) :
|
||||
|
||||
TaskSectionView::~TaskSectionView()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskSectionView::setUiPrimary()
|
||||
|
||||
@@ -84,7 +84,7 @@ protected:
|
||||
bool isSectionValid(void);
|
||||
|
||||
private:
|
||||
Ui_TaskSectionView * ui;
|
||||
std::unique_ptr<Ui_TaskSectionView> ui;
|
||||
TechDraw::DrawViewPart* m_base;
|
||||
TechDraw::DrawViewSection* m_section;
|
||||
std::string m_symbol;
|
||||
|
||||
@@ -184,7 +184,6 @@ TaskWeldingSymbol::TaskWeldingSymbol(TechDraw::DrawWeldSymbol* weld) :
|
||||
|
||||
TaskWeldingSymbol::~TaskWeldingSymbol()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskWeldingSymbol::updateTask()
|
||||
|
||||
@@ -146,7 +146,7 @@ protected:
|
||||
QString m_currDir;
|
||||
|
||||
private:
|
||||
Ui_TaskWeldingSymbol* ui;
|
||||
std::unique_ptr<Ui_TaskWeldingSymbol> ui;
|
||||
|
||||
TechDraw::DrawLeaderLine* m_leadFeat;
|
||||
TechDraw::DrawWeldSymbol* m_weldFeat;
|
||||
|
||||
Reference in New Issue
Block a user