| 3092 | } |
| 3093 | |
| 3094 | void UBDocumentController::emptyFolder(const QModelIndex &index, DeletionType pDeletionType) |
| 3095 | { |
| 3096 | QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
| 3097 | |
| 3098 | UBDocumentTreeModel *docModel = UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel; |
| 3099 | if (!docModel->isCatalog(index)) { |
| 3100 | return; |
| 3101 | } |
| 3102 | while (docModel->rowCount(index)) { |
| 3103 | QModelIndex subIndex = docModel->index(0, 0, index); |
| 3104 | switch (pDeletionType) { |
| 3105 | case MoveToTrash : |
| 3106 | docModel->moveIndex(subIndex, docModel->trashIndex()); |
| 3107 | break; |
| 3108 | |
| 3109 | case CompleteDelete : |
| 3110 | deleteIndexAndAssociatedData(subIndex); |
| 3111 | break; |
| 3112 | default: |
| 3113 | break; |
| 3114 | } |
| 3115 | |
| 3116 | } |
| 3117 | |
| 3118 | QApplication::restoreOverrideCursor(); |
| 3119 | // Fin issue NC - CFA - 20131029 |
| 3120 | } |
| 3121 | |
| 3122 | void UBDocumentController::deleteIndexAndAssociatedData(const QModelIndex &pIndex) |
| 3123 | { |
nothing calls this directly
no test coverage detected