'everything' module:

valgrinding and cleanups


SVN revision: 41861
This commit is contained in:
Hannes Janetzek 2009-08-18 19:10:13 +00:00
parent eaed23e864
commit 1c93b96400
9 changed files with 36 additions and 17 deletions

View File

@ -176,6 +176,10 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
e_configure_registry_item_del("extensions/run_everything");
e_configure_registry_category_del("extensions");
if (evry_conf->plugins_conf) eina_list_free(evry_conf->plugins_conf);
E_FREE(evry_conf);
/* Clean EET */
E_CONFIG_DD_FREE(conf_item_edd);
E_CONFIG_DD_FREE(conf_edd);
@ -294,6 +298,16 @@ evry_plugin_free(Evry_Plugin *p)
if (p->trigger) eina_stringshare_del(p->trigger);
if (p->icon) eina_stringshare_del(p->icon);
if (p->config)
{
if (p->config->name)
eina_stringshare_del(p->config->name);
if (p->config->trigger)
eina_stringshare_del(p->config->trigger);
E_FREE(p->config);
}
E_FREE(p);
}

View File

@ -294,7 +294,8 @@ evry_item_new(Evry_Plugin *p, const char *label, void (*cb_free) (Evry_Item *ite
it->plugin = p;
if (label) it->label = eina_stringshare_add(label);
if (cb_free) it->cb_free = cb_free;
it->ref = 1;
/* item_cnt++; */
@ -1949,7 +1950,7 @@ _evry_plug_actions_free(void)
evry_plugin_unregister(p);
eina_stringshare_del(p->config->name);
E_FREE(p->config);
E_FREE(p);
evry_plugin_free(p);
}
static int
@ -2073,7 +2074,7 @@ _evry_plug_aggregator_free(Evry_Plugin *p)
{
if (p->config->name) eina_stringshare_del(p->config->name);
E_FREE(p->config);
E_FREE(p);
evry_plugin_free(p);
}
@ -2104,7 +2105,7 @@ _evry_plug_aggregator_fetch(Evry_Plugin *p, const char *input)
if (!it->fuzzy_match)
it->fuzzy_match = evry_fuzzy_match(it->label, input);
if (it->fuzzy_match)
if (it->fuzzy_match || selector == selectors[2])
{
evry_item_ref(it);
items = eina_list_append(items, it);

View File

@ -161,9 +161,9 @@ _item_add(Evry_Plugin *p, Efreet_Desktop *desktop, char *file, int match)
}
if (desktop)
it = evry_item_new(p, desktop->name, &_item_free);
it = evry_item_new(p, desktop->name, _item_free);
else
it = evry_item_new(p, file, &_item_free);
it = evry_item_new(p, file, _item_free);
app = E_NEW(Evry_App, 1);
app->desktop = desktop;
@ -341,7 +341,7 @@ _fetch(Evry_Plugin *p, const char *input)
if (found || p == p2)
{
it = evry_item_new(p, _("Run Command"), &_item_free);
it = evry_item_new(p, _("Run Command"), _item_free);
app = E_NEW(Evry_App, 1);
if (input)
app->file = eina_stringshare_add(input);
@ -352,7 +352,7 @@ _fetch(Evry_Plugin *p, const char *input)
p->items = eina_list_append(p->items, it);
snprintf(cmd, sizeof(cmd), "xterm -hold -e %s", input);
it = evry_item_new(p, _("Run in Terminal"), &_item_free);
it = evry_item_new(p, _("Run in Terminal"), _item_free);
app = E_NEW(Evry_App, 1);
if (input)
app->file = eina_stringshare_add(cmd);
@ -652,7 +652,7 @@ _init(void)
p1 = evry_plugin_new("Applications", type_subject, "", "APPLICATION", 0, NULL, NULL,
_begin, _cleanup, _fetch, NULL, NULL,
_icon_get, NULL, NULL);
p2 = evry_plugin_new("Open With...", type_action, "FILE", "", 0, NULL, NULL,
_begin, _cleanup, _fetch, _open_with_action, NULL,
_icon_get, NULL, NULL);
@ -662,10 +662,10 @@ _init(void)
act = evry_action_new("Launch", "APPLICATION", NULL, "everything-launch",
_exec_app_action, _exec_app_check_item, NULL);
act1 = evry_action_new("Open File...", "APPLICATION", "FILE", "document-open",
_exec_app_action, _exec_app_check_item, NULL);
act2 = evry_action_new("Edit Application Entry", "APPLICATION", NULL, "everything-launch",
_edit_app_action, _edit_app_check_item, NULL);

View File

@ -308,6 +308,7 @@ _cleanup(Evry_Plugin *plugin)
if (p->exe)
{
ecore_exe_quit(p->exe);
ecore_exe_free(p->exe);
p->exe = NULL;
}
if (p->lang)

View File

@ -17,7 +17,7 @@ _cleanup(Evry_Plugin *p)
static void
_item_free(Evry_Item *it)
{
/* if (it->data[0]) e_object_unref(E_OBJECT(it->data[0])); */
if (it->data[0]) e_object_unref(E_OBJECT(it->data[0]));
}
static void
@ -25,9 +25,9 @@ _item_add(Evry_Plugin *p, E_Border *bd, int match, int *prio)
{
Evry_Item *it;
it = evry_item_new(p, e_border_name_get(bd), &_item_free);
it = evry_item_new(p, e_border_name_get(bd), _item_free);
/* e_object_ref(E_OBJECT(bd)); */
e_object_ref(E_OBJECT(bd));
it->data[0] = bd;
it->fuzzy_match = match;
it->priority = *prio;

View File

@ -121,7 +121,7 @@ _item_add(Evry_Plugin *p, const char *label, void (*action_cb) (E_Border *bd), c
if (!match) return;
it = evry_item_new(p, label, &_item_free);
it = evry_item_new(p, label, _item_free);
it->data[0] = action_cb;
it->data[1] = (void *) eina_stringshare_add(icon);
it->fuzzy_match = match;

View File

@ -73,8 +73,11 @@ _cleanup(Evry_Plugin *p)
ecore_event_handler_del(error_handler);
ecore_event_handler_del(del_handler);
data_handler = NULL;
error_handler = NULL;
del_handler = NULL;
ecore_exe_quit(exe);
ecore_exe_free(exe);
exe = NULL;
}

View File

@ -2,7 +2,7 @@
static Evry_View *view = NULL;
static Evas_Object *o_thumb[5];
static Evas_Object *o_thumb[4];
static Evas_Object *o_main = NULL;
static Eina_List *items = NULL;
static const char *view_types;

View File

@ -277,7 +277,7 @@ _fetch(Evry_Plugin *p, const char *input)
inst->input = eina_stringshare_add(input);
search_text = malloc(sizeof(char) * strlen(input) + 1);
sprintf(search_text, "%s", input);
max_hits = 50;
max_hits = 100;
}
else if (!input && !p->begin && p->type == type_object)
{