[Goodies-commits] r6644 - in gigolo/trunk: . src

Enrico Troeger enrico at xfce.org
Wed Feb 4 21:12:18 CET 2009


Author: enrico
Date: 2009-02-04 20:12:18 +0000 (Wed, 04 Feb 2009)
New Revision: 6644

Modified:
   gigolo/trunk/ChangeLog
   gigolo/trunk/src/bookmarkeditdialog.c
Log:
Prevent setting an invisible/unsupported item in the scheme combo box, fallback to Custom Location

Modified: gigolo/trunk/ChangeLog
===================================================================
--- gigolo/trunk/ChangeLog	2009-02-04 11:38:29 UTC (rev 6643)
+++ gigolo/trunk/ChangeLog	2009-02-04 20:12:18 UTC (rev 6644)
@@ -1,3 +1,10 @@
+2009-02-04  Enrico Tröger  <enrico(at)xfce(dot)org>
+
+ * src/bookmarkeditdialog.c:
+   Prevent setting an invisible/unsupported item in the scheme combo
+   box, fallback to Custom Location.
+
+
 2009-01-31  Enrico Tröger  <enrico(at)xfce(dot)org>
 
  * *.*:

Modified: gigolo/trunk/src/bookmarkeditdialog.c
===================================================================
--- gigolo/trunk/src/bookmarkeditdialog.c	2009-02-04 11:38:29 UTC (rev 6643)
+++ gigolo/trunk/src/bookmarkeditdialog.c	2009-02-04 20:12:18 UTC (rev 6644)
@@ -346,8 +346,19 @@
 
 static void combo_set_active(GtkWidget *combo, gint idx)
 {
-	gtk_tree_model_foreach(gtk_combo_box_get_model(GTK_COMBO_BOX(combo)),
-		combo_foreach, GINT_TO_POINTER(idx));
+	GtkTreeIter iter;
+	GtkTreeModel *model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo));
+	gboolean visible = FALSE;
+	gboolean is_valid;
+
+	gtk_tree_model_foreach(model, combo_foreach, GINT_TO_POINTER(idx));
+
+	/* Prevent setting an invisible/unsupported scheme, fallback to Custom Location. */
+	is_valid = gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combo), &iter);
+	if (is_valid)
+		gtk_tree_model_get(model, &iter, COLUMN_VISIBLE, &visible, -1);
+	if (! visible || !is_valid)
+		gtk_tree_model_foreach(model, combo_foreach, GINT_TO_POINTER(SCHEME_CUSTOM));
 }
 
 




More information about the Goodies-commits mailing list