aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-22 15:42:05 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-22 15:59:09 -0500
commit69c570104a6ee585d1d689954e541ac01e34df90 (patch)
tree1dddccf2a49554996e81f1f40405656f8c78d0c9
parentadd menu item for reporting bugs (diff)
downloadenlightenment-69c570104a6ee585d1d689954e541ac01e34df90.tar.gz
require X-Gadget-Version field for sandbox gadget .desktops
-rw-r--r--src/bin/e_gadget_runner.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/bin/e_gadget_runner.c b/src/bin/e_gadget_runner.c
index 1ea675a1a..aaaef650e 100644
--- a/src/bin/e_gadget_runner.c
+++ b/src/bin/e_gadget_runner.c
@@ -103,12 +103,9 @@ static char *
sandbox_name(const char *filename)
{
Efreet_Desktop *ed = eina_hash_find(sandbox_gadgets, filename);
- char *version, buf[1024];
+ char buf[1024];
- if (!ed->x) return strdup(ed->name);
- version = eina_hash_find(ed->x, "X-Gadget-Version");
- if (!version) return strdup(ed->name);
- snprintf(buf, sizeof(buf), "%s (v%s)", ed->name, version);
+ snprintf(buf, sizeof(buf), "%s (v%s)", ed->name, (char*)eina_hash_find(ed->x, "X-Gadget-Version"));
return strdup(buf);
}
@@ -995,6 +992,17 @@ gadget_dir_add(const char *filename)
efreet_desktop_free(ed);
return;
}
+ if ((!ed->x) || (!eina_hash_find(ed->x, "X-Gadget-Version")))
+ {
+ char str[4096];
+ snprintf(str, sizeof(str), _("A gadget .desktop file was found,</ps>"
+ "but [X-Gadget-Version] is missing!</ps>"
+ "%s"), buf);
+ /* FIXME: maybe don't use notification here? T6630 */
+ e_notification_util_send(_("Gadget Error"), str);
+ efreet_desktop_free(ed);
+ return;
+ }
eina_hash_add(sandbox_gadgets, filename, ed);
e_gadget_external_type_add("runner_sandbox", filename, sandbox_create, NULL);
e_gadget_external_type_name_cb_set("runner_sandbox", filename, sandbox_name);