MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / emptyFolder

Method emptyFolder

src/document/UBDocumentController.cpp:3094–3120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3092}
3093
3094void 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
3122void UBDocumentController::deleteIndexAndAssociatedData(const QModelIndex &pIndex)
3123{

Callers

nothing calls this directly

Calls 5

isCatalogMethod · 0.80
moveIndexMethod · 0.80
trashIndexMethod · 0.80
rowCountMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected