ryuan pushed a commit to branch master.

commit c968d0c43e56278cc9473381259585d17cd9b27b
Author: Ryuan Choi <[email protected]>
Date:   Wed Sep 4 10:09:37 2013 +0900

    elm_config : profile may be broken when clicked reset button in profiles tab
    
    elm_config_profile_set should not free _elm_config_profile
    when _elm_config_profile is passed as parameter such as 
elm_config_profile_set(elm_config_profile_get());
    
    In addition, removed this dumb calls from elementary_config.
---
 ChangeLog            |  4 ++++
 src/bin/config.c     | 13 ++-----------
 src/lib/elm_config.c | 26 +++++++++++---------------
 3 files changed, 17 insertions(+), 26 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1695f01..ea24b35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1585,3 +1585,7 @@
 2013-09-02  ChunEon Park (Hermet)
 
         * Widget: Introduce elm_object_item_object_get() API.
+
+2013-09-04  Ryuan Choi (ryuan)
+
+        * elm_config : profile may be broken when clicked reset button in 
profiles tab
diff --git a/src/bin/config.c b/src/bin/config.c
index 450ca1c..29b226c 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -1270,15 +1270,6 @@ _config_display_update(Evas_Object *win)
      }
 }
 
-static void
-_profile_change_do(Evas_Object *win,
-                   const char  *profile)
-{
-   elm_config_profile_set(profile);
-   elm_config_all_flush();
-   _config_display_update(win);
-}
-
 static Eina_Bool
 _config_all_changed(void *data,
                     int ev_type EINA_UNUSED,
@@ -1332,7 +1323,7 @@ _profile_use(void            *data,
 
    elm_config_profile_set(selection); /* just here to update info for getters 
below */
 
-   _profile_change_do(elm_object_top_widget_get(li), selection);
+   _config_display_update(elm_object_top_widget_get(li));
    elm_config_all_flush();
    elm_config_save(); /* make sure new profile has its data dir */
 }
@@ -1370,8 +1361,8 @@ _profile_reset(void            *data,
 
    elm_config_reload();
 
-   _profile_change_do(elm_object_top_widget_get(li), curr);
    elm_config_all_flush();
+   _config_display_update(elm_object_top_widget_get(li));
    elm_config_save(); /* make sure new profile has its data dir */
 }
 
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index df7442a..2fcb6f0 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -2585,28 +2585,24 @@ elm_config_indicator_service_get(int rotation)
 void
 _elm_config_profile_set(const char *profile)
 {
-   Eina_Bool changed = EINA_FALSE;
-
    if (_elm_profile)
      {
-        if (strcmp(_elm_profile, profile))
-          changed = 1;
+        if (!strcmp(_elm_profile, profile))
+          return;
+
         free(_elm_profile);
      }
 
    _elm_profile = strdup(profile);
 
-   if (changed)
-     {
-        _config_free(_elm_config);
-        _elm_config = NULL;
-        _config_load();
-        _config_apply();
-        _elm_config_font_overlay_apply();
-        _elm_rescale();
-        _elm_recache();
-        _elm_clouseau_reload();
-     }
+   _config_free(_elm_config);
+   _elm_config = NULL;
+   _config_load();
+   _config_apply();
+   _elm_config_font_overlay_apply();
+   _elm_rescale();
+   _elm_recache();
+   _elm_clouseau_reload();
 }
 
 void

-- 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk

Reply via email to