adjust name using selected index when a folder is selected

preferencesAboutTextFull
Clément Fauconnier 3 years ago
parent 61721b7f3b
commit 986cbd60ab
  1. 11
      src/document/UBDocumentController.cpp

@ -1780,7 +1780,16 @@ void UBDocumentController::createNewDocument()
QDateTime now = QDateTime::currentDateTime(); QDateTime now = QDateTime::currentDateTime();
QString documentName = docModel->adjustNameForParentIndex(now.toString(Qt::SystemLocaleShortDate), selectedIndex.parent()); QString documentName = "";
if (docModel->isCatalog(selectedIndex))
{
documentName = docModel->adjustNameForParentIndex(now.toString(Qt::SystemLocaleShortDate), selectedIndex);
}
else
{
documentName = docModel->adjustNameForParentIndex(now.toString(Qt::SystemLocaleShortDate), selectedIndex.parent());
}
UBDocumentProxy *document = pManager->createDocument(groupName, documentName); UBDocumentProxy *document = pManager->createDocument(groupName, documentName);

Loading…
Cancel
Save