gtk_widget_show (menuitem);
}
-static void
+/* static */ void
midori_browser_open_bookmark (MidoriBrowser* browser,
KatzeItem* item)
{
+ const gchar* uri = katze_item_get_uri (item);
+ if (!(uri && *uri))
+ return;
+
/* FIXME: Use the same binary that is running right now */
if (katze_item_get_meta_integer (item, "app") != -1)
- sokoke_spawn_program ("midori -a", katze_item_get_uri (item), FALSE);
+ sokoke_spawn_program ("midori -a", uri, FALSE);
else
{
- midori_browser_set_current_uri (browser, katze_item_get_uri (item));
+ midori_browser_set_current_uri (browser, uri);
gtk_widget_grab_focus (midori_browser_get_current_tab (browser));
}
}
gboolean new_bookmark,
gboolean is_folder);
+void
+midori_browser_open_bookmark (MidoriBrowser* browser,
+ KatzeItem* item);
+
struct _MidoriBookmarks
{
GtkVBox parent_instance;
GtkTreeModel* model;
GtkTreeIter iter;
KatzeItem* item;
- const gchar* uri;
model = gtk_tree_view_get_model (treeview);
if (gtk_tree_model_get_iter (model, &iter, path))
{
+ MidoriBrowser* browser;
+
gtk_tree_model_get (model, &iter, 0, &item, -1);
- uri = katze_item_get_uri (item);
- if (uri && *uri)
- {
- MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (bookmarks));
- midori_browser_set_current_uri (browser, uri);
- }
+
+ browser = midori_browser_get_for_widget (GTK_WIDGET (bookmarks));
+ midori_browser_open_bookmark (browser, item);
g_object_unref (item);
}