app: Generate new edj file on load

Summary:
When the user load an existing edc file from the fileselector,
a new edj file is created in tmp directory then displayed.

@fix
This commit is contained in:
michelle legrand 2015-03-05 15:14:02 +01:00 committed by Nicolas Aguirre
parent c7d840f154
commit 30bf8bbe52
2 changed files with 6 additions and 12 deletions

View File

@ -46,18 +46,7 @@ config_edj_path_update(config_data *cd)
char buf[PATH_MAX];
Eina_Tmpstr *tmp_path;
char *ext = strstr(cd->edc_path, ".edc");
const char *file = ecore_file_file_get(cd->edc_path);
if (ext && file)
{
char filename[PATH_MAX];
snprintf(filename, (ext - file) + 1, "%s", file);
snprintf(buf, sizeof(buf), "%s.edj", filename);
}
else
snprintf(buf, sizeof(buf), "%s.edj", file);
if (!eina_file_mkstemp(buf, &tmp_path))
if (!eina_file_mkstemp(DEFAULT_EDC_FORMAT, &tmp_path))
{
EINA_LOG_ERR("Failed to generate tmp folder!");
return;

View File

@ -503,6 +503,11 @@ fileselector_load_done_cb(void *data, Evas_Object *obj, void *event_info)
return;
}
config_edc_path_set(selected);
Eina_List *list = eina_list_append(NULL, config_edj_path_get());
enventor_object_path_set(md->enventor, ENVENTOR_OUT_EDJ, list);
eina_list_free(list);
enventor_object_file_set(md->enventor, selected);
base_title_set(selected);
fileselector_close(md);