Move app open routing into document helper

This commit is contained in:
2026-06-16 23:37:55 +02:00
parent 6b337b2d87
commit 42bae9db16
5 changed files with 67 additions and 19 deletions

View File

@@ -35,16 +35,7 @@ void App::create()
void App::open_document(std::string path)
{
const auto route = pp::app::classify_document_open_path(path);
if (!route)
return;
const bool has_unsaved_project =
route.value().kind == pp::app::DocumentOpenKind::open_project && Canvas::I->m_unsaved;
const auto open_plan = pp::app::plan_document_open(route.value().kind, has_unsaved_project);
const auto status = pp::panopainter::execute_legacy_document_open_plan(*this, open_plan, route.value());
if (!status.ok())
LOG("Document open action failed: %s", status.message);
pp::panopainter::execute_legacy_document_open(*this, std::move(path));
}
bool App::request_close()