| 2014 | } |
| 2015 | |
| 2016 | void UBDocumentController::createNewDocumentGroup() |
| 2017 | { |
| 2018 | UBPersistenceManager *pManager = UBPersistenceManager::persistenceManager(); |
| 2019 | UBDocumentTreeModel *docModel = pManager->mDocumentTreeStructureModel; |
| 2020 | QModelIndex selectedIndex = firstSelectedTreeIndex(); |
| 2021 | if (!selectedIndex.isValid()) { |
| 2022 | selectedIndex = docModel->myDocumentsIndex(); |
| 2023 | } |
| 2024 | QModelIndex parentIndex = docModel->isCatalog(selectedIndex) |
| 2025 | ? selectedIndex |
| 2026 | : selectedIndex.parent(); |
| 2027 | |
| 2028 | QString newFolderName = docModel->adjustNameForParentIndex(tr("New Folder"), parentIndex); |
| 2029 | |
| 2030 | QModelIndex newIndex = docModel->addCatalog(newFolderName, parentIndex); |
| 2031 | mDocumentUI->documentTreeView->setSelectedAndExpanded(newIndex, true, true); |
| 2032 | |
| 2033 | pageSelectionChanged(); |
| 2034 | } |
| 2035 | |
| 2036 | |
| 2037 | std::shared_ptr<UBDocumentProxy> UBDocumentController::selectedDocumentProxy() |
nothing calls this directly
no test coverage detected