From 963747523e56d0d288aca5a311625f08a1924b4b Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Fri, 18 Nov 2011 23:54:49 +0100 Subject: [PATCH] Retain 'settings' group and highest slot for empty --- midori/midori-view.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/midori/midori-view.c b/midori/midori-view.c index 43bf7658..c4bae490 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -3672,7 +3672,6 @@ prepare_speed_dial_html (MidoriView* view, MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view)); GKeyFile* key_file; GString* markup = NULL; - guint slot = 1; guint slot_count = 1, i, grid_index = 3, slot_size; gchar* speed_dial_head; gchar* file_path; @@ -3744,6 +3743,7 @@ prepare_speed_dial_html (MidoriView* view, gchar* title = g_key_file_get_string (key_file, groups[i], "title", NULL); gchar* thumb_file = sokoke_build_thumbnail_path (uri); gchar* encoded; + guint slot = atoi (groups[i] + strlen ("Dial ")); if (g_access (thumb_file, F_OK) == 0) { @@ -3761,7 +3761,6 @@ prepare_speed_dial_html (MidoriView* view, } g_free (thumb_file); - slot = atoi (groups[i] + strlen ("Dial ")); g_string_append_printf (markup, "
" "" @@ -3772,10 +3771,9 @@ prepare_speed_dial_html (MidoriView* view, g_free (title); g_free (encoded); } - else + else if (strcmp (groups[i], "settings")) g_key_file_remove_group (key_file, groups[i], NULL); - slot++; g_free (uri); } g_strfreev (groups); @@ -3784,7 +3782,7 @@ prepare_speed_dial_html (MidoriView* view, "
" "" "
%s
\n", - slot, slot, _("Click to add a shortcut")); + slot_count + 1, slot_count + 1, _("Click to add a shortcut")); g_string_append_printf (markup, "
\n\n\n"); -- 2.39.5