diff options
author | Lukáš Lalinský <lalinsky@gmail.com> | 2009-01-01 08:57:48 +0100 |
---|---|---|
committer | Lukáš Lalinský <lalinsky@gmail.com> | 2009-01-01 08:57:48 +0100 |
commit | a02fbb306009ab27ab91867d0736e133d4d42b45 (patch) | |
tree | 260dc67e6d999e3561668e104b69fab35aa7a6fe /src/connector.cpp | |
parent | e40be8a9658095b5d7e87afdf4a95762885e7aab (diff) | |
download | dbmodel-a02fbb306009ab27ab91867d0736e133d4d42b45.tar.xz |
Fix adding and removing of all items
Diffstat (limited to 'src/connector.cpp')
-rw-r--r-- | src/connector.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/connector.cpp b/src/connector.cpp index f693fde..bbd7580 100644 --- a/src/connector.cpp +++ b/src/connector.cpp @@ -71,10 +71,9 @@ Connector::hub() const void Connector::setHub(Hub *hub) { - if (hub) - hub->removeConnector(this); + removeFromHub(); m_hub = hub; - m_hub->addConnector(this); + addToHub(); } bool @@ -102,3 +101,17 @@ Connector::otherEnd() const return conn->connector(0); } } + +void +Connector::addToHub() +{ + if (m_hub) + m_hub->addConnector(this); +} + +void +Connector::removeFromHub() +{ + if (m_hub) + m_hub->removeConnector(this); +} |