pidgin/pidgin

e2f0d7323124
Parents 173504a1b361
Children b2836a24d81e
sf patch #1644019, from good ol' Ka-Hing Cheung

"fix compiling on gtk 2.4. xmppconsole.c is the culprit.
gtk_combo_box_get_active_text is defined in gtk 2.6 but not 2.4."
--- a/gtk/gaimcombobox.c Thu Jan 25 08:27:41 2007 +0000
+++ b/gtk/gaimcombobox.c Thu Jan 25 08:29:50 2007 +0000
@@ -21,9 +21,10 @@
#include <config.h>
*/
#include <gtk/gtkversion.h>
-#if !GTK_CHECK_VERSION(2,4,0)
+#if !GTK_CHECK_VERSION(2,6,0)
#include "gaimcombobox.h"
+#if !GTK_CHECK_VERSION(2,4,0)
#include <gtk/gtkarrow.h>
#include <gtk/gtkbindings.h>
#include "gtkcelllayout.h"
@@ -3557,21 +3558,6 @@
gtk_list_store_remove (store, &iter);
}
-static gchar *
-gtk_combo_box_get_active_text (GtkComboBox *combo_box)
-{
- GtkTreeIter iter;
- gchar *text = NULL;
-
- g_return_val_if_fail (GTK_IS_LIST_STORE (combo_box->priv->model), NULL);
-
- if (gtk_combo_box_get_active_iter (combo_box, &iter))
- gtk_tree_model_get (combo_box->priv->model, &iter,
- 0, &text, -1);
- return text;
-}
-
-
static gboolean
gtk_combo_box_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling)
@@ -3745,3 +3731,19 @@
}
}
#endif /* Gtk 2.4 */
+
+gchar *
+gtk_combo_box_get_active_text (GtkComboBox *combo_box)
+{
+ GtkTreeIter iter;
+ gchar *text = NULL;
+
+ /* g_return_val_if_fail (GTK_IS_LIST_STORE (combo_box->priv->model), NULL); */
+
+ if (gtk_combo_box_get_active_iter (combo_box, &iter))
+ gtk_tree_model_get (gtk_combo_box_get_model(combo_box), &iter,
+ 0, &text, -1);
+ return text;
+}
+
+#endif
--- a/gtk/gaimcombobox.h Thu Jan 25 08:27:41 2007 +0000
+++ b/gtk/gaimcombobox.h Thu Jan 25 08:29:50 2007 +0000
@@ -17,6 +17,9 @@
* Boston, MA 02111-1307, USA.
*/
+#ifndef __GAIM_COMBO_BOX_H__
+#define __GAIM_COMBO_BOX_H__
+
#ifndef __GTK_COMBO_BOX_H__
#define __GTK_COMBO_BOX_H__
@@ -98,8 +101,6 @@
const gchar *text);
void gtk_combo_box_remove_text (GtkComboBox *combo_box,
gint position);
-gchar *gtk_combo_box_get_active_text (GtkComboBox *combo_box);
-
/* programmatic control */
void gtk_combo_box_popup (GtkComboBox *combo_box);
void gtk_combo_box_popdown (GtkComboBox *combo_box);
@@ -107,3 +108,7 @@
G_END_DECLS
#endif /* __GTK_COMBO_BOX_H__ */
+
+gchar *gtk_combo_box_get_active_text (GtkComboBox *combo_box);
+
+#endif /* __GAIM_COMBOX_BOX_H__ */
--- a/gtk/gtkgaim.h Thu Jan 25 08:27:41 2007 +0000
+++ b/gtk/gtkgaim.h Thu Jan 25 08:29:50 2007 +0000
@@ -55,24 +55,24 @@
*/
/** @cond */
#if (!GTK_CHECK_VERSION(2,4,0))
-#define GTK_WRAP_WORD_CHAR GTK_WRAP_WORD
-#include "gtkexpander.h"
+# define GTK_WRAP_WORD_CHAR GTK_WRAP_WORD
+# include "gtkexpander.h"
#endif
/** @endcond */
/*
* We include the sources for GtkComboBox and GtkCellView because
- * they don't exist in older version of Gtk+, and we use them
+ * they don't exist in older versions of GTK+, and we use them
* in a few places.
*/
#if !GTK_CHECK_VERSION(2,6,0)
# include "gtkcellview.h"
# include "gtkcellviewmenuitem.h"
+# include "gaimcombobox.h"
# if !GTK_CHECK_VERSION(2,4,0)
# include "gtkcelllayout.h"
-# include "gaimcombobox.h"
-# endif /* Gtk 2.4 */
-#endif /* Gtk 2.6 */
+# endif /* Less than GTK+ 2.4 */
+#endif /* Less than GTK+ 2.6 */
/*
* Spacings between components, as defined by the