diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-03-23 11:08:58 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-04-11 13:28:51 +0300 |
commit | 9381acb6a42da653cb6dfd9e610dfccead11aa98 (patch) | |
tree | 7c781fabd1f496345ca73cc362a5f88060af0fde /main/main.cpp | |
parent | ca9372622f331f26daf38086a31c4eeea768e540 (diff) |
Make FileAccess and DirAccess classes reference counted.
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/main/main.cpp b/main/main.cpp index a99654542a..f20ec94fa5 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2112,8 +2112,8 @@ bool Main::start() { } { - DirAccessRef da = DirAccess::open(doc_tool_path); - ERR_FAIL_COND_V_MSG(!da, false, "Argument supplied to --doctool must be a valid directory path."); + Ref<DirAccess> da = DirAccess::open(doc_tool_path); + ERR_FAIL_COND_V_MSG(da.is_null(), false, "Argument supplied to --doctool must be a valid directory path."); } #ifndef MODULE_MONO_ENABLED @@ -2149,7 +2149,7 @@ bool Main::start() { checked_paths.insert(path); // Create the module documentation directory if it doesn't exist - DirAccessRef da = DirAccess::create_for_path(path); + Ref<DirAccess> da = DirAccess::create_for_path(path); err = da->make_dir_recursive(path); ERR_FAIL_COND_V_MSG(err != OK, false, "Error: Can't create directory: " + path + ": " + itos(err)); @@ -2161,7 +2161,7 @@ bool Main::start() { String index_path = doc_tool_path.plus_file("doc/classes"); // Create the main documentation directory if it doesn't exist - DirAccessRef da = DirAccess::create_for_path(index_path); + Ref<DirAccess> da = DirAccess::create_for_path(index_path); err = da->make_dir_recursive(index_path); ERR_FAIL_COND_V_MSG(err != OK, false, "Error: Can't create index directory: " + index_path + ": " + itos(err)); @@ -2501,11 +2501,11 @@ bool Main::start() { int sep = local_game_path.rfind("/"); if (sep == -1) { - DirAccessRef da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); local_game_path = da->get_current_dir().plus_file(local_game_path); } else { - DirAccessRef da = DirAccess::open(local_game_path.substr(0, sep)); - if (da) { + Ref<DirAccess> da = DirAccess::open(local_game_path.substr(0, sep)); + if (da.is_valid()) { local_game_path = da->get_current_dir().plus_file( local_game_path.substr(sep + 1, local_game_path.length())); } |