return pixbuf;
}
+/**
+ * katze_tree_view_get_selected_iter:
+ * @treeview: a #GtkTreeView
+ * @model: a pointer to store the model, or %NULL
+ * @iter: a pointer to store the iter, or %NULL
+ *
+ * Determines whether there is a selection in @treeview
+ * and sets the @iter to the current selection.
+ *
+ * If there is a selection and @model is not %NULL, it is
+ * set to the model, mainly for convenience.
+ *
+ * Either @model or @iter or both can be %NULL in which case
+ * no value will be assigned in any case.
+ *
+ * Return value: %TRUE if there is a selection
+ *
+ * Since: 0.1.3
+ **/
+gboolean
+katze_tree_view_get_selected_iter (GtkTreeView* treeview,
+ GtkTreeModel** model,
+ GtkTreeIter* iter)
+{
+ GtkTreeSelection* selection;
+
+ g_return_val_if_fail (GTK_IS_TREE_VIEW (treeview), FALSE);
+
+ if ((selection = gtk_tree_view_get_selection (treeview)))
+ if (gtk_tree_selection_get_selected (selection, model, iter))
+ return TRUE;
+ return FALSE;
+}
+
/**
* katze_object_has_property:
* @object: a #GObject
KatzeItem* item;
gboolean is_separator;
- if (sokoke_tree_view_get_selected_iter (tree_view, &model, &iter))
+ if (katze_tree_view_get_selected_iter (tree_view, &model, &iter))
{
gtk_tree_model_get (model, &iter, 0, &item, -1);
GtkAction* location_action;
treeview = GTK_TREE_VIEW (browser->panel_history);
- if (sokoke_tree_view_get_selected_iter (treeview, &model, &iter))
+ if (katze_tree_view_get_selected_iter (treeview, &model, &iter))
{
location_action = _action_by_name (browser, "Location");
gtk_tree_model_get (model, &iter, 0, &item, -1);
if (event->button != 2 && event->button != 3)
return FALSE;
- if (sokoke_tree_view_get_selected_iter (GTK_TREE_VIEW (widget), &model, &iter))
+ if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (widget), &model, &iter))
{
gtk_tree_model_get (model, &iter, 0, &item, -1);
uri = katze_item_get_uri (item);
GtkTreeIter iter;
KatzeItem* item;
- if (sokoke_tree_view_get_selected_iter (GTK_TREE_VIEW (widget), &model, &iter))
+ if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (widget), &model, &iter))
{
gtk_tree_model_get (model, &iter, 0, &item, -1);
midori_browser_bookmark_popup (widget, NULL, item, FALSE, browser);
KatzeItem* item;
gboolean is_page;
- if (sokoke_tree_view_get_selected_iter (tree_view, &model, &iter))
+ if (katze_tree_view_get_selected_iter (tree_view, &model, &iter))
{
gtk_tree_model_get (model, &iter, 0, &item, -1);
if (event->button != 2 && event->button != 3)
return FALSE;
- if (sokoke_tree_view_get_selected_iter (GTK_TREE_VIEW (widget),
+ if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (widget),
&model, &iter))
{
gtk_tree_model_get (model, &iter, 0, &item, -1);
return FALSE;
treeview = GTK_TREE_VIEW (widget);
- if (sokoke_tree_view_get_selected_iter (treeview, &model, &iter))
+ if (katze_tree_view_get_selected_iter (treeview, &model, &iter))
{
location_action = _action_by_name (browser, "Location");
gtk_tree_model_get (model, &iter, 0, &item, -1);
GtkTreeIter iter;
KatzeItem* item;
- if (sokoke_tree_view_get_selected_iter (GTK_TREE_VIEW (widget),
+ if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (widget),
&model, &iter))
{
gtk_tree_model_get (model, &iter, 0, &item, -1);
KatzeItem* item;
tree_view = GTK_TREE_VIEW (browser->panel_history);
- if (sokoke_tree_view_get_selected_iter (tree_view, &model, &iter))
+ if (katze_tree_view_get_selected_iter (tree_view, &model, &iter))
{
gtk_tree_model_get (model, &iter, 0, &item, -1);
if (!KATZE_IS_ARRAY (item))
KatzeItem* item;
tree_view = GTK_TREE_VIEW (browser->panel_bookmarks);
- if (sokoke_tree_view_get_selected_iter (tree_view, &model, &iter))
+ if (katze_tree_view_get_selected_iter (tree_view, &model, &iter))
{
gtk_tree_model_get (model, &iter, 0, &item, -1);
if (KATZE_IS_ARRAY (item) || katze_item_get_uri (item))
KatzeArray* parent;
tree_view = GTK_TREE_VIEW (browser->panel_bookmarks);
- if (sokoke_tree_view_get_selected_iter (tree_view, &model, &iter))
+ if (katze_tree_view_get_selected_iter (tree_view, &model, &iter))
{
gtk_tree_model_get (model, &iter, 0, &item, -1);
parent = katze_item_get_parent (item);
return katze_image_menu_item_new_ellipsized (label);
}
-/**
- * sokoke_tree_view_get_selected_iter:
- * @tree_view: a #GtkTreeView
- * @model: a pointer to store the model, or %NULL
- * @iter: a pointer to store the iter, or %NULL
- *
- * Determines whether there is a selection in the tree view
- * and sets the @iter to the current selection.
- *
- * If there is a selection and @model is not %NULL, it is
- * set to the model, mainly for convenience.
- *
- * Either @model or @iter or both can be %NULL in which case
- * no value will be assigned in any case.
- *
- * Return value: %TRUE if there is a selection
- **/
-gboolean
-sokoke_tree_view_get_selected_iter (GtkTreeView* tree_view,
- GtkTreeModel** model,
- GtkTreeIter* iter)
-{
- GtkTreeSelection* selection;
-
- g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE);
-
- selection = gtk_tree_view_get_selection (tree_view);
- if (selection)
- if (gtk_tree_selection_get_selected (selection, model, iter))
- return TRUE;
- return FALSE;
-}
-
/**
* sokoke_time_t_to_julian:
* @timestamp: a time_t timestamp value