summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2017-02-28 09:44:56 +0000
committertavmjong-free <tavmjong@free.fr>2017-02-28 09:44:56 +0000
commitb71ff633734c11853d92d40431a6f90fd97c8be2 (patch)
treef5fe0fa08b9a663bc184d38277746f9432f532fb /src
parentAdd a very simple prototype dialog as an example and test of deriving from Pa... (diff)
downloadinkscape-b71ff633734c11853d92d40431a6f90fd97c8be2.tar.gz
inkscape-b71ff633734c11853d92d40431a6f90fd97c8be2.zip
More consistent naming scheme.
(bzr r15552)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/prototype.cpp27
-rw-r--r--src/ui/dialog/prototype.h6
2 files changed, 16 insertions, 17 deletions
diff --git a/src/ui/dialog/prototype.cpp b/src/ui/dialog/prototype.cpp
index 4d7492c18..c28f37c6a 100644
--- a/src/ui/dialog/prototype.cpp
+++ b/src/ui/dialog/prototype.cpp
@@ -42,14 +42,14 @@ Prototype::Prototype() :
std::cerr << "Prototype::Prototype: desktop is NULL!" << std::endl;
}
- desktopChangedConnection = desktopTracker.connectDesktopChanged(
+ connectionDesktopChanged = desktopTracker.connectDesktopChanged(
sigc::mem_fun(*this, &Prototype::handleDesktopChanged) );
desktopTracker.connect(GTK_WIDGET(gobj()));
- documentReplacedConnection = getDesktop()->connectDocumentReplaced(
+ connectionDocumentReplaced = getDesktop()->connectDocumentReplaced(
sigc::mem_fun(this, &Prototype::handleDocumentReplaced));
- selectionChangedConnection = getDesktop()->getSelection()->connectChanged(
+ connectionSelectionChanged = getDesktop()->getSelection()->connectChanged(
sigc::hide(sigc::mem_fun(this, &Prototype::handleSelectionChanged)));
updateLabel();
@@ -59,9 +59,9 @@ Prototype::~Prototype()
{
// Never actually called.
std::cout << "Prototype::~Prototype()" << std::endl;
- desktopChangedConnection.disconnect();
- documentReplacedConnection.disconnect();
- selectionChangedConnection.disconnect();
+ connectionDesktopChanged.disconnect();
+ connectionDocumentReplaced.disconnect();
+ connectionSelectionChanged.disconnect();
}
/*
@@ -89,9 +89,9 @@ Prototype::handleDocumentReplaced(SPDesktop *desktop, SPDocument * /* document *
std::cerr << "Prototype::handleDocumentReplaced(): Error: panel desktop not equal to existing desktop!" << std::endl;
}
- selectionChangedConnection.disconnect();
+ connectionSelectionChanged.disconnect();
- selectionChangedConnection = desktop->getSelection()->connectChanged(
+ connectionSelectionChanged = desktop->getSelection()->connectChanged(
sigc::hide(sigc::mem_fun(this, &Prototype::handleSelectionChanged)));
// Update demonstration widget.
@@ -112,16 +112,15 @@ Prototype::handleDesktopChanged(SPDesktop* desktop) {
return;
}
- // Need to either remove return above or connect these in constructor.
- // We've choosen the later.
- selectionChangedConnection.disconnect();
- documentReplacedConnection.disconnect();
+ // Connections are disconnect safe.
+ connectionSelectionChanged.disconnect();
+ connectionDocumentReplaced.disconnect();
setDesktop( desktop );
- selectionChangedConnection = desktop->getSelection()->connectChanged(
+ connectionSelectionChanged = desktop->getSelection()->connectChanged(
sigc::hide(sigc::mem_fun(this, &Prototype::handleSelectionChanged)));
- documentReplacedConnection = desktop->connectDocumentReplaced(
+ connectionDocumentReplaced = desktop->connectDocumentReplaced(
sigc::mem_fun(this, &Prototype::handleDocumentReplaced));
// Update demonstration widget.
diff --git a/src/ui/dialog/prototype.h b/src/ui/dialog/prototype.h
index 65522c41f..95c3856f8 100644
--- a/src/ui/dialog/prototype.h
+++ b/src/ui/dialog/prototype.h
@@ -47,9 +47,9 @@ private:
Prototype operator=(Prototype const &d);
// Signals and handlers
- sigc::connection documentReplacedConnection;
- sigc::connection desktopChangedConnection;
- sigc::connection selectionChangedConnection;
+ sigc::connection connectionDocumentReplaced;
+ sigc::connection connectionDesktopChanged;
+ sigc::connection connectionSelectionChanged;
void handleDocumentReplaced(SPDesktop* desktop, SPDocument *document);
void handleDesktopChanged(SPDesktop* desktop);