summaryrefslogtreecommitdiff
path: root/src/modules/connman
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-09-22 14:12:12 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2012-09-22 14:12:12 +0000
commit221774ddcc1be1365abd04ea030ecb9ef14c86aa (patch)
treefc16ecffced51fae722f97e5498cf4b6cab4f272 /src/modules/connman
parentd5e3385fd9a528df8784fd8a3c2f4c7b2b9c799b (diff)
downloadenlightenment-221774ddcc1be1365abd04ea030ecb9ef14c86aa.tar.gz
e/connman: Fix not updating main icon on new gadget
We need to call the function to udpate the current instance when adding a new gadget, otherwise it will not represent the current state. SVN revision: 77017
Diffstat (limited to 'src/modules/connman')
-rw-r--r--src/modules/connman/e_mod_main.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/modules/connman/e_mod_main.c b/src/modules/connman/e_mod_main.c
index 5647ad704c..779241a459 100644
--- a/src/modules/connman/e_mod_main.c
+++ b/src/modules/connman/e_mod_main.c
@@ -352,16 +352,9 @@ _econnman_mod_manager_update_inst(E_Connman_Module_Context *ctxt,
DBG("state=%d type=%d", state, type);
}
-void
-econnman_mod_manager_update(struct Connman_Manager *cm)
+static enum Connman_Service_Type _econnman_manager_service_type_get(
+ struct Connman_Manager *cm)
{
- enum Connman_Service_Type type;
- E_Connman_Module_Context *ctxt = connman_mod->data;
- E_Connman_Instance *inst;
- Eina_List *l;
-
- EINA_SAFETY_ON_NULL_RETURN(cm);
-
DBG("cm->services=%p", cm->services);
if ((cm->services) && ((cm->state == CONNMAN_STATE_ONLINE) ||
@@ -373,11 +366,22 @@ econnman_mod_manager_update(struct Connman_Manager *cm)
{
struct Connman_Service *cs = EINA_INLIST_CONTAINER_GET(cm->services,
struct Connman_Service);
- type = cs->type;
+ return cs->type;
}
- else
- type = CONNMAN_SERVICE_TYPE_NONE;
+ return CONNMAN_SERVICE_TYPE_NONE;
+}
+void
+econnman_mod_manager_update(struct Connman_Manager *cm)
+{
+ enum Connman_Service_Type type;
+ E_Connman_Module_Context *ctxt = connman_mod->data;
+ E_Connman_Instance *inst;
+ Eina_List *l;
+
+ EINA_SAFETY_ON_NULL_RETURN(cm);
+
+ type = _econnman_manager_service_type_get(cm);
EINA_LIST_FOREACH(ctxt->instances, l, inst)
_econnman_mod_manager_update_inst(ctxt, inst, cm->state, type);
}
@@ -483,6 +487,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
E_Connman_Instance *inst;
E_Connman_Module_Context *ctxt;
+ enum Connman_Service_Type type;
if (!connman_mod)
return NULL;
@@ -507,6 +512,12 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
_econnman_gadget_setup(inst);
+ if (ctxt->cm)
+ {
+ /* Update main icon with the current state */
+ type = _econnman_manager_service_type_get(ctxt->cm);
+ _econnman_mod_manager_update_inst(ctxt, inst, ctxt->cm->state, type);
+ }
ctxt->instances = eina_list_append(ctxt->instances, inst);
return inst->gcc;