[Goodies-commits] r7480 - gigolo/trunk/src

Enrico Troeger enrico at xfce.org
Sat Jun 6 18:24:29 CEST 2009


Author: enrico
Date: 2009-06-06 16:24:29 +0000 (Sat, 06 Jun 2009)
New Revision: 7480

Modified:
   gigolo/trunk/src/window.c
Log:
Simplify the code a bit.

Modified: gigolo/trunk/src/window.c
===================================================================
--- gigolo/trunk/src/window.c	2009-06-06 16:12:04 UTC (rev 7479)
+++ gigolo/trunk/src/window.c	2009-06-06 16:24:29 UTC (rev 7480)
@@ -217,16 +217,15 @@
 	}
 	else
 	{
-		GList *l, *items = gtk_icon_view_get_selected_items(GTK_ICON_VIEW(priv->iconview));
+		GList *items = gtk_icon_view_get_selected_items(GTK_ICON_VIEW(priv->iconview));
 		GtkTreeModel *model = gtk_icon_view_get_model(GTK_ICON_VIEW(priv->iconview));
 
-		for (l = items; l != NULL; l = l->next)
+		if (items != NULL)
 		{
-			gtk_tree_model_get_iter(model, iter, l->data);
-			/* the selection mode is SINGLE, so the list should never have more than one entry */
-			break;
+			/* the selection mode is SINGLE, so the list should never have more than one entry
+			 * and we simply choose the first item */
+			gtk_tree_model_get_iter(model, iter, items->data);
 		}
-
 		g_list_foreach(items, (GFunc) gtk_tree_path_free, NULL);
 		g_list_free(items);
 	}




More information about the Goodies-commits mailing list