mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-15 09:17:28 -05:00
Update LocationChanged time when entries and groups are moved.
Closes #3
This commit is contained in:
parent
cc426d2453
commit
ef26065a99
@ -357,6 +357,10 @@ Group* Entry::group()
|
|||||||
|
|
||||||
void Entry::setGroup(Group* group)
|
void Entry::setGroup(Group* group)
|
||||||
{
|
{
|
||||||
|
if (m_group == group) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_group) {
|
if (m_group) {
|
||||||
m_group->removeEntry(this);
|
m_group->removeEntry(this);
|
||||||
if (m_group->database() != group->database() && m_group->database()) {
|
if (m_group->database() != group->database() && m_group->database()) {
|
||||||
@ -367,6 +371,10 @@ void Entry::setGroup(Group* group)
|
|||||||
group->addEntry(this);
|
group->addEntry(this);
|
||||||
m_group = group;
|
m_group = group;
|
||||||
QObject::setParent(group);
|
QObject::setParent(group);
|
||||||
|
|
||||||
|
if (m_updateTimeinfo) {
|
||||||
|
m_timeInfo.setLocationChanged(QDateTime::currentDateTimeUtc());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entry::emitDataChanged()
|
void Entry::emitDataChanged()
|
||||||
|
@ -264,6 +264,9 @@ void Group::setParent(Group* parent, int index)
|
|||||||
index = parent->children().size();
|
index = parent->children().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_parent == parent && index == parent->children().indexOf(this)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cleanupParent();
|
cleanupParent();
|
||||||
|
|
||||||
@ -280,6 +283,10 @@ void Group::setParent(Group* parent, int index)
|
|||||||
|
|
||||||
parent->m_children.insert(index, this);
|
parent->m_children.insert(index, this);
|
||||||
|
|
||||||
|
if (m_updateTimeinfo) {
|
||||||
|
m_timeInfo.setLocationChanged(QDateTime::currentDateTimeUtc());
|
||||||
|
}
|
||||||
|
|
||||||
Q_EMIT modified();
|
Q_EMIT modified();
|
||||||
Q_EMIT added();
|
Q_EMIT added();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user