From 84fad66614075b6ff358f11d86832672f4ce0a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Wed, 4 Dec 2019 15:35:44 +0100 Subject: [PATCH] update 'updated-at' metadata when moving a document to trash (as it is done on the metadata.rdf file) --- src/document/UBDocumentController.cpp | 2 +- src/document/UBDocumentProxy.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index ebbfe9b4..c711385b 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -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()); } } diff --git a/src/document/UBDocumentProxy.cpp b/src/document/UBDocumentProxy.cpp index cebd7126..6f9aa711 100644 --- a/src/document/UBDocumentProxy.cpp +++ b/src/document/UBDocumentProxy.cpp @@ -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