Enlightenment CVS committal

Author  : englebass
Project : e_modules
Module  : penguins

Dir     : e_modules/penguins


Modified Files:
        e_mod_config.c e_mod_main.c 


Log Message:
make module relocateable, themes are in module dir.

===================================================================
RCS file: /cvs/e/e_modules/penguins/e_mod_config.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_mod_config.c      12 Nov 2007 07:58:34 -0000      1.4
+++ e_mod_config.c      12 Nov 2007 08:29:13 -0000      1.5
@@ -52,7 +52,7 @@
    cfdata->penguins_count = pop->conf->penguins_count;
    cfdata->zoom = pop->conf->zoom;
    cfdata->alpha = pop->conf->alpha;
-   cfdata->theme = strdup(pop->conf->theme);//TOFO FREE old cfdata->theme
+   cfdata->theme = strdup(pop->conf->theme);
 }
 
 static void *
@@ -75,6 +75,7 @@
 
    pop = cfd->data;
    pop->config_dialog = NULL;
+   E_FREE(cfdata->theme);
    free(cfdata);
    cfdata = NULL;
 }
@@ -82,7 +83,7 @@
 static Evas_Object *
 _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data 
*cfdata)
 {
-   Evas_Object *o, *of, *ob, *ol;
+   Evas_Object *o, *ob, *ol;
    Population *pop;
 
    pop = cfd->data;
@@ -116,8 +117,8 @@
    count = 0;
    while (l)
    {
-      char * theme;
-      char * name;
+      char *theme;
+      char *name;
       Evas_Object *oi;
       theme = l->data;
       name = edje_file_data_get(theme, "PopulationName");
@@ -162,7 +163,8 @@
    pop->conf->zoom = cfdata->zoom;
    pop->conf->alpha = cfdata->alpha;
    
-   pop->conf->theme = strdup(cfdata->theme);//TODO FREE old pop->conf->theme
+   if (pop->conf->theme) evas_stringshare_del(pop->conf->theme);
+   pop->conf->theme = evas_stringshare_add(cfdata->theme);
 
    e_config_save_queue();
    e_border_button_bindings_grab_all();
===================================================================
RCS file: /cvs/e/e_modules/penguins/e_mod_main.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- e_mod_main.c        12 Nov 2007 07:58:34 -0000      1.11
+++ e_mod_main.c        12 Nov 2007 08:29:13 -0000      1.12
@@ -101,7 +101,7 @@
 _population_init(E_Module *m)
 {
    Population *pop;
-   Evas_List *managers, *l, *l2, *l3;
+   Evas_List *managers, *l, *l2;
 
    printf("PENGUINS: Starting up...\n");
    
@@ -123,12 +123,16 @@
    pop->conf = e_config_domain_load("module.penguins", pop->conf_edd);
    if (!pop->conf)
      {
+       char buf[4096];
+
         pop->conf = E_NEW(Config, 1);
 
         pop->conf->zoom = 1;
         pop->conf->penguins_count = 3;
         pop->conf->alpha = 200;
-        pop->conf->theme = PACKAGE_DATA_DIR"/themes/default.edj";
+
+       snprintf(buf, sizeof(buf), "%s/themes/default.edj", 
e_module_dir_get(m));
+        pop->conf->theme = evas_stringshare_add(buf);
      }
 
    managers = e_manager_list();
@@ -169,12 +173,13 @@
    char *name;
    char buf[4096];
      
-   files = ecore_file_ls(PACKAGE_DATA_DIR"/themes");
+   snprintf(buf, sizeof(buf), "%s/themes", e_module_dir_get(m));
+   files = ecore_file_ls(buf);
    while ((filename = ecore_list_next(files)))
    {
          if (ecore_str_has_suffix(filename, ".edj"))
          {
-            snprintf(buf, sizeof(buf),"%s/%s", PACKAGE_DATA_DIR"/themes", 
filename);
+            snprintf(buf, sizeof(buf), "%s/themes/%s", e_module_dir_get(m), 
filename);
             name = edje_file_data_get(buf, "PopulationName");
             if (name)
             {
@@ -268,7 +273,7 @@
       pop->themes = evas_list_remove_list(pop->themes, pop->themes);
    }
 
-   //E_FREE(pop->conf->theme); //TODO Why can't free??
+   if (pop->conf->theme) evas_stringshare_del(pop->conf->theme);
    E_FREE(pop->conf);
    E_CONFIG_DD_FREE(pop->conf_edd);
    
@@ -292,7 +297,7 @@
    _population_load(pop);
 }
 static Action*
-_load_action(Population *pop, char *filename, char *name, int id)
+_load_action(Population *pop, const char *filename, char *name, int id)
 {
    Action *act;
    char *data;
@@ -318,7 +323,7 @@
    return act;
 }
 static Custom_Action*
-_load_custom_action(Population *pop, char *filename, char *name)
+_load_custom_action(Population *pop, const char *filename, char *name)
 {
    Custom_Action *c;
    char *data;
@@ -367,10 +372,6 @@
    pop->customs = NULL;
    pop->custom_num = 0;
    
-   if (!pop->conf->theme)
-      pop->conf->theme = PACKAGE_DATA_DIR "/default.edj";
-      
-
    name = edje_file_data_get(pop->conf->theme, "PopulationName");
    if (!name) 
       return;



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to