summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/io/ip.cpp14
-rw-r--r--doc/classes/EditorPaths.xml6
-rw-r--r--editor/editor_node.cpp2
-rw-r--r--editor/editor_paths.cpp4
-rw-r--r--editor/editor_paths.h2
-rw-r--r--editor/editor_settings.cpp8
6 files changed, 7 insertions, 29 deletions
diff --git a/core/io/ip.cpp b/core/io/ip.cpp
index de37ba87dd..001b1c4757 100644
--- a/core/io/ip.cpp
+++ b/core/io/ip.cpp
@@ -118,7 +118,6 @@ IPAddress IP::resolve_hostname(const String &p_hostname, IP::Type p_type) {
_resolve_hostname(res, p_hostname, p_type);
resolver->cache[key] = res;
}
- resolver->mutex.unlock();
for (int i = 0; i < res.size(); ++i) {
if (res[i].is_valid()) {
@@ -129,7 +128,7 @@ IPAddress IP::resolve_hostname(const String &p_hostname, IP::Type p_type) {
}
Array IP::resolve_hostname_addresses(const String &p_hostname, Type p_type) {
- resolver->mutex.lock();
+ MutexLock lock(resolver->mutex);
String key = _IP_ResolverPrivate::get_cache_key(p_hostname, p_type);
if (!resolver->cache.has(key)) {
@@ -137,7 +136,6 @@ Array IP::resolve_hostname_addresses(const String &p_hostname, Type p_type) {
}
List<IPAddress> res = resolver->cache[key];
- resolver->mutex.unlock();
Array result;
for (int i = 0; i < res.size(); ++i) {
@@ -184,7 +182,6 @@ IP::ResolverStatus IP::get_resolve_item_status(ResolverID p_id) const {
if (resolver->queue[p_id].status.get() == IP::RESOLVER_STATUS_NONE) {
ERR_PRINT("Condition status == IP::RESOLVER_STATUS_NONE");
- resolver->mutex.unlock();
return IP::RESOLVER_STATUS_NONE;
}
return resolver->queue[p_id].status.get();
@@ -197,14 +194,11 @@ IPAddress IP::get_resolve_item_address(ResolverID p_id) const {
if (resolver->queue[p_id].status.get() != IP::RESOLVER_STATUS_DONE) {
ERR_PRINT("Resolve of '" + resolver->queue[p_id].hostname + "'' didn't complete yet.");
- resolver->mutex.unlock();
return IPAddress();
}
List<IPAddress> res = resolver->queue[p_id].response;
- resolver->mutex.unlock();
-
for (int i = 0; i < res.size(); ++i) {
if (res[i].is_valid()) {
return res[i];
@@ -215,19 +209,15 @@ IPAddress IP::get_resolve_item_address(ResolverID p_id) const {
Array IP::get_resolve_item_addresses(ResolverID p_id) const {
ERR_FAIL_INDEX_V(p_id, IP::RESOLVER_MAX_QUERIES, Array());
-
- resolver->mutex.lock();
+ MutexLock lock(resolver->mutex);
if (resolver->queue[p_id].status.get() != IP::RESOLVER_STATUS_DONE) {
ERR_PRINT("Resolve of '" + resolver->queue[p_id].hostname + "'' didn't complete yet.");
- resolver->mutex.unlock();
return Array();
}
List<IPAddress> res = resolver->queue[p_id].response;
- resolver->mutex.unlock();
-
Array result;
for (int i = 0; i < res.size(); ++i) {
if (res[i].is_valid()) {
diff --git a/doc/classes/EditorPaths.xml b/doc/classes/EditorPaths.xml
index b92927fd53..d0d785dbb8 100644
--- a/doc/classes/EditorPaths.xml
+++ b/doc/classes/EditorPaths.xml
@@ -31,12 +31,6 @@
<description>
</description>
</method>
- <method name="get_settings_dir" qualifiers="const">
- <return type="String">
- </return>
- <description>
- </description>
- </method>
<method name="is_self_contained" qualifiers="const">
<return type="bool">
</return>
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 9c77f9d25c..85d19eb747 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -2754,7 +2754,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
OS::get_singleton()->shell_open(String("file://") + EditorPaths::get_singleton()->get_data_dir());
} break;
case SETTINGS_EDITOR_CONFIG_FOLDER: {
- OS::get_singleton()->shell_open(String("file://") + EditorPaths::get_singleton()->get_settings_dir());
+ OS::get_singleton()->shell_open(String("file://") + EditorPaths::get_singleton()->get_config_dir());
} break;
case SETTINGS_MANAGE_EXPORT_TEMPLATES: {
export_template_manager->popup_manager();
diff --git a/editor/editor_paths.cpp b/editor/editor_paths.cpp
index 96469d3143..474da4fb96 100644
--- a/editor/editor_paths.cpp
+++ b/editor/editor_paths.cpp
@@ -38,9 +38,6 @@ bool EditorPaths::are_paths_valid() const {
return paths_valid;
}
-String EditorPaths::get_settings_dir() const {
- return settings_dir;
-}
String EditorPaths::get_data_dir() const {
return data_dir;
}
@@ -67,7 +64,6 @@ void EditorPaths::free() {
}
void EditorPaths::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_settings_dir"), &EditorPaths::get_settings_dir);
ClassDB::bind_method(D_METHOD("get_data_dir"), &EditorPaths::get_data_dir);
ClassDB::bind_method(D_METHOD("get_config_dir"), &EditorPaths::get_config_dir);
ClassDB::bind_method(D_METHOD("get_cache_dir"), &EditorPaths::get_cache_dir);
diff --git a/editor/editor_paths.h b/editor/editor_paths.h
index 096174943d..c1be33f5c2 100644
--- a/editor/editor_paths.h
+++ b/editor/editor_paths.h
@@ -37,7 +37,6 @@ class EditorPaths : public Object {
GDCLASS(EditorPaths, Object)
bool paths_valid = false;
- String settings_dir;
String data_dir; //editor data dir
String config_dir; //editor config dir
String cache_dir; //editor cache dir
@@ -52,7 +51,6 @@ protected:
public:
bool are_paths_valid() const;
- String get_settings_dir() const;
String get_data_dir() const;
String get_config_dir() const;
String get_cache_dir() const;
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index e4072f7d4b..ce8c49279f 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -1264,11 +1264,11 @@ String EditorSettings::get_project_settings_dir() const {
}
String EditorSettings::get_text_editor_themes_dir() const {
- return EditorPaths::get_singleton()->get_settings_dir().plus_file("text_editor_themes");
+ return EditorPaths::get_singleton()->get_config_dir().plus_file("text_editor_themes");
}
String EditorSettings::get_script_templates_dir() const {
- return EditorPaths::get_singleton()->get_settings_dir().plus_file("script_templates");
+ return EditorPaths::get_singleton()->get_config_dir().plus_file("script_templates");
}
String EditorSettings::get_project_script_templates_dir() const {
@@ -1278,7 +1278,7 @@ String EditorSettings::get_project_script_templates_dir() const {
// Cache directory
String EditorSettings::get_feature_profiles_dir() const {
- return EditorPaths::get_singleton()->get_settings_dir().plus_file("feature_profiles");
+ return EditorPaths::get_singleton()->get_config_dir().plus_file("feature_profiles");
}
// Metadata
@@ -1505,7 +1505,7 @@ Vector<String> EditorSettings::get_script_templates(const String &p_extension, c
}
String EditorSettings::get_editor_layouts_config() const {
- return EditorPaths::get_singleton()->get_settings_dir().plus_file("editor_layouts.cfg");
+ return EditorPaths::get_singleton()->get_config_dir().plus_file("editor_layouts.cfg");
}
// Shortcuts