hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=1d6ef8c9ac7cd8d22107b1ae0c9cbc9a5846026b

commit 1d6ef8c9ac7cd8d22107b1ae0c9cbc9a5846026b
Author: Jaehyun Cho <jae_hyun....@samsung.com>
Date:   Thu Sep 11 15:43:26 2014 +0900

    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
---
 src/bin/globals.c     | 2 +-
 src/bin/main.c        | 2 +-
 src/bin/newfile.c     | 8 +++++---
 src/include/globals.h | 2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/bin/globals.c b/src/bin/globals.c
index 82f7444..0c37495 100644
--- a/src/bin/globals.c
+++ b/src/bin/globals.c
@@ -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];
diff --git a/src/bin/main.c b/src/bin/main.c
index 7dd3ed5..35f4c7d 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -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
diff --git a/src/bin/newfile.c b/src/bin/newfile.c
index abdb2db..a148a5d 100644
--- a/src/bin/newfile.c
+++ b/src/bin/newfile.c
@@ -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
diff --git a/src/include/globals.h b/src/include/globals.h
index a359b13..f91c5ce 100644
--- a/src/include/globals.h
+++ b/src/include/globals.h
@@ -1,2 +1,2 @@
-extern const char *DEFAULT_EDC_PATH;
+extern const char *DEFAULT_EDC_PATH_FORMAT;
 extern char EDJE_PATH[PATH_MAX];

-- 


Reply via email to