Update timeinfo of group only when properties of the group itself change.

This commit is contained in:
Florian Geyer 2012-04-18 16:58:14 +02:00 committed by Felix Geyer
parent 34204f3281
commit 84d9d2ec47
2 changed files with 4 additions and 5 deletions

View File

@ -35,8 +35,6 @@ Group::Group()
m_searchingEnabled = Inherit; m_searchingEnabled = Inherit;
m_updateTimeinfo = true; m_updateTimeinfo = true;
connect(this, SIGNAL(modified()), this, SLOT(updateTimeinfo()));
} }
Group::~Group() Group::~Group()
@ -47,6 +45,7 @@ Group::~Group()
template <class T> bool Group::set(T& property, const T& value) { template <class T> bool Group::set(T& property, const T& value) {
if (property != value) { if (property != value) {
property = value; property = value;
updateTimeinfo();
Q_EMIT modified(); Q_EMIT modified();
return true; return true;
} }
@ -177,6 +176,7 @@ void Group::setIcon(int iconNumber)
m_pixmapCacheKey = QPixmapCache::Key(); m_pixmapCacheKey = QPixmapCache::Key();
updateTimeinfo();
Q_EMIT modified(); Q_EMIT modified();
Q_EMIT dataChanged(this); Q_EMIT dataChanged(this);
} }

View File

@ -92,9 +92,6 @@ Q_SIGNALS:
void modified(); void modified();
private Q_SLOTS:
void updateTimeinfo();
private: private:
template <class T> inline bool set(T& property, const T& value); template <class T> inline bool set(T& property, const T& value);
@ -128,6 +125,8 @@ private:
friend void Database::setRootGroup(Group* group); friend void Database::setRootGroup(Group* group);
friend Entry::~Entry(); friend Entry::~Entry();
friend void Entry::setGroup(Group *group); friend void Entry::setGroup(Group *group);
void updateTimeinfo();
}; };
#endif // KEEPASSX_GROUP_H #endif // KEEPASSX_GROUP_H