diff options
author | Shaun McCance <shaunm@gnome.org> | 2010-04-30 00:14:56 -0500 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2010-04-30 00:14:56 -0500 |
commit | a1f4ac745642f565c4805c5a142dcc397dbbe672 (patch) | |
tree | 74a122e24e73304e0c596538d1cc0cb595124392 /libyelp/yelp-settings.c | |
parent | 6afed561a8cfe02bcad3a22c46cf9b4c09abcba7 (diff) | |
download | yelp-a1f4ac745642f565c4805c5a142dcc397dbbe672.tar.gz |
[yelp-window] Sort the completion drop-down on icon and title
Just like we just did for bookmarks.
Diffstat (limited to 'libyelp/yelp-settings.c')
-rw-r--r-- | libyelp/yelp-settings.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libyelp/yelp-settings.c b/libyelp/yelp-settings.c index 7e3d4abd..087e6a64 100644 --- a/libyelp/yelp-settings.c +++ b/libyelp/yelp-settings.c @@ -950,8 +950,8 @@ yelp_settings_cmp_icons (const gchar *icon1, }; gint i; for (i = 0; icons[i] != NULL; i++) { - gboolean eq1 = g_str_equal (icon1, icons[i]); - gboolean eq2 = g_str_equal (icon2, icons[i]); + gboolean eq1 = icon1 ? g_str_equal (icon1, icons[i]) : FALSE; + gboolean eq2 = icon2 ? g_str_equal (icon2, icons[i]) : FALSE; if (eq1 && eq2) return 0; else if (eq1) @@ -959,7 +959,12 @@ yelp_settings_cmp_icons (const gchar *icon1, else if (eq2) return 1; } - return strcmp (icon1, icon2); + if (icon2 == NULL) + return -1; + else if (icon1 == NULL) + return 1; + else + return strcmp (icon1, icon2); } /******************************************************************************/ |