summaryrefslogtreecommitdiffstats
path: root/src/widgets/toolbox.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-08-28 19:18:21 +0000
committerKrzysztof Kosinski <tweenk.pl@gmail.com>2011-08-28 19:18:21 +0000
commitbe7df18d6aef42dd657426b6a9d30834e5f54ca6 (patch)
tree9bc96a469b9cf6595004d1733d1b7104eb764092 /src/widgets/toolbox.cpp
parentRemove last forward declaration of NRPixBlock (diff)
downloadinkscape-be7df18d6aef42dd657426b6a9d30834e5f54ca6.tar.gz
inkscape-be7df18d6aef42dd657426b6a9d30834e5f54ca6.zip
Remove nr-object.h and nr-macros.h
(bzr r10582.1.10)
Diffstat (limited to 'src/widgets/toolbox.cpp')
-rw-r--r--src/widgets/toolbox.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 61c7c8e88..7edc24420 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -863,23 +863,6 @@ static void trigger_sp_action( GtkAction* /*act*/, gpointer user_data )
}
}
-static void sp_action_action_set_sensitive(SPAction * /*action*/, unsigned int sensitive, void *data)
-{
- if ( data ) {
- GtkAction* act = GTK_ACTION(data);
- gtk_action_set_sensitive( act, sensitive );
- }
-}
-
-static SPActionEventVector action_event_vector = {
- {NULL},
- NULL,
- NULL,
- sp_action_action_set_sensitive,
- NULL,
- NULL
-};
-
static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::View::View* view, Inkscape::IconSize size )
{
GtkAction* act = 0;
@@ -891,8 +874,13 @@ static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::Vi
g_signal_connect( G_OBJECT(inky), "activate", G_CALLBACK(trigger_sp_action), targetAction );
- SPAction*rebound = dynamic_cast<SPAction *>( nr_object_ref( dynamic_cast<NRObject *>(targetAction) ) );
- nr_active_object_add_listener( (NRActiveObject *)rebound, (NRObjectEventVector *)&action_event_vector, sizeof(SPActionEventVector), inky );
+ // FIXME: memory leak: this is not unrefed anywhere
+ g_object_ref(G_OBJECT(targetAction));
+ g_object_set_data_full(G_OBJECT(inky), "SPAction", (void*) targetAction, (GDestroyNotify) &g_object_unref);
+ targetAction->signal_set_sensitive.connect(
+ sigc::bind<0>(
+ sigc::ptr_fun(&gtk_action_set_sensitive),
+ GTK_ACTION(inky)));
return act;
}