[anjuta/system-db-refactor: 19/22] libanjuta: Clear selection correctly in AnjutaPkgConfigChooser



commit ece97c409c23d699b05c76e2998daab565642721
Author: Johannes Schmid <jhs gnome org>
Date:   Thu Mar 3 17:11:21 2011 +0100

    libanjuta: Clear selection correctly in AnjutaPkgConfigChooser

 libanjuta/anjuta-pkg-config-chooser.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/libanjuta/anjuta-pkg-config-chooser.c b/libanjuta/anjuta-pkg-config-chooser.c
index 855b600..782bdd3 100644
--- a/libanjuta/anjuta-pkg-config-chooser.c
+++ b/libanjuta/anjuta-pkg-config-chooser.c
@@ -343,12 +343,24 @@ void
 anjuta_pkg_config_chooser_set_active_packages (AnjutaPkgConfigChooser* chooser, GList* packages)
 {
 	GList* pkg;
+	GtkTreeIter iter;
 
 	g_return_if_fail (ANJUTA_IS_PKG_CONFIG_CHOOSER (chooser));
+
+	/* Deselect all packages */
+	if (gtk_tree_model_get_iter_first (chooser->priv->model, &iter))
+	{
+		do
+		{
+			gtk_list_store_set (GTK_LIST_STORE (chooser->priv->model), &iter,
+				                    COLUMN_ACTIVE, FALSE, -1);
+		}
+		while (gtk_tree_model_iter_next (chooser->priv->model,
+		                                 &iter));
+	}
 	
 	for (pkg = packages; pkg != NULL; pkg = g_list_next (pkg))
 	{
-		GtkTreeIter iter;
 		if (chooser->priv->scanning)
 		{
 			chooser->priv->selected_cache = g_list_append (chooser->priv->selected_cache,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]