in 65759.
Thank you.
------------------------------------
-Regards, Hermet-
 
-----Original Message-----
From: "Enlightenment SVN"<[email protected]> 
To: [email protected]
Cc: 
Sent: 11-12-01(목) 20:41:48
Subject: E SVN: hermet trunk/elementary/src/lib
Log:
elementary/naviframe - title_content_set refactored.
 
 1. Modified to support NULL content.
 2. Unnecessary parameter removed.
 3. Number of lines Optimization.
 
 Signed-Off-By: ShilpaOnkar Singh <[email protected]>
 Signed-Off-By: ChunEon Park <[email protected]>
 
 
Author: hermet
Date: 2011-12-01 03:41:47 -0800 (Thu, 01 Dec 2011)
New Revision: 65777
Trac: http://trac.enlightenment.org/e/changeset/65777
Modified:
 trunk/elementary/src/lib/elc_naviframe.c 
Modified: trunk/elementary/src/lib/elc_naviframe.c
===================================================================
--- trunk/elementary/src/lib/elc_naviframe.c 2011-12-01 11:00:55 UTC (rev 65776)
+++ trunk/elementary/src/lib/elc_naviframe.c 2011-12-01 11:41:47 UTC (rev 65777)
@@ -117,7 +117,6 @@
 Evas_Object *obj,
 void *event_info);
 static void _title_content_set(Elm_Naviframe_Item *it,
- Elm_Naviframe_Content_Item_Pair *pair,
 const char *part,
 Evas_Object *content);
 static void _title_prev_btn_set(Elm_Naviframe_Item *it,
@@ -321,7 +320,6 @@
 {
 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
 
- Elm_Naviframe_Content_Item_Pair *pair = NULL;
 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
 
 //specified parts
@@ -347,7 +345,7 @@
 }
 
 //common part
- _title_content_set(navi_it, pair, part, content);
+ _title_content_set(navi_it, part, content);
 }
 
 static Evas_Object *
@@ -555,31 +553,24 @@
 
 static void
 _title_content_set(Elm_Naviframe_Item *it,
- Elm_Naviframe_Content_Item_Pair *pair,
 const char *part,
 Evas_Object *content)
 {
 char buf[1024];
+ Elm_Naviframe_Content_Item_Pair *pair = NULL;
 
 EINA_INLIST_FOREACH(it->content_list, pair)
 if (!strcmp(part, pair->part)) break;
 
- if (!pair)
+ if ((pair) && (pair->content))
 {
- pair = ELM_NEW(Elm_Naviframe_Content_Item_Pair);
- if (!pair)
+ if (!content)
 {
- ERR("Failed to allocate new content part of the item! : naviframe=%p", 
WIDGET(it));
+ evas_object_del(pair->content);
+ pair->content = NULL;
 return;
 }
- pair->it = it;
- eina_stringshare_replace(&pair->part, part);
- it->content_list = eina_inlist_append(it->content_list,
- EINA_INLIST_GET(pair));
- }
-
- if (pair->content != content)
- {
+ if (pair->content == content) return;
 evas_object_event_callback_del(pair->content,
 EVAS_CALLBACK_DEL,
 _title_content_del);
@@ -587,30 +578,37 @@
 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
 _changed_size_hints);
 evas_object_del(pair->content);
- elm_widget_sub_object_add(WIDGET(it), content);
- evas_object_event_callback_add(content,
- EVAS_CALLBACK_DEL,
- _title_content_del,
- pair);
- evas_object_event_callback_add(content,
- EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints,
- WIDGET(it));
- }
- if (content)
- {
- edje_object_part_swallow(VIEW(it), part, content);
- snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
+ snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
 edje_object_signal_emit(VIEW(it), buf, "elm");
- pair->content = content;
- _sizing_eval(WIDGET(it));
 }
 else
 {
- snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
- edje_object_signal_emit(VIEW(it), buf, "elm");
- pair->content = NULL;
+ pair = ELM_NEW(Elm_Naviframe_Content_Item_Pair);
+ if (!pair)
+ {
+ ERR("Failed to allocate new content part of the item! : naviframe=%p", 
WIDGET(it));
+ return;
+ }
+ pair->it = it;
+ eina_stringshare_replace(&pair->part, part);
+ it->content_list = eina_inlist_append(it->content_list,
+ EINA_INLIST_GET(pair));
 }
+
+ elm_widget_sub_object_add(WIDGET(it), content);
+ evas_object_event_callback_add(content,
+ EVAS_CALLBACK_DEL,
+ _title_content_del,
+ pair);
+ evas_object_event_callback_add(content,
+ EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _changed_size_hints,
+ WIDGET(it));
+ edje_object_part_swallow(VIEW(it), part, content);
+ snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
+ edje_object_signal_emit(VIEW(it), buf, "elm");
+ pair->content = content;
+ _sizing_eval(WIDGET(it));
 }
 
 static void
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
enlightenment-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to