Seed legacy platform storage explicitly and drop Android app handles
This commit is contained in:
@@ -155,10 +155,6 @@ public:
|
||||
int idle_ms = 100;
|
||||
pp::platform::PlatformServices* platform_services_ = nullptr;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
struct android_app* and_app;
|
||||
struct engine* and_engine;
|
||||
#endif
|
||||
std::string clipboard_get_text();
|
||||
bool clipboard_set_text(const std::string& s);
|
||||
void pick_image(std::function<void(std::string path)> callback);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "legacy_gl_runtime_dispatch.h"
|
||||
#include "legacy_preference_storage.h"
|
||||
#include "legacy_ui_gl_dispatch.h"
|
||||
#include "platform_legacy/legacy_platform_state.h"
|
||||
#include "platform_api/platform_services.h"
|
||||
#include "renderer_gl/opengl_capabilities.h"
|
||||
|
||||
@@ -134,6 +135,12 @@ void execute_legacy_app_init_log(App& app)
|
||||
|
||||
// TODO: save this path somewhere in the settings, don't overwrite every start
|
||||
app.work_path = paths.work_path.empty() ? app.data_path : paths.work_path;
|
||||
pp::platform::legacy::set_legacy_storage_paths({
|
||||
app.data_path,
|
||||
app.work_path,
|
||||
app.rec_path,
|
||||
app.tmp_path,
|
||||
});
|
||||
|
||||
//LogRemote::I.start();
|
||||
LogRemote::I.file_init();
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "platform_legacy/legacy_platform_state.h"
|
||||
|
||||
#include "app.h"
|
||||
|
||||
#if defined(__LINUX__) || defined(__WEB__)
|
||||
#include <GLFW/glfw3.h>
|
||||
#endif
|
||||
@@ -14,6 +12,12 @@ struct RetainedLegacyStoragePaths final {
|
||||
pp::platform::PlatformStoragePaths storage_paths;
|
||||
};
|
||||
|
||||
[[nodiscard]] RetainedLegacyStoragePaths& retained_legacy_storage_paths()
|
||||
{
|
||||
static RetainedLegacyStoragePaths state;
|
||||
return state;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if defined(__LINUX__) || defined(__WEB__)
|
||||
@@ -78,17 +82,12 @@ void set_legacy_apple_state(
|
||||
|
||||
[[nodiscard]] const pp::platform::PlatformStoragePaths& active_legacy_storage_paths()
|
||||
{
|
||||
static RetainedLegacyStoragePaths state = [] {
|
||||
RetainedLegacyStoragePaths retained;
|
||||
retained.storage_paths = {
|
||||
App::I->data_path,
|
||||
App::I->work_path,
|
||||
App::I->rec_path,
|
||||
App::I->tmp_path,
|
||||
};
|
||||
return retained;
|
||||
}();
|
||||
return state.storage_paths;
|
||||
return retained_legacy_storage_paths().storage_paths;
|
||||
}
|
||||
|
||||
void set_legacy_storage_paths(pp::platform::PlatformStoragePaths paths)
|
||||
{
|
||||
retained_legacy_storage_paths().storage_paths = std::move(paths);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,5 +59,6 @@ void set_legacy_apple_state(
|
||||
#endif
|
||||
|
||||
[[nodiscard]] const pp::platform::PlatformStoragePaths& active_legacy_storage_paths();
|
||||
void set_legacy_storage_paths(pp::platform::PlatformStoragePaths paths);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user