projects in the editor_settings.xml that are no longer found on disk will be removed

This commit is contained in:
firefly2442 2015-10-19 23:14:02 -05:00
parent 2b12a8109d
commit ad362fbc58

View File

@ -480,8 +480,9 @@ void ProjectManager::_load_recent_projects() {
bool favorite = (_name.begins_with("favorite_projects/"))?true:false; bool favorite = (_name.begins_with("favorite_projects/"))?true:false;
uint64_t last_modified = 0; uint64_t last_modified = 0;
if (FileAccess::exists(conf)) if (FileAccess::exists(conf)) {
last_modified = FileAccess::get_modified_time(conf); last_modified = FileAccess::get_modified_time(conf);
String fscache = path.plus_file(".fscache"); String fscache = path.plus_file(".fscache");
if (FileAccess::exists(fscache)) { if (FileAccess::exists(fscache)) {
uint64_t cache_modified = FileAccess::get_modified_time(fscache); uint64_t cache_modified = FileAccess::get_modified_time(fscache);
@ -494,6 +495,10 @@ void ProjectManager::_load_recent_projects() {
favorite_projects.push_back(item); favorite_projects.push_back(item);
else else
projects.push_back(item); 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(); projects.sort();
@ -601,6 +606,8 @@ void ProjectManager::_load_recent_projects() {
erase_btn->set_disabled(selected_list.size()<1); erase_btn->set_disabled(selected_list.size()<1);
open_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=="")); run_btn->set_disabled(selected_list.size()<1 || (selected_list.size()==1 && single_selected_main==""));
EditorSettings::get_singleton()->save();
} }
void ProjectManager::_open_project_confirm() { void ProjectManager::_open_project_confirm() {