Retain 'settings' group and highest slot for empty

This commit is contained in:
Christian Dywan 2011-11-18 23:54:49 +01:00
parent 1515b1e8d9
commit 963747523e

View file

@ -3672,7 +3672,6 @@ prepare_speed_dial_html (MidoriView* view,
MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view)); MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view));
GKeyFile* key_file; GKeyFile* key_file;
GString* markup = NULL; GString* markup = NULL;
guint slot = 1;
guint slot_count = 1, i, grid_index = 3, slot_size; guint slot_count = 1, i, grid_index = 3, slot_size;
gchar* speed_dial_head; gchar* speed_dial_head;
gchar* file_path; 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* title = g_key_file_get_string (key_file, groups[i], "title", NULL);
gchar* thumb_file = sokoke_build_thumbnail_path (uri); gchar* thumb_file = sokoke_build_thumbnail_path (uri);
gchar* encoded; gchar* encoded;
guint slot = atoi (groups[i] + strlen ("Dial "));
if (g_access (thumb_file, F_OK) == 0) if (g_access (thumb_file, F_OK) == 0)
{ {
@ -3761,7 +3761,6 @@ prepare_speed_dial_html (MidoriView* view,
} }
g_free (thumb_file); g_free (thumb_file);
slot = atoi (groups[i] + strlen ("Dial "));
g_string_append_printf (markup, g_string_append_printf (markup,
"<div class=\"shortcut\" id=\"s%d\"><div class=\"preview\">" "<div class=\"shortcut\" id=\"s%d\"><div class=\"preview\">"
"<a class=\"cross\" href=\"#\" onclick='clearShortcut(\"s%d\");'></a>" "<a class=\"cross\" href=\"#\" onclick='clearShortcut(\"s%d\");'></a>"
@ -3772,10 +3771,9 @@ prepare_speed_dial_html (MidoriView* view,
g_free (title); g_free (title);
g_free (encoded); g_free (encoded);
} }
else else if (strcmp (groups[i], "settings"))
g_key_file_remove_group (key_file, groups[i], NULL); g_key_file_remove_group (key_file, groups[i], NULL);
slot++;
g_free (uri); g_free (uri);
} }
g_strfreev (groups); g_strfreev (groups);
@ -3784,7 +3782,7 @@ prepare_speed_dial_html (MidoriView* view,
"<div class=\"shortcut\" id=\"s%d\"><div class=\"preview new\">" "<div class=\"shortcut\" id=\"s%d\"><div class=\"preview new\">"
"<a class=\"add\" href=\"#\" onclick='return getAction(\"s%d\");'></a>" "<a class=\"add\" href=\"#\" onclick='return getAction(\"s%d\");'></a>"
"</div><div class=\"title\">%s</div></div>\n", "</div><div class=\"title\">%s</div></div>\n",
slot, slot, _("Click to add a shortcut")); slot_count + 1, slot_count + 1, _("Click to add a shortcut"));
g_string_append_printf (markup, g_string_append_printf (markup,
"</div>\n</body>\n</html>\n"); "</div>\n</body>\n</html>\n");