Disconnect entry from database, when removed.

This commit is contained in:
Florian Geyer 2012-04-18 16:38:10 +02:00 committed by Felix Geyer
parent 89f138a868
commit 34204f3281
2 changed files with 6 additions and 0 deletions

View File

@ -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();

View File

@ -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++;