e: Fix connman wizard page

It was unrefing connection inside of edbus_message callback.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 82258
This commit is contained in:
José Roberto de Souza 2013-01-05 03:55:16 +00:00 committed by Lucas De Marchi
parent 86a451f54c
commit ce4c973a9b
1 changed files with 15 additions and 16 deletions

View File

@ -63,17 +63,19 @@ _connman_fail(void *data)
} }
e_config_save_queue(); e_config_save_queue();
if (pending_connman)
{
edbus_pending_cancel(pending_connman);
pending_connman = NULL;
}
connman_timeout = NULL; connman_timeout = NULL;
_recommend_connman(pg); _recommend_connman(pg);
return EINA_FALSE; return EINA_FALSE;
} }
static Eina_Bool
_page_next_call(void *data EINA_UNUSED)
{
e_wizard_next();
return ECORE_CALLBACK_CANCEL;
}
static void static void
_check_connman_owner(void *data, const EDBus_Message *msg, _check_connman_owner(void *data, const EDBus_Message *msg,
EDBus_Pending *pending __UNUSED__) EDBus_Pending *pending __UNUSED__)
@ -97,7 +99,7 @@ _check_connman_owner(void *data, const EDBus_Message *msg,
goto fail; goto fail;
e_wizard_button_next_enable_set(1); e_wizard_button_next_enable_set(1);
e_wizard_next(); ecore_idler_add(_page_next_call, NULL);
fail: fail:
_connman_fail(data); _connman_fail(data);
@ -119,7 +121,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
EAPI int EAPI int
wizard_page_show(E_Wizard_Page *pg) wizard_page_show(E_Wizard_Page *pg)
{ {
int have_connman = 0; Eina_Bool have_connman = EINA_FALSE;
#ifdef HAVE_ECONNMAN #ifdef HAVE_ECONNMAN
edbus_init(); edbus_init();
@ -132,20 +134,16 @@ wizard_page_show(E_Wizard_Page *pg)
pending_connman = edbus_name_owner_get(conn, "net.connman", pending_connman = edbus_name_owner_get(conn, "net.connman",
_check_connman_owner, pg); _check_connman_owner, pg);
if (pending_connman) if (connman_timeout)
{ ecore_timer_del(connman_timeout);
if (connman_timeout) ecore_timer_del(connman_timeout); connman_timeout = ecore_timer_add(2.0, _connman_fail, pg);
connman_timeout = ecore_timer_add(2.0, _connman_fail, pg); have_connman = EINA_TRUE;
have_connman = 1; e_wizard_button_next_enable_set(0);
e_wizard_button_next_enable_set(0);
}
} }
if (!have_connman) if (!have_connman)
{ {
E_Config_Module *em; E_Config_Module *em;
Eina_List *l; Eina_List *l;
edbus_shutdown();
EINA_LIST_FOREACH(e_config->modules, l, em) EINA_LIST_FOREACH(e_config->modules, l, em)
{ {
if (!em->name) continue; if (!em->name) continue;
@ -180,6 +178,7 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
} }
if (conn) if (conn)
edbus_connection_unref(conn); edbus_connection_unref(conn);
conn = NULL;
#ifdef HAVE_ECONNMAN #ifdef HAVE_ECONNMAN
edbus_shutdown(); edbus_shutdown();