g_string_append_printf (markup,
"<style>.cross { left: -14px }</style>");
- while (slot <= slot_count)
+ for (i = 0; groups[i]; i++)
{
- gchar* dial_entry = g_strdup_printf ("Dial %d", slot);
- gchar* uri = g_key_file_get_string (key_file, dial_entry, "uri", NULL);
-
- if (uri && *uri && *uri != '#')
+ gchar* uri = g_key_file_get_string (key_file, groups[i], "uri", NULL);
+ if (uri && strstr (uri, "://"))
{
- gchar* title = g_key_file_get_string (key_file, dial_entry, "title", NULL);
+ gchar* title = g_key_file_get_string (key_file, groups[i], "title", NULL);
gchar* thumb_file = sokoke_build_thumbnail_path (uri);
gchar* encoded;
{
encoded = g_strdup ("");
if (load_missing)
- midori_view_speed_dial_get_thumb (view, dial_entry, uri);
+ midori_view_speed_dial_get_thumb (view, groups[i], uri);
}
g_free (thumb_file);
+ slot = atoi (groups[i] + strlen ("Dial "));
g_string_append_printf (markup,
"<div class=\"shortcut\" id=\"s%d\"><div class=\"preview\">"
"<a class=\"cross\" href=\"#\" onclick='clearShortcut(\"s%d\");'></a>"
g_free (encoded);
}
else
- {
- g_string_append_printf (markup,
- "<div class=\"shortcut\" id=\"s%d\"><div class=\"preview new\">"
- "<a class=\"add\" href=\"#\" onclick='return getAction(\"s%d\");'></a>"
- "</div><div class=\"title\">%s</div></div>\n",
- slot, slot, _("Click to add a shortcut"));
- }
+ g_key_file_remove_group (key_file, groups[i], NULL);
slot++;
- g_free (dial_entry);
g_free (uri);
}
+ g_strfreev (groups);
+
+ g_string_append_printf (markup,
+ "<div class=\"shortcut\" id=\"s%d\"><div class=\"preview new\">"
+ "<a class=\"add\" href=\"#\" onclick='return getAction(\"s%d\");'></a>"
+ "</div><div class=\"title\">%s</div></div>\n",
+ slot, slot, _("Click to add a shortcut"));
g_string_append_printf (markup,
"</div>\n</body>\n</html>\n");