Index: src/settings.c =================================================================== --- src/settings.c (revision 10) +++ src/settings.c (revision 11) @@ -2360,9 +2360,12 @@ GCONF_KEY_ROTATE_DIR, NULL); gint i = -1; if(rotate_dir_str) + { for(i = ROTATE_DIR_ENUM_COUNT - 1; i >= 0; i--) if(!strcmp(rotate_dir_str, ROTATE_DIR_ENUM_TEXT[i])) break; + g_free(rotate_dir_str); + } if(i == -1) i = ROTATE_DIR_UP; _rotate_dir = i; @@ -2424,9 +2427,12 @@ GCONF_KEY_UNITS, NULL); gint i = 0; if(units_str) + { for(i = UNITS_ENUM_COUNT - 1; i > 0; i--) if(!strcmp(units_str, UNITS_ENUM_TEXT[i])) break; + g_free(units_str); + } _units = i; } @@ -2439,9 +2445,12 @@ gchar *str = gconf_client_get_string(gconf_client, CUSTOM_KEY_GCONF[i], NULL); if(str) + { for(j = CUSTOM_ACTION_ENUM_COUNT - 1; j > 0; j--) if(!strcmp(str, CUSTOM_ACTION_ENUM_TEXT[j])) break; + g_free(str); + } _action[i] = j; } } @@ -2452,9 +2461,12 @@ GCONF_KEY_DEG_FORMAT, NULL); gint i = 0; if(degformat_key_str) + { for(i = DEG_FORMAT_ENUM_COUNT - 1; i > 0; i--) if(!strcmp(degformat_key_str, DEG_FORMAT_ENUM_TEXT[i].name)) break; + g_free(degformat_key_str); + } _degformat = i; } @@ -2474,9 +2486,12 @@ GCONF_KEY_SPEED_LOCATION, NULL); gint i = 0; if(speed_location_str) + { for(i = SPEED_LOCATION_ENUM_COUNT - 1; i > 0; i--) if(!strcmp(speed_location_str, SPEED_LOCATION_ENUM_TEXT[i])) break; + g_free(speed_location_str); + } _speed_location = i; } @@ -2486,9 +2501,12 @@ GCONF_KEY_UNBLANK_SIZE, NULL); gint i = -1; if(unblank_option_str) + { for(i = UNBLANK_ENUM_COUNT - 1; i >= 0; i--) if(!strcmp(unblank_option_str, UNBLANK_ENUM_TEXT[i])) break; + g_free(unblank_option_str); + } if(i == -1) i = UNBLANK_FULLSCREEN; _unblank_option = i; @@ -2504,9 +2522,12 @@ GCONF_KEY_INFO_FONT_SIZE, NULL); gint i = -1; if(info_font_size_str) + { for(i = INFO_FONT_ENUM_COUNT - 1; i >= 0; i--) if(!strcmp(info_font_size_str, INFO_FONT_ENUM_TEXT[i])) break; + g_free(info_font_size_str); + } if(i == -1) i = INFO_FONT_MEDIUM; _info_font_size = i; @@ -2825,6 +2846,8 @@ COLORABLE_GCONF[i], NULL); if(!str || !gdk_color_parse(str, &_color[i])) _color[i] = COLORABLE_DEFAULT[i]; + g_free(str); + str = NULL; } }