diff options
author | infirit <[email protected]> | 2014-12-14 15:46:56 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-12-15 23:24:56 +0100 |
commit | 4fbdbe250e0cee0c76ffb521b658c93f192539f8 (patch) | |
tree | 517379015fc9f056d592cfa8c9fbdf177840f7ed | |
parent | 55f6eca4a8876718f9050191c7f67594928151c1 (diff) | |
download | mate-utils-4fbdbe250e0cee0c76ffb521b658c93f192539f8.tar.bz2 mate-utils-4fbdbe250e0cee0c76ffb521b658c93f192539f8.tar.xz |
Fix deprecated functions
Remove, now unneeded, gdkkeysyms-compat.h include
Always use gtk_combo_box_text_new (since Gtk+ 2.24)
Gtk3: do not use gdk_cursor_unref
Gtk3: replace gtk_hpaned_new
Gtk3: replace gtk_widget_modify_font
-rw-r--r-- | logview/logview-window.c | 11 | ||||
-rw-r--r-- | mate-dictionary/libgdict/gdict-database-chooser.c | 4 | ||||
-rw-r--r-- | mate-dictionary/libgdict/gdict-defbox.c | 8 | ||||
-rw-r--r-- | mate-dictionary/libgdict/gdict-source-chooser.c | 4 | ||||
-rw-r--r-- | mate-dictionary/libgdict/gdict-speller.c | 4 | ||||
-rw-r--r-- | mate-dictionary/libgdict/gdict-strategy-chooser.c | 4 | ||||
-rw-r--r-- | mate-dictionary/src/gdict-window.c | 4 | ||||
-rw-r--r-- | mate-screenshot/screenshot-dialog.c | 4 | ||||
-rw-r--r-- | mate-screenshot/screenshot-utils.c | 1 |
9 files changed, 37 insertions, 7 deletions
diff --git a/logview/logview-window.c b/logview/logview-window.c index b192c291..c0d65a2b 100644 --- a/logview/logview-window.c +++ b/logview/logview-window.c @@ -24,9 +24,6 @@ #include <string.h> #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> -#if GTK_CHECK_VERSION (3, 0, 0) -#include <gdk/gdkkeysyms-compat.h> -#endif #include <glib/gi18n.h> #include "logview-window.h" @@ -1301,7 +1298,11 @@ logview_window_init (LogviewWindow *logview) gtk_widget_show (w); /* panes */ +#if GTK_CHECK_VERSION (3, 0, 0) + hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); +#else hpaned = gtk_hpaned_new (); +#endif gtk_box_pack_start (GTK_BOX (vbox), hpaned, TRUE, TRUE, 0); priv->hpaned = hpaned; gtk_widget_show (hpaned); @@ -1379,11 +1380,7 @@ logview_window_init (LogviewWindow *logview) /* version selector */ priv->version_bar = gtk_hbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (priv->version_bar), 3); -#if GTK_CHECK_VERSION (3, 0, 0) priv->version_selector = gtk_combo_box_text_new (); -#else - priv->version_selector = gtk_combo_box_new_text (); -#endif g_signal_connect (priv->version_selector, "changed", G_CALLBACK (logview_version_selector_changed), logview); w = gtk_label_new (_("Version: ")); diff --git a/mate-dictionary/libgdict/gdict-database-chooser.c b/mate-dictionary/libgdict/gdict-database-chooser.c index 11cc80ce..abf5f86e 100644 --- a/mate-dictionary/libgdict/gdict-database-chooser.c +++ b/mate-dictionary/libgdict/gdict-database-chooser.c @@ -190,7 +190,11 @@ gdict_database_chooser_dispose (GObject *gobject) if (priv->busy_cursor) { +#if GTK_CHECK_VERSION (3, 0, 0) + g_object_unref (priv->busy_cursor); +#else gdk_cursor_unref (priv->busy_cursor); +#endif priv->busy_cursor = NULL; } diff --git a/mate-dictionary/libgdict/gdict-defbox.c b/mate-dictionary/libgdict/gdict-defbox.c index 86d4427f..48bda738 100644 --- a/mate-dictionary/libgdict/gdict-defbox.c +++ b/mate-dictionary/libgdict/gdict-defbox.c @@ -52,6 +52,10 @@ #define QUERY_MARGIN 48 #define ERROR_MARGIN 24 +#if GTK_CHECK_VERSION (3, 0, 0) +#define gdk_cursor_unref g_object_unref +#endif + typedef struct { GdictDefinition *definition; @@ -2853,7 +2857,11 @@ gdict_defbox_set_font_name (GdictDefbox *defbox, else font_desc = NULL; +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_override_font (priv->text_view, font_desc); +#else gtk_widget_modify_font (priv->text_view, font_desc); +#endif if (font_desc) pango_font_description_free (font_desc); diff --git a/mate-dictionary/libgdict/gdict-source-chooser.c b/mate-dictionary/libgdict/gdict-source-chooser.c index eecdc96c..dada5958 100644 --- a/mate-dictionary/libgdict/gdict-source-chooser.c +++ b/mate-dictionary/libgdict/gdict-source-chooser.c @@ -129,7 +129,11 @@ gdict_source_chooser_dispose (GObject *gobject) if (priv->busy_cursor) { +#if GTK_CHECK_VERSION (3, 0, 0) + g_object_unref (priv->busy_cursor); +#else gdk_cursor_unref (priv->busy_cursor); +#endif priv->busy_cursor = NULL; } diff --git a/mate-dictionary/libgdict/gdict-speller.c b/mate-dictionary/libgdict/gdict-speller.c index 3c81074e..5f370ba8 100644 --- a/mate-dictionary/libgdict/gdict-speller.c +++ b/mate-dictionary/libgdict/gdict-speller.c @@ -173,7 +173,11 @@ gdict_speller_finalize (GObject *gobject) set_gdict_context (speller, NULL); if (priv->busy_cursor) +#if GTK_CHECK_VERSION (3, 0, 0) + g_object_unref (priv->busy_cursor); +#else gdk_cursor_unref (priv->busy_cursor); +#endif g_free (priv->strategy); g_free (priv->database); diff --git a/mate-dictionary/libgdict/gdict-strategy-chooser.c b/mate-dictionary/libgdict/gdict-strategy-chooser.c index 9cabc445..375c2aaf 100644 --- a/mate-dictionary/libgdict/gdict-strategy-chooser.c +++ b/mate-dictionary/libgdict/gdict-strategy-chooser.c @@ -176,7 +176,11 @@ gdict_strategy_chooser_dispose (GObject *gobject) if (priv->busy_cursor) { +#if GTK_CHECK_VERSION (3, 0, 0) + g_object_unref (priv->busy_cursor); +#else gdk_cursor_unref (priv->busy_cursor); +#endif priv->busy_cursor = NULL; } diff --git a/mate-dictionary/src/gdict-window.c b/mate-dictionary/src/gdict-window.c index 6b60dda0..e25ef30c 100644 --- a/mate-dictionary/src/gdict-window.c +++ b/mate-dictionary/src/gdict-window.c @@ -1798,7 +1798,11 @@ gdict_window_constructor (GType type, gtk_box_pack_start (GTK_BOX (hbox), window->entry, TRUE, TRUE, 0); gtk_widget_show (window->entry); +#if GTK_CHECK_VERSION (3, 0, 0) + handle = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL) +#else handle = gtk_hpaned_new (); +#endif gtk_box_pack_start (GTK_BOX (vbox), handle, TRUE, TRUE, 0); gtk_widget_show (handle); diff --git a/mate-screenshot/screenshot-dialog.c b/mate-screenshot/screenshot-dialog.c index f9c9a331..c5105be7 100644 --- a/mate-screenshot/screenshot-dialog.c +++ b/mate-screenshot/screenshot-dialog.c @@ -402,7 +402,11 @@ screenshot_dialog_set_busy (ScreenshotDialog *dialog, /* Change cursor to busy */ cursor = gdk_cursor_new (GDK_WATCH); gdk_window_set_cursor (gtk_widget_get_window (toplevel), cursor); +#if GTK_CHECK_VERSION (3, 0, 0) + g_object_unref (cursor); +#else gdk_cursor_unref (cursor); +#endif } else { diff --git a/mate-screenshot/screenshot-utils.c b/mate-screenshot/screenshot-utils.c index 92391d6b..eaeeca28 100644 --- a/mate-screenshot/screenshot-utils.c +++ b/mate-screenshot/screenshot-utils.c @@ -39,6 +39,7 @@ #define gdk_region_intersect cairo_region_intersect #define gdk_region_subtract cairo_region_subtract #define gdk_region_union_with_rect cairo_region_union_rectangle +#define gdk_cursor_unref g_object_unref #endif static GtkWidget *selection_window; |