discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=750aa4644a7bc21b9816852c384eaf052d79a903

commit 750aa4644a7bc21b9816852c384eaf052d79a903
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Tue Mar 22 12:23:51 2016 -0400

    rework systray theme applying code
    
    potentially the most overoptimized string handling code I've ever seen.
    
    CID 1039843
---
 src/modules/systray/e_mod_main.c | 58 ++++++----------------------------------
 1 file changed, 8 insertions(+), 50 deletions(-)

diff --git a/src/modules/systray/e_mod_main.c b/src/modules/systray/e_mod_main.c
index dfe230e..02e8bae 100644
--- a/src/modules/systray/e_mod_main.c
+++ b/src/modules/systray/e_mod_main.c
@@ -126,72 +126,30 @@ _systray_cb_mouse_down(void *data, Evas *evas 
EINA_UNUSED, Evas_Object *obj EINA
 static void
 _systray_theme(Evas_Object *o, const char *shelf_style, const char *gc_style)
 {
-   const char base_theme[] = "base/theme/modules/systray";
-   const char *path = _systray_theme_path();
-   char buf[128], *p;
-   size_t len, avail;
-
-   len = eina_strlcpy(buf, _group_gadget, sizeof(buf));
-   if (len >= sizeof(buf))
-     goto fallback;
-   p = buf + len;
-   *p = '/';
-   p++;
-   avail = sizeof(buf) - len - 2;
+   char buf[4096];
 
    if (shelf_style && gc_style)
      {
-        size_t r;
-        r = snprintf(p, avail, "%s/%s", shelf_style, gc_style);
-        if (r < avail && e_theme_edje_object_set(o, base_theme, buf))
+        snprintf(buf, sizeof(buf), "%s/%s/%s", _group_gadget, shelf_style, 
gc_style);
+        if (e_theme_edje_object_set(o, NULL, buf))
           return;
      }
 
    if (shelf_style)
      {
-        size_t r;
-        r = eina_strlcpy(p, shelf_style, avail);
-        if (r < avail && e_theme_edje_object_set(o, base_theme, buf))
+        snprintf(buf, sizeof(buf), "%s/%s", _group_gadget, shelf_style);
+        if (e_theme_edje_object_set(o, NULL, buf))
           return;
      }
 
    if (gc_style)
      {
-        size_t r;
-        r = eina_strlcpy(p, gc_style, avail);
-        if (r < avail && e_theme_edje_object_set(o, base_theme, buf))
+        snprintf(buf, sizeof(buf), "%s/%s", _group_gadget, gc_style);
+        if (e_theme_edje_object_set(o, NULL, buf))
           return;
      }
 
-   if (e_theme_edje_object_set(o, base_theme, _group_gadget))
-     return;
-
-   if (shelf_style && gc_style)
-     {
-        size_t r;
-        r = snprintf(p, avail, "%s/%s", shelf_style, gc_style);
-        if (r < avail && edje_object_file_set(o, path, buf))
-          return;
-     }
-
-   if (shelf_style)
-     {
-        size_t r;
-        r = eina_strlcpy(p, shelf_style, avail);
-        if (r < avail && edje_object_file_set(o, path, buf))
-          return;
-     }
-
-   if (gc_style)
-     {
-        size_t r;
-        r = eina_strlcpy(p, gc_style, avail);
-        if (r < avail && edje_object_file_set(o, path, buf))
-          return;
-     }
-
-fallback:
-   edje_object_file_set(o, path, _group_gadget);
+   e_theme_edje_object_set(o, NULL, _group_gadget);
 }
 
 static E_Gadcon_Client *

-- 


Reply via email to