Commit dcb20ca2 authored by Craig Watson's avatar Craig Watson

Fix documents not being renamed correctly (new name wasn't persisted)

parent cab1d0ca
......@@ -994,8 +994,13 @@ void UBDocumentController::itemChanged(QTreeWidgetItem * item, int column)
disconnect(UBPersistenceManager::persistenceManager(), SIGNAL(documentMetadataChanged(UBDocumentProxy*))
, this, SLOT(updateDocumentInTree(UBDocumentProxy*)));
if (proxyItem)
proxyItem->proxy()->setMetaData(UBSettings::documentName, item->text(column));
if (proxyItem) {
if (proxyItem->proxy()->metaData(UBSettings::documentName).toString() != item->text(column)) {
// The item was renamed, we should persist it immediately
proxyItem->proxy()->setMetaData(UBSettings::documentName, item->text(column));
UBPersistenceManager::persistenceManager()->persistDocumentMetadata(proxyItem->proxy());
}
}
else
{
// it is a group
......
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