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

Method deleteScene

src/board/UBBoardController.cpp:908–931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906}
907
908void UBBoardController::deleteScene(int nIndex)
909{
910 if (selectedDocument()->pageCount()>=2)
911 {
912 mDeletingSceneIndex = nIndex;
913 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
914 persistCurrentScene();
915 UBApplication::showMessage(tr("Deleting page %1").arg(nIndex+1), true);
916
917 auto document = UBDocument::getDocument(selectedDocument());
918 document->deletePages({nIndex});
919
920 QDateTime now = QDateTime::currentDateTime();
921 selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(now));
922 UBMetadataDcSubsetAdaptor::persist(selectedDocument());
923
924 if (nIndex >= pageCount())
925 nIndex = pageCount()-1;
926 setActiveDocumentScene(nIndex);
927 UBApplication::showMessage(tr("Page %1 deleted").arg(nIndex+1));
928 QApplication::restoreOverrideCursor();
929 mDeletingSceneIndex = -1;
930 }
931}
932
933
934void UBBoardController::clearScene()

Callers

nothing calls this directly

Calls 3

setMetaDataMethod · 0.80
pageCountMethod · 0.45
deletePagesMethod · 0.45

Tested by

no test coverage detected