mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Mark ownership using unique_ptr in Atlas sections
And remove unused destructors. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
@@ -124,7 +124,6 @@ class AtObjClientData : public wxClientData
|
||||
{
|
||||
public:
|
||||
AtObjClientData(const AtObj& obj) : obj(obj) {}
|
||||
virtual ~AtObjClientData() {}
|
||||
AtObj GetValue() { return obj; }
|
||||
private:
|
||||
AtObj obj;
|
||||
|
||||
@@ -316,17 +316,12 @@ ObjectSidebar::ObjectSidebar(
|
||||
bottomBarContainer,
|
||||
scenarioEditor.GetObjectSettings(),
|
||||
scenarioEditor.GetMapSettings(),
|
||||
m_Impl
|
||||
m_Impl.get()
|
||||
);
|
||||
|
||||
m_Impl->m_ToolConn = scenarioEditor.GetToolManager().GetCurrentTool().RegisterObserver(0, &ObjectSidebar::OnToolChange, this);
|
||||
}
|
||||
|
||||
ObjectSidebar::~ObjectSidebar()
|
||||
{
|
||||
delete m_Impl;
|
||||
}
|
||||
|
||||
void ObjectSidebar::OnToolChange(ITool* tool)
|
||||
{
|
||||
if (wxString(tool->GetClassInfo()->GetClassName()) == _T("ActorViewerTool"))
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include "tools/atlas/AtlasUI/ScenarioEditor/Sections/Common/Sidebar.h"
|
||||
|
||||
#include <memory>
|
||||
#include <wx/event.h>
|
||||
|
||||
class ITool;
|
||||
@@ -28,7 +29,6 @@ class ObjectSidebar : public Sidebar
|
||||
{
|
||||
public:
|
||||
ObjectSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer);
|
||||
~ObjectSidebar();
|
||||
|
||||
void FilterObjects();
|
||||
|
||||
@@ -43,7 +43,7 @@ private:
|
||||
void OnSelectObject(wxCommandEvent& evt);
|
||||
void OnToggleExactFilter(wxCommandEvent& evt);
|
||||
|
||||
ObjectSidebarImpl* m_Impl;
|
||||
std::unique_ptr<ObjectSidebarImpl> m_Impl;
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user