cheese r899 - in trunk: . src
- From: dgsiegel svn gnome org
- To: svn-commits-list gnome org
- Subject: cheese r899 - in trunk: . src
- Date: Tue, 12 Aug 2008 12:46:40 +0000 (UTC)
Author: dgsiegel
Date: Tue Aug 12 12:46:39 2008
New Revision: 899
URL: http://svn.gnome.org/viewvc/cheese?rev=899&view=rev
Log:
select the last thumbnail item, if the last one was deleted
Modified:
trunk/ChangeLog
trunk/src/cheese-thumb-view.c
Modified: trunk/src/cheese-thumb-view.c
==============================================================================
--- trunk/src/cheese-thumb-view.c (original)
+++ trunk/src/cheese-thumb-view.c Tue Aug 12 12:46:39 2008
@@ -270,12 +270,18 @@
if (!found) return;
gboolean valid = gtk_list_store_remove (priv->store, &iter);
- if (valid)
+ if (!valid)
{
- GtkTreePath *tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->store), &iter);
- gtk_icon_view_select_path (GTK_ICON_VIEW (thumb_view), tree_path);
- gtk_tree_path_free (tree_path);
+ int len = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->store), NULL);
+ if (len <= 0)
+ return;
+
+ valid = gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (priv->store), &iter, NULL, len - 1);
}
+ GtkTreePath *tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->store), &iter);
+ gtk_icon_view_select_path (GTK_ICON_VIEW (thumb_view), tree_path);
+ gtk_tree_path_free (tree_path);
+
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]