diff options
| author | Juan Linietsky <reduzio@gmail.com> | 2017-01-14 00:51:09 -0300 | 
|---|---|---|
| committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-14 00:51:09 -0300 | 
| commit | d9d77291bca8dd1e87aa4d9e40de96d99e5ef1f6 (patch) | |
| tree | f5c92321612fdd5f8967c349898d3475b52bf930 | |
| parent | f3b6177ece8a06e52870ed422cbcc67276606e5a (diff) | |
rename String.extension() -> String.get_extension() / String.basename() -> String.get_basename()
51 files changed, 113 insertions, 113 deletions
diff --git a/core/globals.cpp b/core/globals.cpp index 28fabac302..b89303b728 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -329,7 +329,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) {  		String candidate = d->get_current_dir();  		String current_dir = d->get_current_dir(); -		String exec_name = OS::get_singleton()->get_executable_path().get_file().basename(); +		String exec_name = OS::get_singleton()->get_executable_path().get_file().get_basename();  		bool found = false;  		bool first_time=true; diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index c4439f2599..87f07cb7b1 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -165,7 +165,7 @@ unzFile ZipArchive::get_file_handle(String p_file) const {  bool ZipArchive::try_open_pack(const String& p_name) {  	//printf("opening zip pack %ls, %i, %i\n", p_name.c_str(), p_name.extension().nocasecmp_to("zip"), p_name.extension().nocasecmp_to("pcz")); -	if (p_name.extension().nocasecmp_to("zip") != 0 && p_name.extension().nocasecmp_to("pcz") != 0) +	if (p_name.get_extension().nocasecmp_to("zip") != 0 && p_name.get_extension().nocasecmp_to("pcz") != 0)  		return false;  	zlib_filefunc_def io; diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp index d4d10e2126..2b01e865f4 100644 --- a/core/io/image_loader.cpp +++ b/core/io/image_loader.cpp @@ -36,7 +36,7 @@ bool ImageFormatLoader::recognize(const String& p_extension) const {  	get_recognized_extensions(&extensions);  	for (List<String>::Element *E=extensions.front();E;E=E->next()) { -		if (E->get().nocasecmp_to(p_extension.extension())==0) +		if (E->get().nocasecmp_to(p_extension.get_extension())==0)  			return true;  	} @@ -56,7 +56,7 @@ Error ImageLoader::load_image(String p_file,Image *p_image, FileAccess *p_custom  		}  	} -	String extension = p_file.extension(); +	String extension = p_file.get_extension();  	for (int i=0;i<loader_count;i++) { diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index cc3c8ce006..777c57a6a6 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -55,7 +55,7 @@ bool ResourceFormatLoader::recognize(const String& p_extension) const {  	get_recognized_extensions(&extensions);  	for (List<String>::Element *E=extensions.front();E;E=E->next()) { -		if (E->get().nocasecmp_to(p_extension.extension())==0) +		if (E->get().nocasecmp_to(p_extension.get_extension())==0)  			return true;  	} @@ -182,7 +182,7 @@ RES ResourceLoader::load(const String &p_path, const String& p_type_hint, bool p  	if (OS::get_singleton()->is_stdout_verbose())  		print_line("load resource: "+remapped_path); -	String extension=remapped_path.extension(); +	String extension=remapped_path.get_extension();  	bool found=false;  	for (int i=0;i<loader_count;i++) { @@ -230,7 +230,7 @@ Ref<ResourceImportMetadata> ResourceLoader::load_import_metadata(const String &p  	else  		local_path = GlobalConfig::get_singleton()->localize_path(p_path); -	String extension=p_path.extension(); +	String extension=p_path.get_extension();  	Ref<ResourceImportMetadata> ret;  	for (int i=0;i<loader_count;i++) { @@ -331,7 +331,7 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_  	String remapped_path = PathRemap::get_singleton()->get_remap(local_path); -	String extension=remapped_path.extension(); +	String extension=remapped_path.get_extension();  	bool found=false;  	for (int i=0;i<loader_count;i++) { @@ -385,7 +385,7 @@ void ResourceLoader::get_dependencies(const String& p_path, List<String> *p_depe  	String remapped_path = PathRemap::get_singleton()->get_remap(local_path); -	String extension=remapped_path.extension(); +	String extension=remapped_path.get_extension();  	for (int i=0;i<loader_count;i++) { @@ -410,7 +410,7 @@ Error ResourceLoader::rename_dependencies(const String &p_path,const Map<String,  	String remapped_path = PathRemap::get_singleton()->get_remap(local_path); -	String extension=remapped_path.extension(); +	String extension=remapped_path.get_extension();  	for (int i=0;i<loader_count;i++) { @@ -449,7 +449,7 @@ String ResourceLoader::get_resource_type(const String &p_path) {  		local_path = GlobalConfig::get_singleton()->localize_path(p_path);  	String remapped_path = PathRemap::get_singleton()->get_remap(local_path); -	String extension=remapped_path.extension(); +	String extension=remapped_path.get_extension();  	for (int i=0;i<loader_count;i++) { diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index 9081adaa8f..222d3e6bc0 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -40,7 +40,7 @@ ResourceSavedCallback ResourceSaver::save_callback=0;  Error ResourceSaver::save(const String &p_path,const RES& p_resource,uint32_t p_flags) { -	String extension=p_path.extension(); +	String extension=p_path.get_extension();  	Error err=ERR_FILE_UNRECOGNIZED;  	for (int i=0;i<saver_count;i++) { @@ -54,7 +54,7 @@ Error ResourceSaver::save(const String &p_path,const RES& p_resource,uint32_t p_  		for (List<String>::Element *E=extensions.front();E;E=E->next()) { -			if (E->get().nocasecmp_to(extension.extension())==0) +			if (E->get().nocasecmp_to(extension.get_extension())==0)  				recognized=true;  		} diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 8c4c1c8180..bee38e037f 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -204,7 +204,7 @@ bool TranslationLoaderPO::handles_type(const String& p_type) const{  String TranslationLoaderPO::get_resource_type(const String &p_path) const { -	if (p_path.extension().to_lower()=="po") +	if (p_path.get_extension().to_lower()=="po")  		return "Translation";  	return "";  } diff --git a/core/ustring.cpp b/core/ustring.cpp index 27bb8eac72..cce355afd5 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3812,7 +3812,7 @@ String String::get_file() const {  	return substr(sep+1,length());  } -String String::extension() const { +String String::get_extension() const {  	int pos = find_last(".");  	if (pos<0) @@ -3891,7 +3891,7 @@ String String::percent_decode() const {  	return String::utf8(pe.ptr());  } -String String::basename() const { +String String::get_basename() const {  	int pos = find_last(".");  	if (pos<0) diff --git a/core/ustring.h b/core/ustring.h index 9a145143d0..674551ec80 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -176,8 +176,8 @@ public:  	String right(int p_pos) const;  	String strip_edges(bool left = true, bool right = true) const;  	String strip_escapes() const; -	String extension() const; -	String basename() const; +	String get_extension() const; +	String get_basename() const;  	String plus_file(const String& p_file) const;  	CharType ord_at(int p_idx) const; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index b20f8aafd1..f51abe7289 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -272,8 +272,8 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var  	VCALL_LOCALMEM1R(String,left);  	VCALL_LOCALMEM1R(String,right);  	VCALL_LOCALMEM2R(String,strip_edges); -	VCALL_LOCALMEM0R(String,extension); -	VCALL_LOCALMEM0R(String,basename); +	VCALL_LOCALMEM0R(String,get_extension); +	VCALL_LOCALMEM0R(String,get_basename);  	VCALL_LOCALMEM1R(String,plus_file);  	VCALL_LOCALMEM1R(String,ord_at);  	VCALL_LOCALMEM2(String,erase); @@ -1405,8 +1405,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl  	ADDFUNC1(STRING,STRING,String,left,INT,"pos",varray());  	ADDFUNC1(STRING,STRING,String,right,INT,"pos",varray());  	ADDFUNC2(STRING,STRING,String,strip_edges,BOOL,"left",BOOL,"right",varray(true,true)); -	ADDFUNC0(STRING,STRING,String,extension,varray()); -	ADDFUNC0(STRING,STRING,String,basename,varray()); +	ADDFUNC0(STRING,STRING,String,get_extension,varray()); +	ADDFUNC0(STRING,STRING,String,get_basename,varray());  	ADDFUNC1(STRING,STRING,String,plus_file,STRING,"file",varray());  	ADDFUNC1(STRING,INT,String,ord_at,INT,"at",varray());  	ADDFUNC2(STRING,NIL,String,erase,INT,"pos",INT,"chars", varray()); diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index 1ee27ec661..4f4e76d517 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -1026,7 +1026,7 @@ MainLoop* test(TestType p_test) {  	} else if (p_test==TEST_BYTECODE) {  		Vector<uint8_t> buf = GDTokenizerBuffer::parse_code_string(code); -		String dst = test.basename()+".gdc"; +		String dst = test.get_basename()+".gdc";  		FileAccess *fw = FileAccess::open(dst,FileAccess::WRITE);  		fw->store_buffer(buf.ptr(),buf.size());  		memdelete(fw); diff --git a/modules/chibi/event_stream_chibi.cpp b/modules/chibi/event_stream_chibi.cpp index 73d1c01e33..8bccdb3102 100644 --- a/modules/chibi/event_stream_chibi.cpp +++ b/modules/chibi/event_stream_chibi.cpp @@ -785,7 +785,7 @@ RES ResourceFormatLoaderChibi::load(const String &p_path, const String& p_origin  	if (r_error)  		*r_error=ERR_FILE_CANT_OPEN; -	String el = p_path.extension().to_lower(); +	String el = p_path.get_extension().to_lower();  	CPFileAccessWrapperImpl f; @@ -849,7 +849,7 @@ bool ResourceFormatLoaderChibi::handles_type(const String& p_type) const {  }  String ResourceFormatLoaderChibi::get_resource_type(const String &p_path) const { -	String el = p_path.extension().to_lower(); +	String el = p_path.get_extension().to_lower();  	if (el=="it" || el=="s3m" || el=="xm" || el=="mod")  		return "EventStreamChibi";  	return ""; diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 1de98a6b1f..82deae9630 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -478,7 +478,7 @@ bool ResourceFormatDDS::handles_type(const String& p_type) const {  String ResourceFormatDDS::get_resource_type(const String &p_path) const { -	if (p_path.extension().to_lower()=="dds") +	if (p_path.get_extension().to_lower()=="dds")  		return "ImageTexture";  	return "";  } diff --git a/modules/etc1/texture_loader_pkm.cpp b/modules/etc1/texture_loader_pkm.cpp index 42c9937b8f..e720e1fb4c 100644 --- a/modules/etc1/texture_loader_pkm.cpp +++ b/modules/etc1/texture_loader_pkm.cpp @@ -78,7 +78,7 @@ bool ResourceFormatPKM::handles_type(const String& p_type) const {  String ResourceFormatPKM::get_resource_type(const String &p_path) const { -	if (p_path.extension().to_lower()=="pkm") +	if (p_path.get_extension().to_lower()=="pkm")  		return "ImageTexture";  	return "";  } diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index 00b080190f..ab917fc869 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -671,7 +671,7 @@ static bool _guess_expression_type(GDCompletionContext& context,const GDParser::  												if (!script.ends_with(".gd")) {  													//not a script, try find the script anyway,  													//may have some success -													script=script.basename()+".gd"; +													script=script.get_basename()+".gd";  												}  												if (FileAccess::exists(script)) { @@ -1168,7 +1168,7 @@ static bool _guess_identifier_type(GDCompletionContext& context,int p_line,const  				if (!script.ends_with(".gd")) {  					//not a script, try find the script anyway,  					//may have some success -					script=script.basename()+".gd"; +					script=script.get_basename()+".gd";  				}  				if (FileAccess::exists(script)) { @@ -2832,7 +2832,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol  							if (!script.ends_with(".gd")) {  								//not a script, try find the script anyway,  								//may have some success -								script=script.basename()+".gd"; +								script=script.get_basename()+".gd";  							}  							if (FileAccess::exists(script)) { diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index ad012e54b1..6ff29072c7 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -2068,7 +2068,7 @@ bool ResourceFormatLoaderGDScript::handles_type(const String& p_type) const {  String ResourceFormatLoaderGDScript::get_resource_type(const String &p_path) const { -	String el = p_path.extension().to_lower(); +	String el = p_path.get_extension().to_lower();  	if (el=="gd" || el=="gdc" || el=="gde")  		return "GDScript";  	return ""; diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index 11bdf783f8..051d1d85cd 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -100,7 +100,7 @@ public:  						if (err==OK) {  							fae->store_buffer(file.ptr(),file.size()); -							p_path=p_path.basename()+".gde"; +							p_path=p_path.get_basename()+".gde";  						}  						memdelete(fae); @@ -111,7 +111,7 @@ public:  					} else { -						p_path=p_path.basename()+".gdc"; +						p_path=p_path.get_basename()+".gdc";  						return file;  					}  				} diff --git a/modules/opus/audio_stream_opus.cpp b/modules/opus/audio_stream_opus.cpp index f438dde689..4a6b2e224c 100644 --- a/modules/opus/audio_stream_opus.cpp +++ b/modules/opus/audio_stream_opus.cpp @@ -366,7 +366,7 @@ void ResourceFormatLoaderAudioStreamOpus::get_recognized_extensions(List<String>  }  String ResourceFormatLoaderAudioStreamOpus::get_resource_type(const String &p_path) const { -	if (p_path.extension().to_lower()=="opus") +	if (p_path.get_extension().to_lower()=="opus")  		return "AudioStreamOpus";  	return "";  } diff --git a/modules/pbm/bitmap_loader_pbm.cpp b/modules/pbm/bitmap_loader_pbm.cpp index 6caaf10334..ab0805a6b0 100644 --- a/modules/pbm/bitmap_loader_pbm.cpp +++ b/modules/pbm/bitmap_loader_pbm.cpp @@ -244,7 +244,7 @@ bool ResourceFormatPBM::handles_type(const String& p_type) const {  }  String ResourceFormatPBM::get_resource_type(const String &p_path) const { -	if (p_path.extension().to_lower()=="pbm") +	if (p_path.get_extension().to_lower()=="pbm")  		return "BitMap";  	return "";  } diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index 9f8db98e05..564cd6687c 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -185,7 +185,7 @@ bool ResourceFormatPVR::handles_type(const String& p_type) const {  String ResourceFormatPVR::get_resource_type(const String &p_path) const { -	if (p_path.extension().to_lower()=="pvr") +	if (p_path.get_extension().to_lower()=="pvr")  		return "Texture";  	return "";  } diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index b847f17bb7..5fe11c8d4c 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -933,7 +933,7 @@ bool ResourceFormatLoaderVideoStreamTheora::handles_type(const String& p_type) c  String ResourceFormatLoaderVideoStreamTheora::get_resource_type(const String &p_path) const { -	String exl=p_path.extension().to_lower(); +	String exl=p_path.get_extension().to_lower();  	if (exl=="ogm" || exl=="ogv")  		return "VideoStreamTheora";  	return ""; diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index 7abcd0a8b7..4a18e88060 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -419,7 +419,7 @@ void ResourceFormatLoaderAudioStreamOGGVorbis::get_recognized_extensions(List<St  }  String ResourceFormatLoaderAudioStreamOGGVorbis::get_resource_type(const String &p_path) const { -	if (p_path.extension().to_lower()=="ogg") +	if (p_path.get_extension().to_lower()=="ogg")  		return "AudioStreamOGGVorbis";  	return "";  } diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index d132e89690..bdd97f1df7 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -415,7 +415,7 @@ bool ResourceFormatLoaderVideoStreamWebm::handles_type(const String &p_type) con  String ResourceFormatLoaderVideoStreamWebm::get_resource_type(const String &p_path) const { -	const String exl = p_path.extension().to_lower(); +	const String exl = p_path.get_extension().to_lower();  	if (exl == "webm")  		return "VideoStreamWebm";  	return ""; diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index c151bff45c..33776bc273 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -265,7 +265,7 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool  	FileAccess *f=FileAccess::open(p_path.get_base_dir()+"/data.pck",FileAccess::WRITE);  	if (!f) { -		EditorNode::add_io_error("Could not create file for writing:\n"+p_path.basename()+"_files.js"); +		EditorNode::add_io_error("Could not create file for writing:\n"+p_path.get_basename()+"_files.js");  		return ERR_FILE_CANT_WRITE;  	}  	Error err = save_pack(f); @@ -307,32 +307,32 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool  		if (file=="godot.html") { -			_fix_html(data,p_path.get_file().basename(), p_debug); +			_fix_html(data,p_path.get_file().get_basename(), p_debug);  			file=p_path.get_file();  		}  		if (file=="godotfs.js") {  			_fix_files(data,len); -			file=p_path.get_file().basename()+"fs.js"; +			file=p_path.get_file().get_basename()+"fs.js";  		}  		if (file=="godot.js") { -			file=p_path.get_file().basename()+".js"; +			file=p_path.get_file().get_basename()+".js";  		}  		if (file=="godot.asm.js") { -			file=p_path.get_file().basename()+".asm.js"; +			file=p_path.get_file().get_basename()+".asm.js";  		}  		if (file=="godot.mem") { -			file=p_path.get_file().basename()+".mem"; +			file=p_path.get_file().get_basename()+".mem";  		}  		if (file=="godot.wasm") { -			file=p_path.get_file().basename()+".wasm"; +			file=p_path.get_file().get_basename()+".wasm";  		}  		String dst = p_path.get_base_dir().plus_file(file); diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 1844df5eef..4648384480 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -612,7 +612,7 @@ void AppxPackager::make_content_types() {  	for (int i = 0; i < file_metadata.size(); i++) { -		String ext = file_metadata[i].name.extension(); +		String ext = file_metadata[i].name.get_extension();  		if (types.has(ext)) continue; diff --git a/scene/io/resource_format_image.cpp b/scene/io/resource_format_image.cpp index cc3d9baa74..2d098d01f5 100644 --- a/scene/io/resource_format_image.cpp +++ b/scene/io/resource_format_image.cpp @@ -36,7 +36,7 @@ RES ResourceFormatLoaderImage::load(const String &p_path, const String& p_origin  	if (r_error)  		*r_error=ERR_CANT_OPEN; -	if (p_path.extension()=="cube") { +	if (p_path.get_extension()=="cube") {  		// open as cubemap txture  		CubeMap* ptr = memnew(CubeMap); @@ -235,7 +235,7 @@ void ResourceFormatLoaderImage::get_recognized_extensions(List<String> *p_extens  String ResourceFormatLoaderImage::get_resource_type(const String &p_path) const { -	String ext=p_path.extension().to_lower(); +	String ext=p_path.get_extension().to_lower();  	if (ext=="cube")  		return "CubeMap"; diff --git a/scene/io/resource_format_wav.cpp b/scene/io/resource_format_wav.cpp index f75836d2df..0a19e6f72b 100644 --- a/scene/io/resource_format_wav.cpp +++ b/scene/io/resource_format_wav.cpp @@ -267,7 +267,7 @@ bool ResourceFormatLoaderWAV::handles_type(const String& p_type) const {  String ResourceFormatLoaderWAV::get_resource_type(const String &p_path) const { -	if (p_path.extension().to_lower()=="wav") +	if (p_path.get_extension().to_lower()=="wav")  		return "Sample";  	return "";  } diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 3aadbdbe19..bb1552e2d6 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -961,7 +961,7 @@ bool ResourceFormatLoaderDynamicFont::handles_type(const String& p_type) const {  String ResourceFormatLoaderDynamicFont::get_resource_type(const String &p_path) const { -	String el = p_path.extension().to_lower(); +	String el = p_path.get_extension().to_lower();  	if (el=="ttf" || el=="otf")  		return "DynamicFontData";  	return ""; diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index fa56f63465..448e18ce39 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -984,7 +984,7 @@ String ResourceFormatLoaderText::get_resource_type(const String &p_path) const{ -	String ext=p_path.extension().to_lower(); +	String ext=p_path.get_extension().to_lower();  	if (ext=="tscn")  		return "PackedScene";  	else if (ext!="tres") diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 2e3afbf057..0ddc907aa0 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -1147,7 +1147,7 @@ bool ResourceFormatLoaderTheme::handles_type(const String& p_type) const {  String ResourceFormatLoaderTheme::get_resource_type(const String &p_path) const { -	if (p_path.extension().to_lower()=="theme") +	if (p_path.get_extension().to_lower()=="theme")  		return "Theme";  	return "";  } diff --git a/tools/editor/editor_asset_installer.cpp b/tools/editor/editor_asset_installer.cpp index 54099ddce5..9992100ff8 100644 --- a/tools/editor/editor_asset_installer.cpp +++ b/tools/editor/editor_asset_installer.cpp @@ -196,7 +196,7 @@ void EditorAssetInstaller::open(const String& p_path,int p_depth) {  			ti->set_icon(0,get_icon("folder","FileDialog"));  		} else {  			String file = path.get_file(); -			String extension = file.extension().to_lower(); +			String extension = file.get_extension().to_lower();  			if (extension_guess.has(extension)) {  				ti->set_icon(0,extension_guess[extension]);  			} else { diff --git a/tools/editor/editor_autoload_settings.cpp b/tools/editor/editor_autoload_settings.cpp index 071a237ea8..087bf1a3b7 100644 --- a/tools/editor/editor_autoload_settings.cpp +++ b/tools/editor/editor_autoload_settings.cpp @@ -307,7 +307,7 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu  void EditorAutoloadSettings::_autoload_file_callback(const String& p_path) { -	autoload_add_name->set_text(p_path.get_file().basename()); +	autoload_add_name->set_text(p_path.get_file().get_basename());  }  void EditorAutoloadSettings::update_autoload() { diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp index 5fb274f38f..03c7b7f74c 100644 --- a/tools/editor/editor_file_system.cpp +++ b/tools/editor/editor_file_system.cpp @@ -670,7 +670,7 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess  	for (List<String>::Element*E=files.front();E;E=E->next(),idx++) { -		String ext = E->get().extension().to_lower(); +		String ext = E->get().get_extension().to_lower();  		if (!valid_extensions.has(ext))  			continue; //invalid @@ -789,7 +789,7 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const S  			} else { -				String ext = f.extension().to_lower(); +				String ext = f.get_extension().to_lower();  				if (!valid_extensions.has(ext))  					continue; //invalid diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index 0003e232c8..cc64ffb103 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -949,7 +949,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func  					return ERR_CANT_CREATE;  				}  				Vector<uint8_t> data = FileAccess::get_file_as_array(path); -				String dst_path = F->get().operator String().basename()+".atex"; +				String dst_path = F->get().operator String().get_basename()+".atex";  				err = p_func(p_udata,dst_path,data,counter++,files.size());  				saved.insert(dst_path);  				if (err) diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index b4a2da4833..57f9c46381 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -623,7 +623,7 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource,const String&  		file->set_current_path(p_resource->get_path());  		if (extensions.size()) { -			String ext=p_resource->get_path().extension().to_lower(); +			String ext=p_resource->get_path().get_extension().to_lower();  			if (extensions.find(ext)==NULL) {  				file->set_current_path(p_resource->get_path().replacen("."+ext,"."+extensions.front()->get()));  			} @@ -666,11 +666,11 @@ void EditorNode::_dialog_display_file_error(String p_file,Error p_error) {  			case ERR_FILE_CANT_WRITE: { -				accept->set_text(TTR("Can't open file for writing:")+" "+p_file.extension()); +				accept->set_text(TTR("Can't open file for writing:")+" "+p_file.get_extension());  			} break;  			case ERR_FILE_UNRECOGNIZED: { -				accept->set_text(TTR("Requested file format unknown:")+" "+p_file.extension()); +				accept->set_text(TTR("Requested file format unknown:")+" "+p_file.get_extension());  			} break;  			default: { @@ -2154,7 +2154,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {  			if (scene->get_filename()!="") {  				file->set_current_path(scene->get_filename());  				if (extensions.size()) { -					String ext=scene->get_filename().extension().to_lower(); +					String ext=scene->get_filename().get_extension().to_lower();  					if (extensions.find(ext)==NULL) {  						file->set_current_path(scene->get_filename().replacen("."+ext,"."+extensions.front()->get()));  					} @@ -2217,8 +2217,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {  			if (scene->get_filename()!="") {  				cpath = scene->get_filename(); -				String fn = cpath.substr(0,cpath.length() - cpath.extension().size()); -				String ext=cpath.extension(); +				String fn = cpath.substr(0,cpath.length() - cpath.get_extension().size()); +				String ext=cpath.get_extension();  				cpath=fn+".pot"; diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 50bd629b67..2d6618f449 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -846,8 +846,8 @@ void EditorSettings::list_text_editor_themes() {  		d->list_dir_begin();  		String file = d->get_next();  		while(file != String()) { -			if (file.extension() == "tet" && file.basename().to_lower() != "default") { -				themes += "," + file.basename(); +			if (file.get_extension() == "tet" && file.get_basename().to_lower() != "default") { +				themes += "," + file.get_basename();  			}  			file = d->get_next();  		} diff --git a/tools/editor/filesystem_dock.cpp b/tools/editor/filesystem_dock.cpp index 8a21b94eea..cd13d93cf5 100644 --- a/tools/editor/filesystem_dock.cpp +++ b/tools/editor/filesystem_dock.cpp @@ -1015,7 +1015,7 @@ void FileSystemDock::_file_option(int p_option) {  			if (move_dirs.empty() && move_files.size()==1) {  				rename_dialog->clear_filters(); -				rename_dialog->add_filter("*."+move_files[0].extension()); +				rename_dialog->add_filter("*."+move_files[0].get_extension());  				rename_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE);  				rename_dialog->set_current_path(move_files[0]);  				rename_dialog->popup_centered_ratio(); diff --git a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp index b4e0c4b82a..bad6261d4e 100644 --- a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp @@ -145,7 +145,7 @@ public:  				error_dialog->popup_centered(Size2(200, 100)*EDSCALE);  			} -			dst = dst.plus_file(bitmasks[i].get_file().basename() + ".pbm"); +			dst = dst.plus_file(bitmasks[i].get_file().get_basename() + ".pbm");  			plugin->import(dst, imd);  		} @@ -294,7 +294,7 @@ void EditorBitMaskImportPlugin::import_from_drop(const Vector<String>& p_drop, c  	ImageLoader::get_recognized_extensions(&valid_extensions);  	for(int i=0;i<p_drop.size();i++) { -		String extension=p_drop[i].extension().to_lower(); +		String extension=p_drop[i].get_extension().to_lower();  		for (List<String>::Element *E=valid_extensions.front();E;E=E->next()) { diff --git a/tools/editor/io_plugins/editor_export_scene.cpp b/tools/editor/io_plugins/editor_export_scene.cpp index c2e037cfd7..ea67128f3c 100644 --- a/tools/editor/io_plugins/editor_export_scene.cpp +++ b/tools/editor/io_plugins/editor_export_scene.cpp @@ -42,7 +42,7 @@ Vector<uint8_t> EditorSceneExportPlugin::custom_export(String& p_path,const Ref<  	} -	String extension = p_path.extension(); +	String extension = p_path.get_extension();  	//step 1 check if scene diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp index bf9c9835f6..3f4e454cac 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -468,7 +468,7 @@ class EditorFontImportDialog : public ConfirmationDialog {  		Ref<ImageTexture> tex = font->get_texture(0);  		if (tex.is_null())  			return; -		FileAccessRef f=FileAccess::open(p_font.basename()+".inc",FileAccess::WRITE); +		FileAccessRef f=FileAccess::open(p_font.get_basename()+".inc",FileAccess::WRITE);  		Vector<CharType> ck = font->get_char_keys();  		f->store_line("static const int _builtin_font_height="+itos(font->get_height())+";"); @@ -499,7 +499,7 @@ class EditorFontImportDialog : public ConfirmationDialog {  		f->store_line("static const int _builtin_font_img_width="+itos(img.get_width())+";");  		f->store_line("static const int _builtin_font_img_height="+itos(img.get_height())+";");		 -		String fname = p_font.basename()+".sv.png"; +		String fname = p_font.get_basename()+".sv.png";  		ResourceSaver::save(fname,tex);  		Vector<uint8_t> data=FileAccess::get_file_as_array(fname); @@ -533,14 +533,14 @@ class EditorFontImportDialog : public ConfirmationDialog {  		}  		if (dest->get_line_edit()->get_text().get_file()==".fnt") { -			dest->get_line_edit()->set_text(dest->get_line_edit()->get_text().get_base_dir() + "/" + source->get_line_edit()->get_text().get_file().basename() + ".fnt" ); +			dest->get_line_edit()->set_text(dest->get_line_edit()->get_text().get_base_dir() + "/" + source->get_line_edit()->get_text().get_file().get_basename() + ".fnt" );  		} -		if (dest->get_line_edit()->get_text().extension() == dest->get_line_edit()->get_text()) { +		if (dest->get_line_edit()->get_text().get_extension() == dest->get_line_edit()->get_text()) {  			dest->get_line_edit()->set_text(dest->get_line_edit()->get_text() + ".fnt");  		} -		if (dest->get_line_edit()->get_text().extension().to_lower() != "fnt") { +		if (dest->get_line_edit()->get_text().get_extension().to_lower() != "fnt") {  			error_dialog->set_text(TTR("Invalid file extension.\nPlease use .fnt."));  			error_dialog->popup_centered(Size2(200,100));  			return; @@ -913,7 +913,7 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe  	String src_path = EditorImportPlugin::expand_source_path(from->get_source_path(0)); -	if (src_path.extension().to_lower()=="fnt") { +	if (src_path.get_extension().to_lower()=="fnt") {  		if (ResourceLoader::load(src_path).is_valid()) {  			EditorNode::get_singleton()->show_warning(TTR("Path:")+" "+src_path+"\n"+TTR("This file is already a Godot font file, please supply a BMFont type file instead.")); @@ -1682,12 +1682,12 @@ Error EditorFontImportPlugin::import(const String& p_path, const Ref<ResourceImp  void EditorFontImportPlugin::import_from_drop(const Vector<String>& p_drop, const String &p_dest_path) {  	for(int i=0;i<p_drop.size();i++) { -		String ext = p_drop[i].extension().to_lower(); +		String ext = p_drop[i].get_extension().to_lower();  		String file = p_drop[i].get_file();  		if (ext=="ttf" || ext=="otf" || ext=="fnt") {  			import_dialog(); -			dialog->set_source_and_dest(p_drop[i],p_dest_path.plus_file(file.basename()+".fnt")); +			dialog->set_source_and_dest(p_drop[i],p_dest_path.plus_file(file.get_basename()+".fnt"));  			break;  		}  	} diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp index 846a551121..d17ca1d7f1 100644 --- a/tools/editor/io_plugins/editor_import_collada.cpp +++ b/tools/editor/io_plugins/editor_import_collada.cpp @@ -2438,7 +2438,7 @@ Ref<Animation> EditorSceneImporterCollada::import_animation(const String& p_path  	Ref<Animation> anim=state.animations[0];  	anim=state.animations[0];  	print_line("Anim Load OK"); -	String base = p_path.basename().to_lower(); +	String base = p_path.get_basename().to_lower();  	if (p_flags&IMPORT_ANIMATION_DETECT_LOOP) {  		if (base.begins_with("loop") || base.ends_with("loop") || base.begins_with("cycle") || base.ends_with("cycle")) { diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp index f33693c304..fa0c36be98 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -259,7 +259,7 @@ public:  			imd->add_source(EditorImportPlugin::validate_source_path(meshes[i])); -			String file_path = dst.plus_file(meshes[i].get_file().basename()+".msh"); +			String file_path = dst.plus_file(meshes[i].get_file().get_basename()+".msh");  			plugin->import(file_path,imd);  		} @@ -568,7 +568,7 @@ void EditorMeshImportPlugin::import_from_drop(const Vector<String>& p_drop, cons  	Vector<String> files;  	for(int i=0;i<p_drop.size();i++) { -		String ext = p_drop[i].extension().to_lower(); +		String ext = p_drop[i].get_extension().to_lower();  		String file = p_drop[i].get_file();  		if (ext=="obj") { diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp index da4e24dc84..d45f3839f8 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp @@ -296,7 +296,7 @@ public:  				error_dialog->popup_centered(Size2(200,100)*EDSCALE);  			} -			dst = dst.plus_file(samples[i].get_file().basename()+".smp"); +			dst = dst.plus_file(samples[i].get_file().get_basename()+".smp");  			plugin->import(dst,imd);  		} @@ -828,7 +828,7 @@ void EditorSampleImportPlugin::import_from_drop(const Vector<String>& p_drop, co  	Vector<String> files;  	for(int i=0;i<p_drop.size();i++) { -		String ext = p_drop[i].extension().to_lower(); +		String ext = p_drop[i].get_extension().to_lower();  		if (ext=="wav") { @@ -887,7 +887,7 @@ Vector<uint8_t> EditorSampleExportPlugin::custom_export(String& p_path,const Ref -	if (EditorImportExport::get_singleton()->sample_get_action()==EditorImportExport::SAMPLE_ACTION_NONE || p_path.extension().to_lower()!="wav") { +	if (EditorImportExport::get_singleton()->sample_get_action()==EditorImportExport::SAMPLE_ACTION_NONE || p_path.get_extension().to_lower()!="wav") {  		return Vector<uint8_t>();  	} @@ -911,7 +911,7 @@ Vector<uint8_t> EditorSampleExportPlugin::custom_export(String& p_path,const Ref  	ERR_FAIL_COND_V(err!=OK,Vector<uint8_t>()); -	p_path=p_path.basename()+".converted.smp"; +	p_path=p_path.get_basename()+".converted.smp";  	return FileAccess::get_file_as_array(savepath);  } diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index 8fd78f11f3..ae0559636b 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -659,7 +659,7 @@ void EditorSceneImportDialog::_choose_file(const String& p_path) {  	import_path->set_text(p_path);  	if (root_node_name->get_text().size()==0){ -		root_node_name->set_text(import_path->get_text().get_file().basename()); +		root_node_name->set_text(import_path->get_text().get_file().get_basename());  	}  } @@ -763,7 +763,7 @@ void EditorSceneImportDialog::_import(bool p_and_open) {  	// Scenes should always be imported as binary format since vertex data is large and would take  	// up a lot of space and time to load if imported as text format (GH-5778) -	String save_file = save_path->get_text().plus_file(import_path->get_text().get_file().basename()+".scn"); +	String save_file = save_path->get_text().plus_file(import_path->get_text().get_file().get_basename()+".scn");  	print_line("Saving to: "+save_file); @@ -794,7 +794,7 @@ void EditorSceneImportDialog::_import(bool p_and_open) {  		rim->set_option("root_type",root_type->get_text());  	}  	if (root_node_name->get_text().size()==0) { -		root_node_name->set_text(import_path->get_text().get_file().basename()); +		root_node_name->set_text(import_path->get_text().get_file().get_basename());  	}  	rim->set_option("root_name",root_node_name->get_text()); @@ -2124,7 +2124,7 @@ Error EditorSceneImportPlugin::import1(const Ref<ResourceImportMetadata>& p_from  	String src_path=EditorImportPlugin::expand_source_path(from->get_source_path(0));  	Ref<EditorSceneImporter> importer; -	String ext=src_path.extension().to_lower(); +	String ext=src_path.get_extension().to_lower();  	EditorProgress progress("import",TTR("Import Scene"),104); @@ -2821,7 +2821,7 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c  		{ -			target_path=target_path.basename()+".tex"; +			target_path=target_path.get_basename()+".tex";  			Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata ); @@ -2936,7 +2936,7 @@ void EditorSceneImportPlugin::import_from_drop(const Vector<String>& p_drop,cons  	//bool warn_compatible=false;  	for(int i=0;i<p_drop.size();i++) { -		String extension = p_drop[i].extension().to_lower(); +		String extension = p_drop[i].get_extension().to_lower();  		for(List<String>::Element *E=extensions.front();E;E=E->next()) { diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index 3bf2551778..564753ca7b 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -448,7 +448,7 @@ void EditorTextureImportDialog::_import() {  		for(int i=0;i<files.size();i++) {  			String dst_file = dst_path.plus_file(files[i].get_file()); -			dst_file=dst_file.basename()+".tex"; +			dst_file=dst_file.get_basename()+".tex";  			Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );  			//imd->set_editor();  			imd->add_source(EditorImportPlugin::validate_source_path(files[i])); @@ -1307,9 +1307,9 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc  				String spath = from->get_source_path(E->get()).get_file();  				if (p_external) { -					apath = p_path.get_base_dir().plus_file(spath.basename()+"."+from->get_source_path(E->get()).md5_text()+".atex"); +					apath = p_path.get_base_dir().plus_file(spath.get_basename()+"."+from->get_source_path(E->get()).md5_text()+".atex");  				} else { -					apath = p_path.get_base_dir().plus_file(spath.basename()+".atex"); +					apath = p_path.get_base_dir().plus_file(spath.get_basename()+".atex");  				}  				Ref<AtlasTexture> at; @@ -1597,7 +1597,7 @@ Vector<uint8_t> EditorTextureImportPlugin::custom_export(const String& p_path, c  			rimd->set_option("shrink",group_shrink);  			rimd->add_source(validated_path,FileAccess::get_md5(p_path)); -		} else if (EditorImportExport::get_singleton()->get_image_formats().has(p_path.extension().to_lower()) && EditorImportExport::get_singleton()->get_export_image_action()!=EditorImportExport::IMAGE_ACTION_NONE) { +		} else if (EditorImportExport::get_singleton()->get_image_formats().has(p_path.get_extension().to_lower()) && EditorImportExport::get_singleton()->get_export_image_action()!=EditorImportExport::IMAGE_ACTION_NONE) {  			//handled by general image export settings  			rimd = Ref<ResourceImportMetadata>( memnew( ResourceImportMetadata ) ); @@ -1743,7 +1743,7 @@ void EditorTextureImportPlugin::import_from_drop(const Vector<String>& p_drop,co  	ImageLoader::get_recognized_extensions(&valid_extensions);  	for(int i=0;i<p_drop.size();i++) { -		String extension=p_drop[i].extension().to_lower(); +		String extension=p_drop[i].get_extension().to_lower();  		for (List<String>::Element *E=valid_extensions.front();E;E=E->next()) { @@ -1851,21 +1851,21 @@ EditorTextureImportPlugin::EditorTextureImportPlugin(EditorNode *p_editor) {  		if (pl.is_valid()) {  			Vector<uint8_t> ce = pl->custom_export(p_path,p_platform);  			if (ce.size()) { -				p_path=p_path.basename()+".converted.tex"; +				p_path=p_path.get_basename()+".converted.tex";  				return ce;  			}  		}  	} else if (EditorImportExport::get_singleton()->get_export_image_action()!=EditorImportExport::IMAGE_ACTION_NONE){ -		String xt = p_path.extension().to_lower(); +		String xt = p_path.get_extension().to_lower();  		if (EditorImportExport::get_singleton()->get_image_formats().has(xt)) { //should check for more I guess?  			Ref<EditorImportPlugin> pl = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture");  			if (pl.is_valid()) {  				Vector<uint8_t> ce = pl->custom_export(p_path,p_platform);  				if (ce.size()) { -					p_path=p_path.basename()+".converted.tex"; +					p_path=p_path.get_basename()+".converted.tex";  					return ce;  				}  			} diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.cpp b/tools/editor/io_plugins/editor_translation_import_plugin.cpp index 73d9e989ac..90c8e35f6a 100644 --- a/tools/editor/io_plugins/editor_translation_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -255,7 +255,7 @@ public:  			imd->set_option("skip_first",ignore_first->is_pressed());  			imd->set_option("compress",compress->is_pressed()); -			String savefile = save_path->get_text().plus_file(import_path->get_text().get_file().basename()+"."+locale+".xl"); +			String savefile = save_path->get_text().plus_file(import_path->get_text().get_file().get_basename()+"."+locale+".xl");  			Error err = plugin->import(savefile,imd);  			if (err!=OK) {  				error_dialog->set_text(TTR("Couldn't import!")); @@ -400,7 +400,7 @@ void EditorTranslationImportPlugin::import_from_drop(const Vector<String>& p_dro  	for(int i=0;i<p_drop.size();i++) { -		String ext = p_drop[i].extension().to_lower(); +		String ext = p_drop[i].get_extension().to_lower();  		if (ext=="csv") { diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index 6646fea3db..b511bc30d0 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -421,7 +421,7 @@ void AnimationPlayerEditor::_animation_save_as(const Ref<Resource>& p_resource)  	if (p_resource->get_path() != "") {  		file->set_current_path(p_resource->get_path());  		if (extensions.size()) { -			String ext = p_resource->get_path().extension().to_lower(); +			String ext = p_resource->get_path().get_extension().to_lower();  			if (extensions.find(ext) == NULL) {  				file->set_current_path(p_resource->get_path().replacen("." + ext, "." + extensions.front()->get()));  			} diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index 0253f656a4..45f97383a3 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -3734,7 +3734,7 @@ bool CanvasItemEditorViewport::_cyclical_dependency_exists(const String& p_targe  }  void CanvasItemEditorViewport::_create_nodes(Node* parent, Node* child, String& path, const Point2& p_point) { -	child->set_name(path.get_file().basename()); +	child->set_name(path.get_file().get_basename());  	Ref<ImageTexture> texture=Ref<ImageTexture> ( ResourceCache::get(path)->cast_to<ImageTexture>() );  	Size2 texture_size = texture->get_size(); @@ -3875,7 +3875,7 @@ void CanvasItemEditorViewport::_perform_drop_data(){  	if (error_files.size()>0) {  		String files_str;  		for (int i=0;i<error_files.size();i++) { -			files_str += error_files[i].get_file().basename() + ","; +			files_str += error_files[i].get_file().get_basename() + ",";  		}  		files_str=files_str.substr(0,files_str.length()-1);  		accept->get_ok()->set_text(TTR("Ugh")); diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.cpp b/tools/editor/plugins/resource_preloader_editor_plugin.cpp index 92d9c070af..689cd6a353 100644 --- a/tools/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/tools/editor/plugins/resource_preloader_editor_plugin.cpp @@ -79,7 +79,7 @@ void ResourcePreloaderEditor::_files_load_request(const Vector<String>& p_paths)  		} -		String basename = path.get_file().basename(); +		String basename = path.get_file().get_basename();  		String name=basename;  		int counter=1;  		while(preloader->has_resource(name)) { @@ -347,7 +347,7 @@ void ResourcePreloaderEditor::drop_data_fw(const Point2& p_point,const Variant&  			if (r->get_name()!="") {  				basename=r->get_name();  			} else if (r->get_path().is_resource_file()) { -				basename = r->get_path().basename(); +				basename = r->get_path().get_basename();  			} else {  				basename="Resource";  			} diff --git a/tools/editor/plugins/sample_library_editor_plugin.cpp b/tools/editor/plugins/sample_library_editor_plugin.cpp index e470d0d2c2..28a44d99f1 100644 --- a/tools/editor/plugins/sample_library_editor_plugin.cpp +++ b/tools/editor/plugins/sample_library_editor_plugin.cpp @@ -81,7 +81,7 @@ void SampleLibraryEditor::_file_load_request(const PoolVector<String>& p_path) {  			dialog->popup_centered_minsize();  			return; ///beh should show an error i guess  		} -		String basename = path.get_file().basename(); +		String basename = path.get_file().get_basename();  		String name=basename;  		int counter=0;  		while(sample_library->has_sample(name)) { @@ -376,7 +376,7 @@ void SampleLibraryEditor::drop_data_fw(const Point2& p_point,const Variant& p_da  			if (sample->get_name()!="") {  				basename=sample->get_name();  			} else if (sample->get_path().is_resource_file()) { -				basename = sample->get_path().basename(); +				basename = sample->get_path().get_basename();  			} else {  				basename="Sample";  			} diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 7a1b2c518c..dd3a9c3d38 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -921,7 +921,7 @@ bool ProjectExportDialog::_update_group_treef(TreeItem *p_parent,EditorFileSyste  	for(int i=0;i<p_dir->get_file_count();i++) {  		String fname = p_dir->get_file(i); -		if (p_extensions.has(fname.to_lower().extension())) { +		if (p_extensions.has(fname.to_lower().get_extension())) {  			String path = p_dir->get_file_path(i);  			if (filter!=String() && path.find(filter)==-1) diff --git a/tools/editor/script_create_dialog.cpp b/tools/editor/script_create_dialog.cpp index d1095271fc..2a76224e33 100644 --- a/tools/editor/script_create_dialog.cpp +++ b/tools/editor/script_create_dialog.cpp @@ -38,7 +38,7 @@ void ScriptCreateDialog::config(const String& p_base_name,const String&p_base_pa  	class_name->set_text("");  	parent_name->set_text(p_base_name);  	if (p_base_path!="")  { -		initial_bp=p_base_path.basename(); +		initial_bp=p_base_path.get_basename();  		file_path->set_text(initial_bp+"."+ScriptServer::get_language( language_menu->get_selected() )->get_extension());  	} else {  		initial_bp=""; @@ -182,7 +182,7 @@ void ScriptCreateDialog::_lang_changed(int l) {  	String path=file_path->get_text();  	String extension="";  	if (path.find(".")>=0) { -		extension=path.extension(); +		extension=path.get_extension();  	}  	if (extension.length()==0) { @@ -199,7 +199,7 @@ void ScriptCreateDialog::_lang_changed(int l) {  		for(List<String>::Element *E=extensions.front();E;E=E->next()) {  			if (E->get().nocasecmp_to(extension)==0) { -				path=path.basename()+selected_ext; +				path=path.get_basename()+selected_ext;  				_path_changed(path);  				break;  			} @@ -288,7 +288,7 @@ void ScriptCreateDialog::_path_changed(const String& p_path) {  	create_new=!f->file_exists(p);  	memdelete(f); -	String extension=p.extension(); +	String extension=p.get_extension();  	List<String> extensions;  	// get all possible extensions for script  |