aboutsummaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorJuan Linietsky2017-01-14 00:51:09 -0300
committerJuan Linietsky2017-01-14 00:51:09 -0300
commitd9d77291bca8dd1e87aa4d9e40de96d99e5ef1f6 (patch)
treef5c92321612fdd5f8967c349898d3475b52bf930 /tools/editor
parentf3b6177ece8a06e52870ed422cbcc67276606e5a (diff)
downloadgodot-d9d77291bca8dd1e87aa4d9e40de96d99e5ef1f6.tar.gz
godot-d9d77291bca8dd1e87aa4d9e40de96d99e5ef1f6.tar.zst
godot-d9d77291bca8dd1e87aa4d9e40de96d99e5ef1f6.zip
rename String.extension() -> String.get_extension() / String.basename() -> String.get_basename()
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/editor_asset_installer.cpp2
-rw-r--r--tools/editor/editor_autoload_settings.cpp2
-rw-r--r--tools/editor/editor_file_system.cpp4
-rw-r--r--tools/editor/editor_import_export.cpp2
-rw-r--r--tools/editor/editor_node.cpp12
-rw-r--r--tools/editor/editor_settings.cpp4
-rw-r--r--tools/editor/filesystem_dock.cpp2
-rw-r--r--tools/editor/io_plugins/editor_bitmask_import_plugin.cpp4
-rw-r--r--tools/editor/io_plugins/editor_export_scene.cpp2
-rw-r--r--tools/editor/io_plugins/editor_font_import_plugin.cpp16
-rw-r--r--tools/editor/io_plugins/editor_import_collada.cpp2
-rw-r--r--tools/editor/io_plugins/editor_mesh_import_plugin.cpp4
-rw-r--r--tools/editor/io_plugins/editor_sample_import_plugin.cpp8
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.cpp12
-rw-r--r--tools/editor/io_plugins/editor_texture_import_plugin.cpp16
-rw-r--r--tools/editor/io_plugins/editor_translation_import_plugin.cpp4
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp4
-rw-r--r--tools/editor/plugins/resource_preloader_editor_plugin.cpp4
-rw-r--r--tools/editor/plugins/sample_library_editor_plugin.cpp4
-rw-r--r--tools/editor/project_export.cpp2
-rw-r--r--tools/editor/script_create_dialog.cpp8
22 files changed, 60 insertions, 60 deletions
diff --git a/tools/editor/editor_asset_installer.cpp b/tools/editor/editor_asset_installer.cpp
index 54099ddce..9992100ff 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 071a237ea..087bf1a3b 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 5fb274f38..03c7b7f74 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 0003e232c..cc64ffb10 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 b4a2da483..57f9c4638 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 50bd629b6..2d6618f44 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 8a21b94ee..cd13d93cf 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 b4e0c4b82..bad6261d4 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 c2e037cfd..ea67128f3 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 bf9c9835f..3f4e454ca 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 846a55112..d17ca1d7f 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 f33693c30..fa0c36be9 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 da4e24dc8..d45f3839f 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 8fd78f11f..ae0559636 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 3bf255177..564753ca7 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 73d9e989a..90c8e35f6 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 6646fea3d..b511bc30d 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 0253f656a..45f97383a 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 92d9c070a..689cd6a35 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 e470d0d2c..28a44d99f 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 7a1b2c518..dd3a9c3d3 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 d1095271f..2a76224e3 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