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

Method importFile

src/core/UBApplicationController.cpp:708–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

706
707
708void UBApplicationController::importFile(const QString& pFilePath)
709{
710 const QFile fileToOpen(pFilePath);
711
712 if (!fileToOpen.exists())
713 return;
714
715 bool success = false;
716
717 std::shared_ptr<UBDocumentProxy> document = UBDocumentManager::documentManager()->importFile(fileToOpen, "");
718
719 success = (document != 0);
720
721 if (success && document)
722 {
723 if (UBApplication::boardController)
724 {
725 UBApplication::boardController->setActiveDocumentScene(document, 0, true, true);
726 }
727
728 if (UBApplication::documentController)
729 {
730 UBApplication::documentController->selectDocument(document, true, true);
731 }
732
733 // This import operation happens when double-clicking on a UBZ for example.
734 // The document is added and set as current document, so the user probably wants to see it immediately.
735 showBoard();
736 }
737}
738
739void UBApplicationController::useMultiScreen(bool use)
740{

Callers

nothing calls this directly

Calls 2

selectDocumentMethod · 0.80

Tested by

no test coverage detected