summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyuan Choi <ryuan.choi@gmail.com>2013-09-04 10:09:37 +0900
committerRyuan Choi <ryuan.choi@gmail.com>2013-09-04 10:19:48 +0900
commitc968d0c43e56278cc9473381259585d17cd9b27b (patch)
treec71edc865743213271b30cbedca0ea1a690d91f3
parenta372a1d438f8227852f285cd2e70ac665eba28f8 (diff)
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.
-rw-r--r--ChangeLog4
-rw-r--r--src/bin/config.c13
-rw-r--r--src/lib/elm_config.c26
3 files changed, 17 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 1695f01d0..ea24b35ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1585,3 +1585,7 @@
15852013-09-02 ChunEon Park (Hermet) 15852013-09-02 ChunEon Park (Hermet)
1586 1586
1587 * Widget: Introduce elm_object_item_object_get() API. 1587 * Widget: Introduce elm_object_item_object_get() API.
1588
15892013-09-04 Ryuan Choi (ryuan)
1590
1591 * 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 450ca1cf6..29b226c81 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -1270,15 +1270,6 @@ _config_display_update(Evas_Object *win)
1270 } 1270 }
1271} 1271}
1272 1272
1273static void
1274_profile_change_do(Evas_Object *win,
1275 const char *profile)
1276{
1277 elm_config_profile_set(profile);
1278 elm_config_all_flush();
1279 _config_display_update(win);
1280}
1281
1282static Eina_Bool 1273static Eina_Bool
1283_config_all_changed(void *data, 1274_config_all_changed(void *data,
1284 int ev_type EINA_UNUSED, 1275 int ev_type EINA_UNUSED,
@@ -1332,7 +1323,7 @@ _profile_use(void *data,
1332 1323
1333 elm_config_profile_set(selection); /* just here to update info for getters below */ 1324 elm_config_profile_set(selection); /* just here to update info for getters below */
1334 1325
1335 _profile_change_do(elm_object_top_widget_get(li), selection); 1326 _config_display_update(elm_object_top_widget_get(li));
1336 elm_config_all_flush(); 1327 elm_config_all_flush();
1337 elm_config_save(); /* make sure new profile has its data dir */ 1328 elm_config_save(); /* make sure new profile has its data dir */
1338} 1329}
@@ -1370,8 +1361,8 @@ _profile_reset(void *data,
1370 1361
1371 elm_config_reload(); 1362 elm_config_reload();
1372 1363
1373 _profile_change_do(elm_object_top_widget_get(li), curr);
1374 elm_config_all_flush(); 1364 elm_config_all_flush();
1365 _config_display_update(elm_object_top_widget_get(li));
1375 elm_config_save(); /* make sure new profile has its data dir */ 1366 elm_config_save(); /* make sure new profile has its data dir */
1376} 1367}
1377 1368
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index df7442a18..2fcb6f045 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -2585,28 +2585,24 @@ elm_config_indicator_service_get(int rotation)
2585void 2585void
2586_elm_config_profile_set(const char *profile) 2586_elm_config_profile_set(const char *profile)
2587{ 2587{
2588 Eina_Bool changed = EINA_FALSE;
2589
2590 if (_elm_profile) 2588 if (_elm_profile)
2591 { 2589 {
2592 if (strcmp(_elm_profile, profile)) 2590 if (!strcmp(_elm_profile, profile))
2593 changed = 1; 2591 return;
2592
2594 free(_elm_profile); 2593 free(_elm_profile);
2595 } 2594 }
2596 2595
2597 _elm_profile = strdup(profile); 2596 _elm_profile = strdup(profile);
2598 2597
2599 if (changed) 2598 _config_free(_elm_config);
2600 { 2599 _elm_config = NULL;
2601 _config_free(_elm_config); 2600 _config_load();
2602 _elm_config = NULL; 2601 _config_apply();
2603 _config_load(); 2602 _elm_config_font_overlay_apply();
2604 _config_apply(); 2603 _elm_rescale();
2605 _elm_config_font_overlay_apply(); 2604 _elm_recache();
2606 _elm_rescale(); 2605 _elm_clouseau_reload();
2607 _elm_recache();
2608 _elm_clouseau_reload();
2609 }
2610} 2606}
2611 2607
2612void 2608void