aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/ephoto_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ephoto_main.c')
-rw-r--r--src/bin/ephoto_main.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c
index 9b5e6ed..6ac00c8 100644
--- a/src/bin/ephoto_main.c
+++ b/src/bin/ephoto_main.c
@@ -251,6 +251,10 @@ _win_free(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
ephoto_entries_free(ephoto);
if (!ephoto->gadget)
ephoto_config_save(ephoto);
+ else
+ ephoto_gadget_config_save(ephoto);
+ if (ephoto->gadget_config)
+ ephoto_config_free(ephoto);
free(ephoto->config);
free(ephoto);
}
@@ -369,7 +373,7 @@ ephoto_show_folders(Ephoto *ephoto, Eina_Bool toggle)
}
Evas_Object *
-ephoto_window_add(const char *path, int gadget)
+ephoto_window_add(const char *path, int gadget, int id)
{
Ephoto *ephoto = calloc(1, sizeof(Ephoto));
Evas_Object *ic, *but;
@@ -419,6 +423,18 @@ ephoto_window_add(const char *path, int gadget)
evas_object_del(ephoto->win);
return NULL;
}
+ if (ephoto->gadget)
+ {
+ const char *profile;
+
+ if (!ephoto_gadget_config_init(ephoto))
+ {
+ evas_object_del(ephoto->win);
+ return NULL;
+ }
+ profile = elm_config_profile_get();
+ ephoto->gci = ephoto_gadget_config_item_get(ephoto, id, profile);
+ }
if ((ephoto->config->thumb_gen_size != 128) &&
(ephoto->config->thumb_gen_size != 256) &&
@@ -685,6 +701,10 @@ ephoto_window_add(const char *path, int gadget)
ephoto->config->firstrun = 0;
}
}
+ else
+ {
+ ephoto_directory_set(ephoto, ephoto->gci->directory, NULL, EINA_FALSE, EINA_TRUE);
+ }
return ephoto->win;
}