Route document browse roots through platform services

This commit is contained in:
2026-06-04 16:41:56 +02:00
parent 6419645e03
commit 7d992931d9
10 changed files with 74 additions and 8 deletions

View File

@@ -206,6 +206,7 @@ public:
void clear_platform_recorded_files(std::string path);
void publish_exported_image(std::string path);
void flush_platform_storage();
[[nodiscard]] std::vector<std::string> document_browse_roots() const;
[[nodiscard]] bool platform_enables_live_asset_reloading();
void update_platform_frame(float delta_time_seconds);
void report_rendered_frames(int frames);

View File

@@ -238,11 +238,7 @@ void App::dialog_browse()
// load thumbnail test
auto dialog = std::make_shared<NodeDialogBrowse>();
dialog->set_manager(&layout);
#ifdef __IOS__
dialog->search_paths = {work_path, data_path + "/Inbox"};
#else
dialog->search_paths = {work_path};
#endif
dialog->search_paths = document_browse_roots();
dialog->init();
dialog->create();
dialog->loaded();

View File

@@ -287,6 +287,11 @@ void App::flush_platform_storage()
active_platform_services().flush_persistent_storage();
}
std::vector<std::string> App::document_browse_roots() const
{
return active_platform_services().document_browse_roots(work_path, data_path);
}
bool App::platform_enables_live_asset_reloading()
{
return active_platform_services().enables_live_asset_reloading();

View File

@@ -43,6 +43,9 @@ public:
virtual void clear_recorded_files(std::string_view recording_path) = 0;
virtual void publish_exported_image(std::string_view path) = 0;
virtual void flush_persistent_storage() = 0;
[[nodiscard]] virtual std::vector<std::string> document_browse_roots(
std::string_view work_path,
std::string_view data_path) = 0;
[[nodiscard]] virtual bool enables_live_asset_reloading() = 0;
virtual void update_platform_frame(float delta_time_seconds) = 0;
virtual void report_rendered_frames(int frames) = 0;

View File

@@ -298,6 +298,21 @@ public:
#endif
}
[[nodiscard]] std::vector<std::string> document_browse_roots(
std::string_view work_path,
std::string_view data_path) override
{
#ifdef __IOS__
return {
std::string(work_path),
std::string(data_path) + "/Inbox",
};
#else
(void)data_path;
return { std::string(work_path) };
#endif
}
[[nodiscard]] bool enables_live_asset_reloading() override
{
#if defined(__OSX__)

View File

@@ -378,6 +378,14 @@ public:
{
}
[[nodiscard]] std::vector<std::string> document_browse_roots(
std::string_view work_path,
std::string_view data_path) override
{
(void)data_path;
return { std::string(work_path) };
}
[[nodiscard]] bool enables_live_asset_reloading() override
{
return true;