forked from enlightenment/enlightenment
'everything' module: tracker: set plugin items NULL until tracker replied
SVN revision: 41737
This commit is contained in:
parent
ba0d69df5c
commit
ce831c4ea7
|
@ -352,6 +352,9 @@ EAPI void
|
|||
evry_item_free(Evry_Item *it)
|
||||
{
|
||||
if (it->label) eina_stringshare_del(it->label);
|
||||
if (it->o_bg) evas_object_del(it->o_bg);
|
||||
if (it->o_icon) evas_object_del(it->o_icon);
|
||||
|
||||
E_FREE(it);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ struct _Inst
|
|||
int max_hits;
|
||||
const char *input;
|
||||
const char *matched;
|
||||
Eina_List *items;
|
||||
};
|
||||
|
||||
static E_DBus_Connection *conn = NULL;
|
||||
|
@ -126,6 +127,7 @@ _cleanup(Evry_Plugin *p)
|
|||
evry_item_free(it);
|
||||
}
|
||||
p->items = NULL;
|
||||
inst->items = NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -151,6 +153,8 @@ _dbus_cb_reply(void *data, DBusMessage *msg, DBusError *error)
|
|||
|
||||
if (inst->active) inst->active--;
|
||||
|
||||
p->items = inst->items;
|
||||
|
||||
if (dbus_error_is_set(error))
|
||||
{
|
||||
_cleanup(p);
|
||||
|
@ -249,6 +253,7 @@ _dbus_cb_reply(void *data, DBusMessage *msg, DBusError *error)
|
|||
if (p->items)
|
||||
p->items = eina_list_sort(p->items, eina_list_count(p->items), _cb_sort);
|
||||
|
||||
inst->items = p->items;
|
||||
evry_plugin_async_update(p, EVRY_ASYNC_UPDATE_ADD);
|
||||
}
|
||||
|
||||
|
@ -279,7 +284,13 @@ _fetch(Evry_Plugin *p, const char *input)
|
|||
eina_stringshare_del(inst->input);
|
||||
inst->input = NULL;
|
||||
|
||||
if (!conn) return 0;
|
||||
if (!conn)
|
||||
{
|
||||
_cleanup(p);
|
||||
return 0;
|
||||
}
|
||||
|
||||
p->items = NULL;
|
||||
|
||||
if (input && (strlen(input) > 2))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue