diff options
Diffstat (limited to 'editor/editor_asset_installer.cpp')
-rw-r--r-- | editor/editor_asset_installer.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 8dd3045887..5d4c746785 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -88,7 +88,7 @@ void EditorAssetInstaller::_item_edited() { String path = item->get_metadata(0); updating = true; - if (path == String() || item == tree->get_root()) { //a dir or root + if (path.is_empty() || item == tree->get_root()) { //a dir or root _update_subitems(item, item->is_checked(0), true); } @@ -124,7 +124,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { char fname[16384]; unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); - String name = fname; + String name = String::utf8(fname); files_sorted.insert(name); ret = unzGoToNextFile(pkg); @@ -140,7 +140,6 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { extension_guess["jpeg"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons")); extension_guess["png"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons")); extension_guess["svg"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons")); - extension_guess["svgz"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons")); extension_guess["tga"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons")); extension_guess["webp"] = tree->get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons")); @@ -212,7 +211,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { depth--; } - if (skip || path == String()) { + if (skip || path.is_empty()) { continue; } @@ -303,11 +302,11 @@ void EditorAssetInstaller::ok_pressed() { char fname[16384]; ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); - String name = fname; + String name = String::utf8(fname); if (status_map.has(name) && status_map[name]->is_checked(0)) { String path = status_map[name]->get_metadata(0); - if (path == String()) { // a dir + if (path.is_empty()) { // a dir String dirpath; TreeItem *t = status_map[name]; |