diff --git a/src/bin/config_data.c b/src/bin/config_data.c index c91ab58..89894ee 100644 --- a/src/bin/config_data.c +++ b/src/bin/config_data.c @@ -357,7 +357,8 @@ Eina_Bool config_init(const char *input_path, const char *output_path, const char *workspace_path, Eina_List *img_path, Eina_List *snd_path, - Eina_List *fnt_path, Eina_List *dat_path) + Eina_List *fnt_path, Eina_List *dat_path, + Eina_Bool default_workspace) { eddc_init(); @@ -370,7 +371,10 @@ config_init(const char *input_path, const char *output_path, if (workspace_path[0]) eina_stringshare_replace(&cd->workspace_path, workspace_path); - else + + //In case of default workspace + //we don't turn on file browser and file tab in default. + if (default_workspace) { cd->file_browser = EINA_FALSE; cd->file_tab = EINA_FALSE; diff --git a/src/bin/main.c b/src/bin/main.c index bfe0b19..23a9ef1 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -217,7 +217,7 @@ live_edit_set(void) base_live_edit_fixed_bar_set(fixed_bar); } -static void +static Eina_Bool args_dispatch(int argc, char **argv, char *edc_path, char *edj_path, char *workspace_path, Eina_List **img_path, Eina_List **snd_path, @@ -234,6 +234,7 @@ args_dispatch(int argc, char **argv, Eina_Bool quit = EINA_FALSE; Eina_Bool help = EINA_FALSE; + Eina_Bool default_workspace = EINA_TRUE; //No arguments. set defaults if (argc == 1) goto defaults; @@ -328,33 +329,32 @@ defaults: *img_path = eina_list_append(*img_path, eina_stringshare_add(s)); free(s); } - id = NULL; EINA_LIST_FREE(sd, s) { *snd_path = eina_list_append(*snd_path, eina_stringshare_add(s)); free(s); } - sd = NULL; EINA_LIST_FREE(fd, s) { *fnt_path = eina_list_append(*fnt_path, eina_stringshare_add(s)); free(s); } - fd = NULL; EINA_LIST_FREE(dd, s) { *dat_path = eina_list_append(*dat_path, eina_stringshare_add(s)); free(s); } - dd = NULL; if (wd) { sprintf(workspace_path, "%s", (char *)eina_list_data_get(wd)); - - EINA_LIST_FREE(wd, s) - free(s); - wd = NULL; + EINA_LIST_FREE(wd, s) free(s); + default_workspace = EINA_FALSE; } + else + { + sprintf(workspace_path, "."); + } + return default_workspace; } static Eina_Bool @@ -368,12 +368,13 @@ config_data_set(int argc, char **argv, Eina_Bool *default_edc, Eina_List *snd_path = NULL; Eina_List *fnt_path = NULL; Eina_List *dat_path = NULL; - - args_dispatch(argc, argv, edc_path, edj_path, workspace_path, + Eina_Bool default_workspace = + args_dispatch(argc, argv, edc_path, edj_path, workspace_path, &img_path, &snd_path, &fnt_path, &dat_path, default_edc, template, PATH_MAX); if (!config_init(edc_path, edj_path, workspace_path, - img_path, snd_path, fnt_path, dat_path)) + img_path, snd_path, fnt_path, dat_path, + default_workspace)) return EINA_FALSE; config_update_cb_set(config_update_cb, NULL); diff --git a/src/include/config_data.h b/src/include/config_data.h index d12daf2..6c95118 100644 --- a/src/include/config_data.h +++ b/src/include/config_data.h @@ -3,7 +3,7 @@ #define MAX_VIEW_SCALE 5.0 #define MIN_VIEW_SCALE 0.1 -Eina_Bool config_init(const char *input_path, const char *output_path, const char *workspace_path, Eina_List *img_path, Eina_List *snd_path, Eina_List *fnt_path, Eina_List *dat_path); +Eina_Bool config_init(const char *input_path, const char *output_path, const char *workspace_path, Eina_List *img_path, Eina_List *snd_path, Eina_List *fnt_path, Eina_List *dat_path, Eina_Bool default_workspace); void config_term(void); const char *config_input_path_get(void); const char *config_output_path_get(void);