Pointer cleanup (#242)
- Made greater use of smart pointers, eliminating many instances of manual memory management - Do not use pointers at all for many non-polymorphic classes - Assorted other code cleanup
This commit is contained in:
+15
-5
@@ -21,6 +21,9 @@
|
||||
#ifndef MainWindow_h
|
||||
#define MainWindow_h
|
||||
|
||||
|
||||
#include "UndoRedoModel.h"
|
||||
|
||||
#include <model/Model.h>
|
||||
|
||||
#include <QAction>
|
||||
@@ -35,6 +38,8 @@
|
||||
#include <QToolBar>
|
||||
#include <QToolButton>
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace glabels
|
||||
{
|
||||
@@ -46,7 +51,6 @@ namespace glabels
|
||||
class PrintView;
|
||||
class PropertiesView;
|
||||
class StartupView;
|
||||
class UndoRedoModel;
|
||||
class VariablesView;
|
||||
|
||||
|
||||
@@ -63,7 +67,7 @@ namespace glabels
|
||||
/////////////////////////////////////
|
||||
public:
|
||||
MainWindow();
|
||||
~MainWindow() override;
|
||||
virtual ~MainWindow() = default;
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
@@ -194,8 +198,17 @@ namespace glabels
|
||||
|
||||
/////////////////////////////////////
|
||||
// Private Data
|
||||
// owned and managed by us
|
||||
/////////////////////////////////////
|
||||
private:
|
||||
std::unique_ptr<model::Model> mModel;
|
||||
std::unique_ptr<UndoRedoModel> mUndoRedoModel;
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
// Private Data
|
||||
// owned by QMainWindow
|
||||
/////////////////////////////////////
|
||||
QMenu* fileMenu;
|
||||
QMenu* fileRecentMenu;
|
||||
QMenu* editMenu;
|
||||
@@ -219,9 +232,6 @@ namespace glabels
|
||||
QToolBar* fileToolBar;
|
||||
QToolBar* editorToolBar;
|
||||
|
||||
model::Model* mModel;
|
||||
UndoRedoModel* mUndoRedoModel;
|
||||
|
||||
QToolBar* mContents;
|
||||
QToolButton* mWelcomeButton;
|
||||
QToolButton* mEditorButton;
|
||||
|
||||
Reference in New Issue
Block a user