diff options
author | firefly2442 <firefly2442@gmail.com> | 2015-10-19 23:14:02 -0500 |
---|---|---|
committer | firefly2442 <firefly2442@gmail.com> | 2015-10-19 23:14:02 -0500 |
commit | ad362fbc582fd8ff9239542971c60e670d0a689d (patch) | |
tree | 75205b9671ec3dc699a886b38f3faeb44f1fd43c /tools/editor | |
parent | 2b12a8109dda1f47f9b75a5de91d7d00c1f25869 (diff) |
projects in the editor_settings.xml that are no longer found on disk will be removed
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/project_manager.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index 9f47291433..458b7b1133 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -480,20 +480,25 @@ void ProjectManager::_load_recent_projects() { bool favorite = (_name.begins_with("favorite_projects/"))?true:false; uint64_t last_modified = 0; - if (FileAccess::exists(conf)) + if (FileAccess::exists(conf)) { last_modified = FileAccess::get_modified_time(conf); - String fscache = path.plus_file(".fscache"); - if (FileAccess::exists(fscache)) { - uint64_t cache_modified = FileAccess::get_modified_time(fscache); - if ( cache_modified > last_modified ) - last_modified = cache_modified; - } - ProjectItem item(project, path, conf, last_modified, favorite); - if (favorite) - favorite_projects.push_back(item); - else - projects.push_back(item); + String fscache = path.plus_file(".fscache"); + if (FileAccess::exists(fscache)) { + uint64_t cache_modified = FileAccess::get_modified_time(fscache); + if ( cache_modified > last_modified ) + last_modified = cache_modified; + } + + ProjectItem item(project, path, conf, last_modified, favorite); + if (favorite) + favorite_projects.push_back(item); + else + projects.push_back(item); + } else { + //project doesn't exist on disk but it's in the XML settings file + EditorSettings::get_singleton()->erase(_name); //remove it + } } projects.sort(); @@ -601,6 +606,8 @@ void ProjectManager::_load_recent_projects() { erase_btn->set_disabled(selected_list.size()<1); open_btn->set_disabled(selected_list.size()<1); run_btn->set_disabled(selected_list.size()<1 || (selected_list.size()==1 && single_selected_main=="")); + + EditorSettings::get_singleton()->save(); } void ProjectManager::_open_project_confirm() { |