cpw.qulogic.gtk3: 2467f64b: With 2.7.0, we don't need these GTK_CHEC...

qulogic at pidgin.im qulogic at pidgin.im
Wed Jun 9 01:27:03 EDT 2010


-----------------------------------------------------------------
Revision: 2467f64b9a1f8eefa825f2a81646d45aa59ff942
Ancestor: 0161ccb7481e21a3f58e8b6b0b6c1cdd69594120
Author: qulogic at pidgin.im
Date: 2010-06-05T22:30:51
Branch: im.pidgin.cpw.qulogic.gtk3
URL: http://d.pidgin.im/viewmtn/revision/info/2467f64b9a1f8eefa825f2a81646d45aa59ff942

Modified files:
        pidgin/gtkprefs.c

ChangeLog: 

With 2.7.0, we don't need these GTK_CHECK_VERSION's any more.

-------------- next part --------------
============================================================
--- pidgin/gtkprefs.c	4d4b4b3bfe0002a704ad15f83d07f17a06a7f216
+++ pidgin/gtkprefs.c	7e69cdc63c98884f05707705ca0cd6e8770eae0c
@@ -196,13 +196,12 @@ dropdown_set(GObject *w, const char *key
 	int int_value;
 	gboolean bool_value;
 	PurplePrefType type;
-
-#if GTK_CHECK_VERSION(2,4,0)
 	GtkTreeIter iter;
 	GtkTreeModel *tree_model;
 
 	tree_model = gtk_combo_box_get_model(GTK_COMBO_BOX(w));
-	gtk_combo_box_get_active_iter(GTK_COMBO_BOX(w), &iter);
+	if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(w), &iter))
+		return;
 
 	type = GPOINTER_TO_INT(g_object_get_data(w, "type"));
 
@@ -227,24 +226,6 @@ dropdown_set(GObject *w, const char *key
 
 		purple_prefs_set_bool(key, bool_value);
 	}
-#else
-	type = GPOINTER_TO_INT(g_object_get_data(w, "type"));
-
-	if (type == PURPLE_PREF_INT) {
-		int_value = GPOINTER_TO_INT(g_object_get_data(w, "value"));
-
-		purple_prefs_set_int(key, int_value);
-	}
-	else if (type == PURPLE_PREF_STRING) {
-		str_value = (const char *)g_object_get_data(w, "value");
-
-		purple_prefs_set_string(key, str_value);
-	}
-	else if (type == PURPLE_PREF_BOOLEAN) {
-		bool_value = (gboolean)GPOINTER_TO_INT(g_object_get_data(w, "value"));
-		purple_prefs_set_bool(key, bool_value);
-	}
-#endif
 }
 
 GtkWidget *
@@ -260,7 +241,6 @@ pidgin_prefs_dropdown_from_list(GtkWidge
 	int         int_value  = 0;
 	const char *str_value  = NULL;
 	gboolean    bool_value = FALSE;
-#if GTK_CHECK_VERSION(2,4,0)
 	GtkListStore *store;
 	GtkTreeIter iter;
 	GtkTreeIter active;
@@ -333,62 +313,6 @@ pidgin_prefs_dropdown_from_list(GtkWidge
 	g_signal_connect(G_OBJECT(dropdown), "changed",
 	                 G_CALLBACK(dropdown_set), (char *)key);
 
-#else
-	GtkWidget  *opt, *menu;
-	int         o = 0;
-
-	g_return_val_if_fail(menuitems != NULL, NULL);
-
-	dropdown = gtk_option_menu_new();
-	menu = gtk_menu_new();
-
-	if (type == PURPLE_PREF_INT)
-		stored_int = purple_prefs_get_int(key);
-	else if (type == PURPLE_PREF_STRING)
-		stored_str = purple_prefs_get_string(key);
-	else if (type == PURPLE_PREF_BOOLEAN)
-		stored_bool = purple_prefs_get_bool(key);
-
-	while (menuitems != NULL && (text = (char *)menuitems->data) != NULL) {
-		menuitems = g_list_next(menuitems);
-		g_return_val_if_fail(menuitems != NULL, NULL);
-
-		opt = gtk_menu_item_new_with_label(text);
-
-		g_object_set_data(G_OBJECT(opt), "type", GINT_TO_POINTER(type));
-		g_object_set_data(G_OBJECT(opt), "value", menuitems->data);
-
-		if (type == PURPLE_PREF_INT)
-			int_value = GPOINTER_TO_INT(menuitems->data);
-		else if (type == PURPLE_PREF_STRING)
-			str_value = (const char *)menuitems->data;
-		else if (type == PURPLE_PREF_BOOLEAN)
-			bool_value = (gboolean)GPOINTER_TO_INT(menuitems->data);
-
-		g_signal_connect(G_OBJECT(opt), "activate",
-						 G_CALLBACK(dropdown_set), (char *)key);
-
-		gtk_widget_show(opt);
-		gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
-
-		if ((type == PURPLE_PREF_INT && stored_int == int_value) ||
-			(type == PURPLE_PREF_STRING && stored_str != NULL &&
-			 !strcmp(stored_str, str_value)) ||
-			(type == PURPLE_PREF_BOOLEAN &&
-			 (stored_bool == bool_value))) {
-
-			gtk_menu_set_active(GTK_MENU(menu), o);
-		}
-
-		menuitems = g_list_next(menuitems);
-
-		o++;
-	}
-
-	gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu);
-
-#endif
-
 	pidgin_add_widget_to_vbox(GTK_BOX(box), title, NULL, dropdown, FALSE, &label);
 
 	return label;


More information about the Commits mailing list