edje: enhance edje_calc circular dependency error message 16/56916/1
authorShinwoo Kim <cinoo.kim@samsung.com>
Wed, 13 Jan 2016 10:59:31 +0000 (19:59 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Wed, 13 Jan 2016 12:23:05 +0000 (21:23 +0900)
Change-Id: I130e6ab238168ebc7a95baaf29c0ecd1b869de4d

src/lib/edje/edje_calc.c

index 783f430..f524e12 100644 (file)
@@ -3546,7 +3546,8 @@ _edje_map_prop_set(Evas_Map *map, const Edje_Calc_Params *pf,
 #define Rel1Y 1
 #define Rel2X 2
 #define Rel2Y 3
-Eina_Bool circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Eina_List **clist)
+static Eina_Bool
+_circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Eina_List **clist)
 {
    Edje_Real_Part *rp = NULL;
 
@@ -3563,7 +3564,7 @@ Eina_Bool circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part
                {
                   if (!cep) cep = ep;
                   rp = ed->table_parts[cep->param1.description->rel1.id_x];
-                  if (circular_dependency_find(ed, ep, rp, clist))
+                  if (_circular_dependency_find(ed, ep, rp, clist))
                     {
                        *clist = eina_list_prepend(*clist, rp->part->name);
                        return EINA_TRUE;
@@ -3573,7 +3574,7 @@ Eina_Bool circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part
                {
                   if (!cep) cep = ep;
                   rp = ed->table_parts[cep->param1.description->rel2.id_x];
-                  if (circular_dependency_find(ed, ep, rp, clist))
+                  if (_circular_dependency_find(ed, ep, rp, clist))
                     {
                        *clist = eina_list_prepend(*clist, rp->part->name);
                        return EINA_TRUE;
@@ -3587,7 +3588,7 @@ Eina_Bool circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part
                {
                   if (!cep) cep = ep;
                   rp = ed->table_parts[cep->param2->description->rel1.id_x];
-                  if (circular_dependency_find(ed, ep, rp, clist))
+                  if (_circular_dependency_find(ed, ep, rp, clist))
                     {
                        *clist = eina_list_prepend(*clist, rp->part->name);
                        return EINA_TRUE;
@@ -3597,7 +3598,7 @@ Eina_Bool circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part
                {
                   if (!cep) cep = ep;
                   rp = ed->table_parts[cep->param2->description->rel2.id_x];
-                  if (circular_dependency_find(ed, ep, rp, clist))
+                  if (_circular_dependency_find(ed, ep, rp, clist))
                     {
                        *clist = eina_list_prepend(*clist, rp->part->name);
                        return EINA_TRUE;
@@ -3613,7 +3614,7 @@ Eina_Bool circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part
                {
                   if (!cep) cep = ep;
                   rp = ed->table_parts[cep->param1.description->rel1.id_y];
-                  if (circular_dependency_find(ed, ep, rp, clist))
+                  if (_circular_dependency_find(ed, ep, rp, clist))
                     {
                        *clist = eina_list_prepend(*clist, rp->part->name);
                        return EINA_TRUE;
@@ -3623,7 +3624,7 @@ Eina_Bool circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part
                {
                   if (!cep) cep = ep;
                   rp = ed->table_parts[cep->param1.description->rel2.id_y];
-                  if (circular_dependency_find(ed, ep, rp, clist))
+                  if (_circular_dependency_find(ed, ep, rp, clist))
                     {
                        *clist = eina_list_prepend(*clist, rp->part->name);
                        return EINA_TRUE;
@@ -3636,7 +3637,7 @@ Eina_Bool circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part
                {
                   if (!cep) cep = ep;
                   rp = ed->table_parts[cep->param2->description->rel1.id_y];
-                  if (circular_dependency_find(ed, ep, rp, clist))
+                  if (_circular_dependency_find(ed, ep, rp, clist))
                     {
                        *clist = eina_list_prepend(*clist, rp->part->name);
                        return EINA_TRUE;
@@ -3646,7 +3647,7 @@ Eina_Bool circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part
                {
                   if (!cep) cep = ep;
                   rp = ed->table_parts[cep->param2->description->rel2.id_y];
-                  if (circular_dependency_find(ed, ep, rp, clist))
+                  if (_circular_dependency_find(ed, ep, rp, clist))
                     {
                        *clist = eina_list_prepend(*clist, rp->part->name);
                        return EINA_TRUE;
@@ -3734,9 +3735,9 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
         Eina_List *l = NULL;
         char *part_name;
         char depends_path[PATH_MAX] = "";
-        circular_dependency_find(ed, ep, NULL, &clist);
+        _circular_dependency_find(ed, ep, NULL, &clist);
         strncat(depends_path, ep->part->name,
-                sizeof(ep->part->name) - strlen(ep->part->name) - 1);
+                sizeof(depends_path) - strlen(depends_path) - 1);
         EINA_LIST_FOREACH(clist, l, part_name)
           {
              strncat(depends_path, " -> ",
@@ -3744,7 +3745,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
              strncat(depends_path, part_name,
                      sizeof(depends_path) - strlen(depends_path) - 1);
           }
-        ERR("Circular dependency: %s", depends_path);
+        ERR("Circular dependency in the group '%s' : %s", ed->group, depends_path);
         eina_list_free(clist);
 #endif
         return;