[Spice-devel] [PATCH spice-gtk 5/5] Adjust to Gtk+ 3.10
Pavel Grunt
pgrunt at redhat.com
Thu Mar 17 10:19:36 UTC 2016
Dependency since f9a1aad85fcc76dd76c454b51fbce5e07c9b145f
Remove unneeded GTK_CHECK_VERSION guards
---
src/gtk-compat.h | 2 --
src/spicy.c | 16 ----------------
src/usb-device-widget.c | 9 ---------
3 files changed, 27 deletions(-)
diff --git a/src/gtk-compat.h b/src/gtk-compat.h
index b2cf6d6..39438f9 100644
--- a/src/gtk-compat.h
+++ b/src/gtk-compat.h
@@ -22,12 +22,10 @@
#include <gtk/gtk.h>
-#if GTK_CHECK_VERSION (2, 91, 0)
static inline void gdk_drawable_get_size(GdkWindow *w, gint *ww, gint *wh)
{
*ww = gdk_window_get_width(w);
*wh = gdk_window_get_height(w);
}
-#endif
#endif /* GTK_COMPAT_H */
diff --git a/src/spicy.c b/src/spicy.c
index c3564f0..6ca014b 100644
--- a/src/spicy.c
+++ b/src/spicy.c
@@ -1001,11 +1001,7 @@ static SpiceWindow *create_spice_window(spice_connection *conn, SpiceChannel *ch
G_CALLBACK(grab_keys_pressed_cb), win);
/* status line */
-#if GTK_CHECK_VERSION(3,0,0)
win->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);
-#else
- win->statusbar = gtk_hbox_new(FALSE, 1);
-#endif
win->status = gtk_label_new("status line");
gtk_misc_set_alignment(GTK_MISC(win->status), 0, 0.5);
@@ -1025,11 +1021,7 @@ static SpiceWindow *create_spice_window(spice_connection *conn, SpiceChannel *ch
}
/* Make a vbox and put stuff in */
-#if GTK_CHECK_VERSION(3,0,0)
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 1);
-#else
- vbox = gtk_vbox_new(FALSE, 1);
-#endif
gtk_container_set_border_width(GTK_CONTAINER(vbox), 0);
gtk_container_add(GTK_CONTAINER(win->toplevel), vbox);
gtk_box_pack_start(GTK_BOX(vbox), win->menubar, FALSE, FALSE, 0);
@@ -1510,28 +1502,20 @@ TransferTaskWidgets *transfer_task_widgets_new(SpiceFileTransferTask *task)
{
TransferTaskWidgets *widgets = g_new0(TransferTaskWidgets, 1);
-#if GTK_CHECK_VERSION(3,0,0)
widgets->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
widgets->hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
widgets->cancel = gtk_button_new_from_icon_name(GTK_STOCK_CANCEL,
GTK_ICON_SIZE_SMALL_TOOLBAR);
-#else
- widgets->vbox = gtk_vbox_new(FALSE, 0);
- widgets->hbox = gtk_hbox_new(FALSE, 6);
- widgets->cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
-#endif
widgets->progress = gtk_progress_bar_new();
widgets->label = gtk_label_new(spice_file_transfer_task_get_filename(task));
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_set_halign(widgets->label, GTK_ALIGN_START);
gtk_widget_set_valign(widgets->label, GTK_ALIGN_BASELINE);
gtk_widget_set_valign(widgets->progress, GTK_ALIGN_CENTER);
gtk_widget_set_hexpand(widgets->progress, TRUE);
gtk_widget_set_valign(widgets->cancel, GTK_ALIGN_CENTER);
gtk_widget_set_hexpand(widgets->progress, FALSE);
-#endif
gtk_box_pack_start(GTK_BOX(widgets->hbox), widgets->progress,
TRUE, TRUE, 0);
diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c
index 8f85ae9..3b060e9 100644
--- a/src/usb-device-widget.c
+++ b/src/usb-device-widget.c
@@ -94,12 +94,7 @@ struct _SpiceUsbDeviceWidgetPrivate {
static guint signals[LAST_SIGNAL] = { 0, };
-#if GTK_CHECK_VERSION(3,0,0)
G_DEFINE_TYPE(SpiceUsbDeviceWidget, spice_usb_device_widget, GTK_TYPE_BOX);
-#else
-G_DEFINE_TYPE(SpiceUsbDeviceWidget, spice_usb_device_widget, GTK_TYPE_VBOX);
-#endif
-
static void spice_usb_device_widget_get_property(GObject *gobject,
guint prop_id,
@@ -168,11 +163,7 @@ spice_usb_device_widget_show_info_bar(SpiceUsbDeviceWidget *self,
gtk_info_bar_set_message_type(GTK_INFO_BAR(info_bar), message_type);
content_area = gtk_info_bar_get_content_area(GTK_INFO_BAR(info_bar));
-#if GTK_CHECK_VERSION(3,0,0)
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
-#else
- hbox = gtk_hbox_new(FALSE, 12);
-#endif
gtk_container_add(GTK_CONTAINER(content_area), hbox);
widget = gtk_image_new_from_stock(stock_icon_id,
--
2.7.3
More information about the Spice-devel
mailing list