summaryrefslogtreecommitdiff
path: root/editor/editor_file_system.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-04-02 14:52:36 +0200
committerGitHub <noreply@github.com>2020-04-02 14:52:36 +0200
commit058a0afdeca83145d58a95c426dd01216c397ea9 (patch)
treebe0cd59e5a90926e9d653fed9f3b1b77e735ca2f /editor/editor_file_system.cpp
parent5f11e1557156617366d2c316a97716172103980d (diff)
parent95a1400a2ac9de1a29fa305f45b928ce8e3044bd (diff)
Merge pull request #37338 from lupoDharkael/nullprt
Replace NULL with nullptr
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r--editor/editor_file_system.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index ad34b59c5c..c211d5852a 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -41,7 +41,7 @@
#include "editor_resource_preview.h"
#include "editor_settings.h"
-EditorFileSystem *EditorFileSystem::singleton = NULL;
+EditorFileSystem *EditorFileSystem::singleton = nullptr;
//the name is the version, to keep compatibility with different versions of Godot
#define CACHE_FILE_NAME "filesystem_cache6"
@@ -75,7 +75,7 @@ int EditorFileSystemDirectory::get_subdir_count() const {
EditorFileSystemDirectory *EditorFileSystemDirectory::get_subdir(int p_idx) {
- ERR_FAIL_INDEX_V(p_idx, subdirs.size(), NULL);
+ ERR_FAIL_INDEX_V(p_idx, subdirs.size(), nullptr);
return subdirs[p_idx];
}
@@ -176,7 +176,7 @@ void EditorFileSystemDirectory::_bind_methods() {
EditorFileSystemDirectory::EditorFileSystemDirectory() {
modified_time = 0;
- parent = NULL;
+ parent = nullptr;
verified = false;
}
@@ -300,7 +300,7 @@ void EditorFileSystem::_scan_filesystem() {
sp.progress = &scan_progress;
new_filesystem = memnew(EditorFileSystemDirectory);
- new_filesystem->parent = NULL;
+ new_filesystem->parent = nullptr;
DirAccess *d = DirAccess::create(DirAccess::ACCESS_RESOURCES);
d->change_dir("res://");
@@ -383,7 +383,7 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo
next_tag.fields.clear();
next_tag.name = String();
- err = VariantParser::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, NULL, true);
+ err = VariantParser::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, nullptr, true);
if (err == ERR_FILE_EOF) {
break;
} else if (err != OK) {
@@ -430,7 +430,7 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo
next_tag.fields.clear();
next_tag.name = String();
- err = VariantParser::parse_tag_assign_eof(&md5_stream, lines, error_text, next_tag, assign, value, NULL, true);
+ err = VariantParser::parse_tag_assign_eof(&md5_stream, lines, error_text, next_tag, assign, value, nullptr, true);
if (err == ERR_FILE_EOF) {
break;
@@ -622,7 +622,7 @@ void EditorFileSystem::scan() {
memdelete(filesystem);
//file_type_cache.clear();
filesystem = new_filesystem;
- new_filesystem = NULL;
+ new_filesystem = nullptr;
_update_scan_actions();
scanning = false;
emit_signal("filesystem_changed");
@@ -1124,8 +1124,8 @@ void EditorFileSystem::_notification(int p_what) {
}
Thread::wait_to_finish(active_thread);
memdelete(active_thread);
- thread = NULL;
- thread_sources = NULL;
+ thread = nullptr;
+ thread_sources = nullptr;
WARN_PRINT("Scan thread aborted...");
set_process(false);
}
@@ -1134,8 +1134,8 @@ void EditorFileSystem::_notification(int p_what) {
memdelete(filesystem);
if (new_filesystem)
memdelete(new_filesystem);
- filesystem = NULL;
- new_filesystem = NULL;
+ filesystem = nullptr;
+ new_filesystem = nullptr;
} break;
case NOTIFICATION_PROCESS: {
@@ -1152,7 +1152,7 @@ void EditorFileSystem::_notification(int p_what) {
Thread::wait_to_finish(thread_sources);
memdelete(thread_sources);
- thread_sources = NULL;
+ thread_sources = nullptr;
if (_update_scan_actions())
emit_signal("filesystem_changed");
emit_signal("sources_changed", sources_changed.size() > 0);
@@ -1166,10 +1166,10 @@ void EditorFileSystem::_notification(int p_what) {
if (filesystem)
memdelete(filesystem);
filesystem = new_filesystem;
- new_filesystem = NULL;
+ new_filesystem = nullptr;
Thread::wait_to_finish(thread);
memdelete(thread);
- thread = NULL;
+ thread = nullptr;
_update_scan_actions();
emit_signal("filesystem_changed");
emit_signal("sources_changed", sources_changed.size() > 0);
@@ -1308,7 +1308,7 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector
String EditorFileSystem::get_file_type(const String &p_file) const {
- EditorFileSystemDirectory *fs = NULL;
+ EditorFileSystemDirectory *fs = nullptr;
int cpos = -1;
if (!_find_file(p_file, &fs, cpos)) {
@@ -1322,13 +1322,13 @@ String EditorFileSystem::get_file_type(const String &p_file) const {
EditorFileSystemDirectory *EditorFileSystem::find_file(const String &p_file, int *r_index) const {
if (!filesystem || scanning)
- return NULL;
+ return nullptr;
- EditorFileSystemDirectory *fs = NULL;
+ EditorFileSystemDirectory *fs = nullptr;
int cpos = -1;
if (!_find_file(p_file, &fs, cpos)) {
- return NULL;
+ return nullptr;
}
if (r_index)
@@ -1340,12 +1340,12 @@ EditorFileSystemDirectory *EditorFileSystem::find_file(const String &p_file, int
EditorFileSystemDirectory *EditorFileSystem::get_filesystem_path(const String &p_path) {
if (!filesystem || scanning)
- return NULL;
+ return nullptr;
String f = ProjectSettings::get_singleton()->localize_path(p_path);
if (!f.begins_with("res://"))
- return NULL;
+ return nullptr;
f = f.substr(6, f.length());
f = f.replace("\\", "/");
@@ -1358,7 +1358,7 @@ EditorFileSystemDirectory *EditorFileSystem::get_filesystem_path(const String &p
Vector<String> path = f.split("/");
if (path.size() == 0)
- return NULL;
+ return nullptr;
EditorFileSystemDirectory *fs = filesystem;
@@ -1374,7 +1374,7 @@ EditorFileSystemDirectory *EditorFileSystem::get_filesystem_path(const String &p
}
if (idx == -1) {
- return NULL;
+ return nullptr;
} else {
fs = fs->get_subdir(idx);
@@ -1483,7 +1483,7 @@ void EditorFileSystem::_queue_update_script_classes() {
void EditorFileSystem::update_file(const String &p_file) {
- EditorFileSystemDirectory *fs = NULL;
+ EditorFileSystemDirectory *fs = nullptr;
int cpos = -1;
if (!_find_file(p_file, &fs, cpos)) {
@@ -1684,7 +1684,7 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
}
md5s->close();
- EditorFileSystemDirectory *fs = NULL;
+ EditorFileSystemDirectory *fs = nullptr;
int cpos = -1;
bool found = _find_file(file, &fs, cpos);
ERR_FAIL_COND_V_MSG(!found, ERR_UNCONFIGURED, "Can't find file '" + file + "'.");
@@ -1718,7 +1718,7 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
void EditorFileSystem::_reimport_file(const String &p_file) {
- EditorFileSystemDirectory *fs = NULL;
+ EditorFileSystemDirectory *fs = nullptr;
int cpos = -1;
bool found = _find_file(p_file, &fs, cpos);
ERR_FAIL_COND_MSG(!found, "Can't find file '" + p_file + "'.");
@@ -1980,7 +1980,7 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
}
//group may have changed, so also update group reference
- EditorFileSystemDirectory *fs = NULL;
+ EditorFileSystemDirectory *fs = nullptr;
int cpos = -1;
if (_find_file(p_files[i], &fs, cpos)) {
@@ -2131,14 +2131,14 @@ EditorFileSystem::EditorFileSystem() {
singleton = this;
filesystem = memnew(EditorFileSystemDirectory); //like, empty
- filesystem->parent = NULL;
+ filesystem->parent = nullptr;
- thread = NULL;
+ thread = nullptr;
scanning = false;
importing = false;
use_threads = true;
- thread_sources = NULL;
- new_filesystem = NULL;
+ thread_sources = nullptr;
+ new_filesystem = nullptr;
abort_scan = false;
scanning_changes = false;