file_mgr: Do not replace current main file if it is the new main file.

Replace the current main file to a sub file if it is not the new main
file.
This commit is contained in:
Jaehyun Cho 2016-08-23 23:47:28 +09:00
parent b6d9930e0a
commit 202fecd511
1 changed files with 11 additions and 3 deletions

View File

@ -333,11 +333,19 @@ file_mgr_main_file_set(const char *path)
const char *prev_path = enventor_item_file_get(main_it); const char *prev_path = enventor_item_file_get(main_it);
if (prev_path) if (prev_path)
{ {
Enventor_Item *it2 = file_mgr_sub_file_add(prev_path, EINA_FALSE); //Replace the current main file if it is not the new main file.
file_mgr_file_del(main_it); if (strcmp(realpath, prev_path))
if (!fmd->focused_it) {
Enventor_Item *it2 = file_mgr_sub_file_add(prev_path,
EINA_FALSE);
if (fmd->focused_it == main_it)
fmd->focused_it = it2; fmd->focused_it = it2;
} }
else
replace_focus = EINA_TRUE;
file_mgr_file_del(main_it);
}
} }
main_it = enventor_object_main_item_set(base_enventor_get(), realpath); main_it = enventor_object_main_item_set(base_enventor_get(), realpath);