summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2016-06-28 09:34:34 (GMT)
committerRolf Eike Beer <kde@opensource.sf-tec.de>2016-06-28 18:02:53 (GMT)
commite4007099c8090c79a87c3277872bf19033781054 (patch)
treea859d9d9f2774f6d531cae98b2e217c6e037eca9
parentb653010177870f19cbc1fada8c263b1a82912226 (diff)
fix disconnecting KGpgRefNode::keyUpdate()
Disconnecting a slot made with the new connect syntax doesn't work using the old syntax.
-rw-r--r--core/KGpgRefNode.cpp6
-rw-r--r--core/KGpgRefNode.h1
2 files changed, 4 insertions, 3 deletions
diff --git a/core/KGpgRefNode.cpp b/core/KGpgRefNode.cpp
index 329dcf1..44de346 100644
--- a/core/KGpgRefNode.cpp
+++ b/core/KGpgRefNode.cpp
@@ -50,7 +50,7 @@ KGpgRefNode::KGpgRefNode(KGpgExpandableNode *parent, const QString &keyid)
if (m_keynode != Q_NULLPTR) {
m_keynode->addRef(this);
} else {
- connect(root, &KGpgRootNode::newKeyNode, this, &KGpgRefNode::keyUpdated);
+ m_updateConnection = connect(root, &KGpgRootNode::newKeyNode, this, &KGpgRefNode::keyUpdated);
}
}
@@ -96,7 +96,7 @@ KGpgRefNode::keyUpdated(KGpgKeyNode *nkey)
Q_ASSERT(nkey != Q_NULLPTR);
if (nkey->compareId(m_id)) {
- disconnect(sender(), Q_NULLPTR, this, SLOT(keyUpdated(KGpgKeyNode*)));
+ disconnect(m_updateConnection);
m_keynode = nkey;
m_keynode->addRef(this);
}
@@ -106,7 +106,7 @@ void
KGpgRefNode::unRef(KGpgRootNode *root)
{
if (root != Q_NULLPTR)
- connect(root, &KGpgRootNode::newKeyNode, this, &KGpgRefNode::keyUpdated);
+ m_updateConnection = connect(root, &KGpgRootNode::newKeyNode, this, &KGpgRefNode::keyUpdated);
m_keynode = Q_NULLPTR;
}
diff --git a/core/KGpgRefNode.h b/core/KGpgRefNode.h
index 4663e27..fa6e667 100644
--- a/core/KGpgRefNode.h
+++ b/core/KGpgRefNode.h
@@ -43,6 +43,7 @@ class KGpgRefNode : public KGpgNode
private:
const QString m_id;
bool m_selfsig; ///< if this is a reference to it's own parent
+ QMetaObject::Connection m_updateConnection;
protected:
KGpgKeyNode *m_keynode;