summaryrefslogtreecommitdiff
path: root/platform/javascript
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-11-20 00:42:51 +0100
committerGitHub <noreply@github.com>2017-11-20 00:42:51 +0100
commitecf80fbbbadaa782cbe81a6562916331c6762970 (patch)
tree7a949f6a95f36303a2f2d193aeabd6486e13f4a1 /platform/javascript
parentbc26a5bd3a51b11bab63112275e7045c63a0ffc4 (diff)
parent6e3f2f44af808e9f4255c2462e16beee844c0df7 (diff)
Merge pull request #12988 from akien-mga/xdg-home-paths
Add support for XDG Base Directory spec
Diffstat (limited to 'platform/javascript')
-rw-r--r--platform/javascript/export/export.cpp2
-rw-r--r--platform/javascript/os_javascript.cpp10
-rw-r--r--platform/javascript/os_javascript.h8
3 files changed, 10 insertions, 10 deletions
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index d0d4b17874..9e741860de 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -272,7 +272,7 @@ int EditorExportPlatformJavaScript::get_device_count() const {
Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) {
- String path = EditorSettings::get_singleton()->get_settings_path() + "/tmp/tmp_export.html";
+ String path = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_export.html");
Error err = export_project(p_preset, true, path, p_debug_flags);
if (err) {
return err;
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index 54c0e81421..74cfec14a6 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -882,11 +882,11 @@ String OS_JavaScript::get_resource_dir() const {
return "/"; //javascript has it's own filesystem for resources inside the APK
}
-String OS_JavaScript::get_data_dir() const {
+String OS_JavaScript::get_user_data_dir() const {
/*
- if (get_data_dir_func)
- return get_data_dir_func();
+ if (get_user_data_dir_func)
+ return get_user_data_dir_func();
*/
return "/userfs";
};
@@ -986,7 +986,7 @@ bool OS_JavaScript::is_userfs_persistent() const {
return idbfs_available;
}
-OS_JavaScript::OS_JavaScript(const char *p_execpath, GetDataDirFunc p_get_data_dir_func) {
+OS_JavaScript::OS_JavaScript(const char *p_execpath, GetUserDataDirFunc p_get_user_data_dir_func) {
set_cmdline(p_execpath, get_cmdline_args());
main_loop = NULL;
gl_extensions = NULL;
@@ -994,7 +994,7 @@ OS_JavaScript::OS_JavaScript(const char *p_execpath, GetDataDirFunc p_get_data_d
soft_fs_enabled = false;
canvas_size_adjustment_requested = false;
- get_data_dir_func = p_get_data_dir_func;
+ get_user_data_dir_func = p_get_user_data_dir_func;
FileAccessUnix::close_notification_func = _close_notification_funcs;
idbfs_available = false;
diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h
index 85c185c10f..77eeb02a9f 100644
--- a/platform/javascript/os_javascript.h
+++ b/platform/javascript/os_javascript.h
@@ -41,7 +41,7 @@
#include <emscripten/html5.h>
-typedef String (*GetDataDirFunc)();
+typedef String (*GetUserDataDirFunc)();
class OS_JavaScript : public OS_Unix {
@@ -62,7 +62,7 @@ class OS_JavaScript : public OS_Unix {
CursorShape cursor_shape;
MainLoop *main_loop;
- GetDataDirFunc get_data_dir_func;
+ GetUserDataDirFunc get_user_data_dir_func;
PowerJavascript *power_manager;
@@ -141,7 +141,7 @@ public:
void set_opengl_extensions(const char *p_gl_extensions);
virtual Error shell_open(String p_uri);
- virtual String get_data_dir() const;
+ virtual String get_user_data_dir() const;
String get_executable_path() const;
virtual String get_resource_dir() const;
@@ -160,7 +160,7 @@ public:
void set_idbfs_available(bool p_idbfs_available);
- OS_JavaScript(const char *p_execpath, GetDataDirFunc p_get_data_dir_func);
+ OS_JavaScript(const char *p_execpath, GetUserDataDirFunc p_get_user_data_dir_func);
~OS_JavaScript();
};