globals: Change default file name to use pid as identifier
Summary: Change default file name to use pid as identifier Reviewers: Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D1394
This commit is contained in:
parent
0447a026cc
commit
1d6ef8c9ac
|
@ -1,5 +1,5 @@
|
|||
#include <Elementary.h>
|
||||
#include "common.h"
|
||||
|
||||
const char *DEFAULT_EDC_PATH = "/tmp/enventor.edc";
|
||||
const char *DEFAULT_EDC_PATH_FORMAT = "/tmp/enventor_%d.edc";
|
||||
char EDJE_PATH[PATH_MAX];
|
||||
|
|
|
@ -487,7 +487,7 @@ args_dispatch(int argc, char **argv, char *edc_path, char *img_path,
|
|||
}
|
||||
|
||||
defaults:
|
||||
if (default_edc) sprintf(edc_path, "%s", DEFAULT_EDC_PATH);
|
||||
if (default_edc) sprintf(edc_path, DEFAULT_EDC_PATH_FORMAT, getpid());
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -28,17 +28,19 @@ newfile_set(edit_data *ed)
|
|||
|
||||
Eina_Bool success = EINA_TRUE;
|
||||
char buf[PATH_MAX];
|
||||
char default_path[PATH_MAX];
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/templates/%s.edc",
|
||||
elm_app_data_dir_get(), elm_object_item_text_get(it));
|
||||
config_edc_path_set(DEFAULT_EDC_PATH);
|
||||
success = eina_file_copy(buf, config_edc_path_get(),
|
||||
sprintf(default_path, DEFAULT_EDC_PATH_FORMAT, getpid());
|
||||
success = eina_file_copy(buf, default_path,
|
||||
EINA_FILE_COPY_DATA, NULL, NULL);
|
||||
if (!success)
|
||||
{
|
||||
EINA_LOG_ERR("Cannot find file! \"%s\"", buf);
|
||||
return;
|
||||
}
|
||||
edit_edc_reload(ed, DEFAULT_EDC_PATH);
|
||||
edit_edc_reload(ed, default_path);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
extern const char *DEFAULT_EDC_PATH;
|
||||
extern const char *DEFAULT_EDC_PATH_FORMAT;
|
||||
extern char EDJE_PATH[PATH_MAX];
|
||||
|
|
Loading…
Reference in New Issue