diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-06-25 20:21:44 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-06-25 20:21:44 +0000 |
| commit | 60f288cc584bf34c65698341427cf377b88c7138 (patch) | |
| tree | b8b7e6d3c24f95350e85e4c1754a27d5dc9bde6c /src/document.cpp | |
| parent | 1. make it compile (diff) | |
| download | inkscape-60f288cc584bf34c65698341427cf377b88c7138.tar.gz inkscape-60f288cc584bf34c65698341427cf377b88c7138.zip | |
2. connect signals
(bzr r13341.5.2)
Diffstat (limited to 'src/document.cpp')
| -rw-r--r-- | src/document.cpp | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/src/document.cpp b/src/document.cpp index 80e9bfe4f..ee1a48eb6 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -154,6 +154,17 @@ SPDocument::~SPDocument() { router = NULL; } + if (oldSignalsConnected) { + priv->selChangeConnection.disconnect(); + priv->desktopActivatedConnection.disconnect(); + //g_signal_handlers_disconnect_by_func(G_OBJECT(INKSCAPE), + //reinterpret_cast<gpointer>(DocumentUndo::resetKey), + //static_cast<gpointer>(this)); + } else { + _selection_changed_connection.disconnect(); + _desktop_activated_connection.disconnect(); + } + if (priv) { if (priv->partial) { sp_repr_free_log(priv->partial); @@ -208,15 +219,6 @@ SPDocument::~SPDocument() { rerouting_handler_id = 0; } - if (oldSignalsConnected) { - g_signal_handlers_disconnect_by_func(G_OBJECT(INKSCAPE), - reinterpret_cast<gpointer>(DocumentUndo::resetKey), - static_cast<gpointer>(this)); - } else { - _selection_changed_connection.disconnect(); - _desktop_activated_connection.disconnect(); - } - if (keepalive) { inkscape_unref(INKSCAPE); keepalive = FALSE; @@ -463,10 +465,21 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, DocumentUndo::setUndoSensitive(document, true); // reset undo key when selection changes, so that same-key actions on different objects are not coalesced - g_signal_connect(G_OBJECT(INKSCAPE), "change_selection", + document->priv->selChangeConnection = INKSCAPE->signal_selection_changed.connect( + sigc::hide( // hide unused first and second args + sigc::hide(sigc::bind( + sigc::ptr_fun(&DocumentUndo::resetKey), document) + ))); + document->priv->desktopActivatedConnection = INKSCAPE->signal_activate_desktop.connect( + sigc::hide( // hide unused first and second args + sigc::hide(sigc::bind( + sigc::ptr_fun(&DocumentUndo::resetKey), document) + ))); + + /*g_signal_connect(G_OBJECT(INKSCAPE), "change_selection", G_CALLBACK(DocumentUndo::resetKey), document); g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop", - G_CALLBACK(DocumentUndo::resetKey), document); + G_CALLBACK(DocumentUndo::resetKey), document);*/ document->oldSignalsConnected = true; return document; |
