Commit 84fad666 authored by Clément Fauconnier's avatar Clément Fauconnier

update 'updated-at' metadata when moving a document to trash (as it is done on...

update 'updated-at' metadata when moving a document to trash (as it is done on the metadata.rdf file)
parent 1dadb212
......@@ -942,7 +942,6 @@ void UBDocumentTreeModel::moveIndexes(const QModelIndexList &source, const QMode
fixNodeName(s, destinationParent);
sourceNode->parentNode()->moveChild(sourceNode, destIndex, newParentNode);
updateIndexNameBindings(sourceNode);
hasOneInsertion = true;
}
}
......@@ -1224,6 +1223,7 @@ void UBDocumentTreeModel::updateIndexNameBindings(UBDocumentTreeNode *nd)
} else if (nd->proxyData()) {
nd->proxyData()->setMetaData(UBSettings::documentGroupName, virtualPathForIndex(indexForNode(nd->parentNode())));
nd->proxyData()->setMetaData(UBSettings::documentName, nd->nodeName());
nd->proxyData()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
UBPersistenceManager::persistenceManager()->persistDocumentMetadata(nd->proxyData());
}
}
......
......@@ -260,7 +260,7 @@ QDateTime UBDocumentProxy::lastUpdate()
{
if(mMetaDatas.contains(UBSettings::documentUpdatedAt))
return UBStringUtils::fromUtcIsoDate(metaData(UBSettings::documentUpdatedAt).toString());
return QDateTime().currentDateTime();
return QDateTime::currentDateTime();
}
bool UBDocumentProxy::isModified() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment