summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Valavanis <valavanisalex@gmail.com>2019-01-22 00:58:29 +0000
committerAlexander Valavanis <valavanisalex@gmail.com>2019-01-22 00:58:29 +0000
commit955ce1d8047673f3a17aa06f5f0f0f1563cf19b5 (patch)
tree3fec2bc3c7487055889c709b30dec7615273e681 /src
parentNodeToolbar: Fix initialisation (diff)
downloadinkscape-955ce1d8047673f3a17aa06f5f0f0f1563cf19b5.tar.gz
inkscape-955ce1d8047673f3a17aa06f5f0f0f1563cf19b5.zip
NodeToolbar: Fix initialisation
Diffstat (limited to 'src')
-rw-r--r--src/ui/toolbar/eraser-toolbar.cpp7
-rw-r--r--src/ui/toolbar/eraser-toolbar.h4
-rw-r--r--src/ui/toolbar/mesh-toolbar.cpp14
-rw-r--r--src/ui/toolbar/mesh-toolbar.h8
-rw-r--r--src/ui/toolbar/spray-toolbar.cpp10
-rw-r--r--src/ui/toolbar/spray-toolbar.h6
6 files changed, 12 insertions, 37 deletions
diff --git a/src/ui/toolbar/eraser-toolbar.cpp b/src/ui/toolbar/eraser-toolbar.cpp
index 496623d1e..f5631f362 100644
--- a/src/ui/toolbar/eraser-toolbar.cpp
+++ b/src/ui/toolbar/eraser-toolbar.cpp
@@ -52,11 +52,6 @@ using Inkscape::UI::PrefPusher;
namespace Inkscape {
namespace UI {
namespace Toolbar {
-EraserToolbar::~EraserToolbar()
-{
- if(_pressure_pusher) delete _pressure_pusher;
-}
-
GtkWidget *
EraserToolbar::prep(SPDesktop *desktop, GtkActionGroup* mainActions)
{
@@ -136,7 +131,7 @@ EraserToolbar::prep(SPDesktop *desktop, GtkActionGroup* mainActions)
INKSCAPE_ICON("draw-use-pressure"),
GTK_ICON_SIZE_MENU );
gtk_action_group_add_action( mainActions, GTK_ACTION( toolbar->_usepressure ) );
- toolbar->_pressure_pusher = new PrefPusher(GTK_TOGGLE_ACTION(toolbar->_usepressure), "/tools/eraser/usepressure", update_presets_list, (gpointer)toolbar);
+ toolbar->_pressure_pusher.reset(new PrefPusher(GTK_TOGGLE_ACTION(toolbar->_usepressure), "/tools/eraser/usepressure", update_presets_list, (gpointer)toolbar));
}
diff --git a/src/ui/toolbar/eraser-toolbar.h b/src/ui/toolbar/eraser-toolbar.h
index 2addf0dd1..de083830b 100644
--- a/src/ui/toolbar/eraser-toolbar.h
+++ b/src/ui/toolbar/eraser-toolbar.h
@@ -62,7 +62,7 @@ private:
Glib::RefPtr<Gtk::Adjustment> _cap_rounding_adj;
Glib::RefPtr<Gtk::Adjustment> _tremor_adj;
- PrefPusher *_pressure_pusher;
+ std::unique_ptr<PrefPusher> _pressure_pusher;
bool _freeze;
@@ -83,8 +83,6 @@ protected:
_freeze(false)
{}
- ~EraserToolbar() override;
-
public:
static GtkWidget * prep(SPDesktop *desktop, GtkActionGroup* mainActions);
};
diff --git a/src/ui/toolbar/mesh-toolbar.cpp b/src/ui/toolbar/mesh-toolbar.cpp
index 846582907..045d7c11a 100644
--- a/src/ui/toolbar/mesh-toolbar.cpp
+++ b/src/ui/toolbar/mesh-toolbar.cpp
@@ -191,14 +191,6 @@ static void mesh_toolbox_watch_ec(SPDesktop* dt, Inkscape::UI::Tools::ToolBase*
namespace Inkscape {
namespace UI {
namespace Toolbar {
-
-MeshToolbar::~MeshToolbar()
-{
- if(_edit_fill_pusher) delete _edit_fill_pusher;
- if(_edit_stroke_pusher) delete _edit_stroke_pusher;
- if(_show_handles_pusher) delete _show_handles_pusher;
-}
-
/**
* Mesh auxiliary toolbar construction and setup.
* Don't forget to add to XML in widgets/toolbox.cpp!
@@ -335,7 +327,7 @@ MeshToolbar::prep(SPDesktop * desktop, GtkActionGroup* mainActions)
INKSCAPE_ICON("object-fill"),
secondarySize );
gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
- toolbar->_edit_fill_pusher = new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/mesh/edit_fill");
+ toolbar->_edit_fill_pusher.reset(new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/mesh/edit_fill"));
g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(toggle_fill_stroke), (gpointer)toolbar);
}
@@ -347,7 +339,7 @@ MeshToolbar::prep(SPDesktop * desktop, GtkActionGroup* mainActions)
INKSCAPE_ICON("object-stroke"),
secondarySize );
gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
- toolbar->_edit_stroke_pusher = new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/mesh/edit_stroke");
+ toolbar->_edit_stroke_pusher.reset(new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/mesh/edit_stroke"));
g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(toggle_fill_stroke), (gpointer)toolbar);
}
@@ -359,7 +351,7 @@ MeshToolbar::prep(SPDesktop * desktop, GtkActionGroup* mainActions)
INKSCAPE_ICON("show-node-handles"),
secondarySize );
gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
- toolbar->_show_handles_pusher = new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/mesh/show_handles");
+ toolbar->_show_handles_pusher.reset(new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/mesh/show_handles"));
g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(toggle_handles), nullptr);
}
diff --git a/src/ui/toolbar/mesh-toolbar.h b/src/ui/toolbar/mesh-toolbar.h
index 534720b56..76d031f25 100644
--- a/src/ui/toolbar/mesh-toolbar.h
+++ b/src/ui/toolbar/mesh-toolbar.h
@@ -46,9 +46,9 @@ private:
Glib::RefPtr<Gtk::Adjustment> _row_adj;
Glib::RefPtr<Gtk::Adjustment> _col_adj;
- UI::PrefPusher *_edit_fill_pusher;
- UI::PrefPusher *_edit_stroke_pusher;
- UI::PrefPusher *_show_handles_pusher;
+ std::unique_ptr<UI::PrefPusher> _edit_fill_pusher;
+ std::unique_ptr<UI::PrefPusher> _edit_stroke_pusher;
+ std::unique_ptr<UI::PrefPusher> _show_handles_pusher;
sigc::connection c_selection_changed;
sigc::connection c_selection_modified;
@@ -77,8 +77,6 @@ protected:
_edit_fill_pusher(nullptr)
{}
- ~MeshToolbar() override;
-
public:
static GtkWidget * prep(SPDesktop *desktop, GtkActionGroup* mainActions);
};
diff --git a/src/ui/toolbar/spray-toolbar.cpp b/src/ui/toolbar/spray-toolbar.cpp
index 3656aae26..f38aee05e 100644
--- a/src/ui/toolbar/spray-toolbar.cpp
+++ b/src/ui/toolbar/spray-toolbar.cpp
@@ -72,12 +72,6 @@ Inkscape::UI::Dialog::CloneTiler *get_clone_tiler_panel(SPDesktop *desktop)
namespace Inkscape {
namespace UI {
namespace Toolbar {
-SprayToolbar::~SprayToolbar()
-{
- delete _usepressurewidth_pusher;
- delete _usepressurepopulation_pusher;
-}
-
GtkWidget *
SprayToolbar::prep(SPDesktop *desktop, GtkActionGroup* mainActions)
{
@@ -112,7 +106,7 @@ SprayToolbar::prep(SPDesktop *desktop, GtkActionGroup* mainActions)
INKSCAPE_ICON("draw-use-pressure"),
GTK_ICON_SIZE_MENU );
gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
- holder->_usepressurewidth_pusher = new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/spray/usepressurewidth");
+ holder->_usepressurewidth_pusher.reset(new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/spray/usepressurewidth"));
}
{
@@ -229,7 +223,7 @@ SprayToolbar::prep(SPDesktop *desktop, GtkActionGroup* mainActions)
INKSCAPE_ICON("draw-use-pressure"),
GTK_ICON_SIZE_MENU );
gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
- holder->_usepressurepopulation_pusher = new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/spray/usepressurepopulation");
+ holder->_usepressurepopulation_pusher.reset(new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/spray/usepressurepopulation"));
}
{ /* Rotation */
diff --git a/src/ui/toolbar/spray-toolbar.h b/src/ui/toolbar/spray-toolbar.h
index 7c4bee695..5f0065680 100644
--- a/src/ui/toolbar/spray-toolbar.h
+++ b/src/ui/toolbar/spray-toolbar.h
@@ -54,8 +54,8 @@ private:
Glib::RefPtr<Gtk::Adjustment> _offset_adj;
Glib::RefPtr<Gtk::Adjustment> _scale_adj;
- PrefPusher *_usepressurewidth_pusher;
- PrefPusher *_usepressurepopulation_pusher;
+ std::unique_ptr<PrefPusher> _usepressurewidth_pusher;
+ std::unique_ptr<PrefPusher> _usepressurepopulation_pusher;
InkSelectOneAction *_spray_tool_mode;
EgeAdjustmentAction *_spray_population;
@@ -109,8 +109,6 @@ protected:
Toolbar(desktop)
{}
- ~SprayToolbar() override;
-
public:
static GtkWidget * prep(SPDesktop *desktop, GtkActionGroup* mainActions);
};