From 34204f32815bc661c5f94b23e2a00f8e4eba8790 Mon Sep 17 00:00:00 2001 From: Florian Geyer Date: Wed, 18 Apr 2012 16:38:10 +0200 Subject: [PATCH] Disconnect entry from database, when removed. --- src/core/Group.cpp | 1 + tests/TestModified.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/core/Group.cpp b/src/core/Group.cpp index 17f06605..778eb746 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -323,6 +323,7 @@ void Group::removeEntry(Entry* entry) Q_EMIT entryAboutToRemove(entry); entry->disconnect(this); + entry->disconnect(m_db); m_entries.removeAll(entry); Q_EMIT modified(); Q_EMIT entryRemoved(); diff --git a/tests/TestModified.cpp b/tests/TestModified.cpp index fa196038..5b116279 100644 --- a/tests/TestModified.cpp +++ b/tests/TestModified.cpp @@ -88,6 +88,11 @@ void TestModified::testSignals() QCOMPARE(spyModified.count(), spyCount); QCOMPARE(spyModified2.count(), spyCount2); + entry2->setTitle("test2"); + spyCount2++; + QCOMPARE(spyModified.count(), spyCount); + QCOMPARE(spyModified2.count(), spyCount2); + Group* g3 = new Group(); g3->setParent(root); spyCount++;