diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/io/resource_import.cpp | 13 | ||||
-rw-r--r-- | core/io/resource_import.h | 2 | ||||
-rw-r--r-- | core/translation.cpp | 14 | ||||
-rw-r--r-- | core/translation.h | 1 |
4 files changed, 26 insertions, 4 deletions
diff --git a/core/io/resource_import.cpp b/core/io/resource_import.cpp index 18fd8d25e7..d0799cdbe6 100644 --- a/core/io/resource_import.cpp +++ b/core/io/resource_import.cpp @@ -109,7 +109,11 @@ void ResourceFormatImporter::get_recognized_extensions_for_type(const String& p_ Set<String> found; for (Set< Ref<ResourceImporter> >::Element *E=importers.front();E;E=E->next()) { - if (!ClassDB::is_parent_class(E->get()->get_resource_type(),p_type)) + String res_type = E->get()->get_resource_type(); + if (res_type==String()) + continue; + + if (!ClassDB::is_parent_class(res_type,p_type)) continue; List<String> local_exts; @@ -138,8 +142,11 @@ bool ResourceFormatImporter::can_be_imported(const String& p_path) const { bool ResourceFormatImporter::handles_type(const String& p_type) const { for (Set< Ref<ResourceImporter> >::Element *E=importers.front();E;E=E->next()) { - print_line("handles "+p_type+" base is "+E->get()->get_resource_type()); - if (ClassDB::is_parent_class(E->get()->get_resource_type(),p_type)) + + String res_type = E->get()->get_resource_type(); + if (res_type==String()) + continue; + if (ClassDB::is_parent_class(res_type,p_type)) return true; } diff --git a/core/io/resource_import.h b/core/io/resource_import.h index d54308b6ed..939cecfbd9 100644 --- a/core/io/resource_import.h +++ b/core/io/resource_import.h @@ -69,7 +69,7 @@ public: virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const=0; - virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants)=0; + virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL)=0; }; diff --git a/core/translation.cpp b/core/translation.cpp index d5ec61b8d6..8835cb133c 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -751,6 +751,20 @@ static const char* locale_names[]={ 0 }; +bool TranslationServer::is_locale_valid(const String& p_locale) { + + const char **ptr=locale_list; + + while (*ptr) { + + if (*ptr==p_locale) + return true; + ptr++; + } + + return false; + +} Vector<String> TranslationServer::get_all_locales() { diff --git a/core/translation.h b/core/translation.h index 85ab4a229d..feed352549 100644 --- a/core/translation.h +++ b/core/translation.h @@ -102,6 +102,7 @@ public: static Vector<String> get_all_locales(); static Vector<String> get_all_locale_names(); + static bool is_locale_valid(const String& p_locale); void set_tool_translation(const Ref<Translation>& p_translation); StringName tool_translate(const StringName& p_message) const; |