diff --git a/src/core/Group.cpp b/src/core/Group.cpp index dd08bf8a5..4e8292164 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -35,6 +35,8 @@ Group::Group() m_searchingEnabled = Inherit; m_updateTimeinfo = true; + + connect(this, SIGNAL(modified()), this, SLOT(updateTimeinfo())); } Group::~Group() @@ -45,10 +47,6 @@ Group::~Group() template bool Group::set(T& property, const T& value) { if (property != value) { property = value; - if (m_updateTimeinfo) { - m_timeInfo.setLastModificationTime(QDateTime::currentDateTimeUtc()); - m_timeInfo.setLastAccessTime(QDateTime::currentDateTimeUtc()); - } Q_EMIT modified(); return true; } @@ -57,6 +55,14 @@ template bool Group::set(T& property, const T& value) { } } +void Group::updateTimeinfo() +{ + if (m_updateTimeinfo) { + m_timeInfo.setLastModificationTime(QDateTime::currentDateTimeUtc()); + m_timeInfo.setLastAccessTime(QDateTime::currentDateTimeUtc()); + } +} + void Group::setUpdateTimeinfo(bool value) { m_updateTimeinfo = value; } @@ -304,7 +310,7 @@ void Group::addEntry(Entry *entry) m_entries << entry; connect(entry, SIGNAL(dataChanged(Entry*)), SIGNAL(entryDataChanged(Entry*))); - connect(entry, SIGNAL(modified()), this, SIGNAL(modified())); + connect(entry, SIGNAL(modified()), m_db, SIGNAL(modified())); Q_EMIT modified(); Q_EMIT entryAdded(); diff --git a/src/core/Group.h b/src/core/Group.h index af674bcee..1207cebf6 100644 --- a/src/core/Group.h +++ b/src/core/Group.h @@ -92,6 +92,9 @@ Q_SIGNALS: void modified(); +private Q_SLOTS: + void updateTimeinfo(); + private: template inline bool set(T& property, const T& value);