aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-22 15:16:56 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-22 15:20:38 -0500
commitaa9ece4722e98d4d664443fd822ff8a4a8c1f49b (patch)
treeb5ea2a213b7af0b08844fd65f935bd656b4480ce
parentadd notification util function for more easily sending notifications (diff)
downloadenlightenment-aa9ece4722e98d4d664443fd822ff8a4a8c1f49b.tar.gz
require [Name] entries for sandbox gadget .desktop files
-rw-r--r--src/bin/e_gadget_runner.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/bin/e_gadget_runner.c b/src/bin/e_gadget_runner.c
index d88fb5861..528d920be 100644
--- a/src/bin/e_gadget_runner.c
+++ b/src/bin/e_gadget_runner.c
@@ -103,13 +103,8 @@ static char *
sandbox_name(const char *filename)
{
Efreet_Desktop *ed = eina_hash_find(sandbox_gadgets, filename);
- const char *name = ed->name ?: ed->generic_name;
- char buf[1024];
- if (name) return strdup(name);
- strncpy(buf, ed->orig_path, sizeof(buf) - 1);
- buf[0] = toupper(buf[0]);
- return strdup(buf);
+ return strdup(ed->name);
}
static void
@@ -973,6 +968,17 @@ gadget_dir_add(const char *filename)
snprintf(buf, sizeof(buf), "%s/%s.desktop", filename, file);
ed = efreet_desktop_new(buf);
EINA_SAFETY_ON_NULL_RETURN(ed);
+ if (!ed->name)
+ {
+ char str[4096];
+ snprintf(str, sizeof(str), _("A gadget .desktop file was found,</ps>"
+ "but no [Name] entry was specified!</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);