Replace a couple of deprecated functions # ifdef:ed with the GTK version they are deprecated in.

svn path=/trunk/; revision=35740
This commit is contained in:
Anders Broman 2011-02-01 07:15:14 +00:00
parent 1980a286ac
commit 6adf502aa7
3 changed files with 16 additions and 0 deletions

View File

@ -646,7 +646,11 @@ dfilter_expr_dlg_accept_cb(GtkWidget *w, gpointer filter_te_arg)
/*
* Get the range to use, if any.
*/
#if GTK_CHECK_VERSION(2,20,0)
if (gtk_widget_get_sensitive(range_entry)) {
#else
if (GTK_WIDGET_SENSITIVE(range_entry)) {
#endif
range_str = g_strdup(gtk_entry_get_text(GTK_ENTRY(range_entry)));
/*
* XXX - strip this even for strings?
@ -724,7 +728,11 @@ dfilter_expr_dlg_accept_cb(GtkWidget *w, gpointer filter_te_arg)
/*
* Get the value to use, if any.
*/
#if GTK_CHECK_VERSION(2,20,0)
if (gtk_widget_get_sensitive(value_entry)) {
#else
if (GTK_WIDGET_SENSITIVE(value_entry)) {
#endif
value_str = g_strdup(gtk_entry_get_text(GTK_ENTRY(value_entry)));
stripped_value_str = g_strstrip(value_str);
if (strcmp(stripped_value_str, "") == 0) {

View File

@ -518,7 +518,11 @@ window_destroy(GtkWidget *win)
* cannot be retrieved at destroy time (so don't use event "destroy" for this) */
/* ...and don't do this at all, if we currently have no GdkWindow (e.g. if the
* GtkWidget is hidden) */
#if GTK_CHECK_VERSION(2,18,0)
if(!gtk_widget_get_has_window (win) && gtk_widget_get_visible(win)) {
#else
if(!GTK_WIDGET_NO_WINDOW(win) && GTK_WIDGET_VISIBLE(win)) {
#endif
window_get_geometry(win, &geom);
name = g_object_get_data(G_OBJECT(win), WINDOW_GEOM_KEY);

View File

@ -3407,7 +3407,11 @@ is_widget_visible(GtkWidget *widget, gpointer data)
gboolean *is_visible = data;
if (!*is_visible) {
#if GTK_CHECK_VERSION(2,18,0)
if (gtk_widget_get_visible(widget))
#else
if (GTK_WIDGET_VISIBLE(widget))
#endif
*is_visible = TRUE;
}
}