[Spice-commits] 2 commits - src/spice-gtk-session.c src/spice-gtk-session-priv.h src/spice-widget.c src/usb-device-widget.c
Christophe Fergau
teuf at kemper.freedesktop.org
Thu Jan 4 12:08:26 UTC 2018
src/spice-gtk-session-priv.h | 1 -
src/spice-gtk-session.c | 20 ++++----------------
src/spice-widget.c | 20 ++++----------------
src/usb-device-widget.c | 19 ++++---------------
4 files changed, 12 insertions(+), 48 deletions(-)
New commits:
commit d942df0c335bd847f226f2d19f3a78dfc830f1a8
Author: Christophe Fergeau <cfergeau at redhat.com>
Date: Wed Jan 3 14:45:01 2018 +0100
Implement GObject::constructed rather than ::constructor
A few classes are implementing GObject::constructor, which is more
cumbersome to use than ::constructed. Other classes use ::constructed
rather than ::constructor. This commit removes the last uses of
::constructor.
Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau at redhat.com>
diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 312cf59..31f60dc 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -236,25 +236,15 @@ static void spice_gtk_session_init(SpiceGtkSession *self)
G_CALLBACK(keymap_modifiers_changed), self, 0);
}
-static GObject *
-spice_gtk_session_constructor(GType gtype,
- guint n_properties,
- GObjectConstructParam *properties)
+static void
+spice_gtk_session_constructed(GObject *gobject)
{
- GObject *obj;
SpiceGtkSession *self;
SpiceGtkSessionPrivate *s;
GList *list;
GList *it;
- {
- /* Always chain up to the parent constructor */
- GObjectClass *parent_class;
- parent_class = G_OBJECT_CLASS(spice_gtk_session_parent_class);
- obj = parent_class->constructor(gtype, n_properties, properties);
- }
-
- self = SPICE_GTK_SESSION(obj);
+ self = SPICE_GTK_SESSION(gobject);
s = self->priv;
if (!s->session)
g_error("SpiceGtKSession constructed without a session");
@@ -268,8 +258,6 @@ spice_gtk_session_constructor(GType gtype,
channel_new(s->session, it->data, (gpointer*)self);
}
g_list_free(list);
-
- return obj;
}
static void spice_gtk_session_dispose(GObject *gobject)
@@ -405,7 +393,7 @@ static void spice_gtk_session_class_init(SpiceGtkSessionClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
- gobject_class->constructor = spice_gtk_session_constructor;
+ gobject_class->constructed = spice_gtk_session_constructed;
gobject_class->dispose = spice_gtk_session_dispose;
gobject_class->finalize = spice_gtk_session_finalize;
gobject_class->get_property = spice_gtk_session_get_property;
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 5365222..316043a 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -686,25 +686,15 @@ G_GNUC_END_IGNORE_DEPRECATIONS
d->activeseq = g_new0(gboolean, d->grabseq->nkeysyms);
}
-static GObject *
-spice_display_constructor(GType gtype,
- guint n_properties,
- GObjectConstructParam *properties)
+static void
+spice_display_constructed(GObject *gobject)
{
- GObject *obj;
SpiceDisplay *display;
SpiceDisplayPrivate *d;
GList *list;
GList *it;
- {
- /* Always chain up to the parent constructor */
- GObjectClass *parent_class;
- parent_class = G_OBJECT_CLASS(spice_display_parent_class);
- obj = parent_class->constructor(gtype, n_properties, properties);
- }
-
- display = SPICE_DISPLAY(obj);
+ display = SPICE_DISPLAY(gobject);
d = display->priv;
if (!d->session)
@@ -730,8 +720,6 @@ spice_display_constructor(GType gtype,
spice_g_signal_connect_object(d->session, "notify::inhibit-keyboard-grab",
G_CALLBACK(session_inhibit_keyboard_grab_changed),
display, 0);
-
- return obj;
}
/**
@@ -2191,7 +2179,7 @@ static void spice_display_class_init(SpiceDisplayClass *klass)
gtkwidget_class->realize = realize;
gtkwidget_class->unrealize = unrealize;
- gobject_class->constructor = spice_display_constructor;
+ gobject_class->constructed = spice_display_constructed;
gobject_class->dispose = spice_display_dispose;
gobject_class->finalize = spice_display_finalize;
gobject_class->get_property = spice_display_get_property;
diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c
index 747887c..a3c0910 100644
--- a/src/usb-device-widget.c
+++ b/src/usb-device-widget.c
@@ -180,10 +180,8 @@ spice_usb_device_widget_show_info_bar(SpiceUsbDeviceWidget *self,
gtk_widget_show_all(priv->info_bar);
}
-static GObject *spice_usb_device_widget_constructor(
- GType gtype, guint n_properties, GObjectConstructParam *properties)
+static void spice_usb_device_widget_constructed(GObject *gobject)
{
- GObject *obj;
SpiceUsbDeviceWidget *self;
SpiceUsbDeviceWidgetPrivate *priv;
GPtrArray *devices = NULL;
@@ -191,14 +189,7 @@ static GObject *spice_usb_device_widget_constructor(
gchar *str;
int i;
- {
- /* Always chain up to the parent constructor */
- GObjectClass *parent_class;
- parent_class = G_OBJECT_CLASS(spice_usb_device_widget_parent_class);
- obj = parent_class->constructor(gtype, n_properties, properties);
- }
-
- self = SPICE_USB_DEVICE_WIDGET(obj);
+ self = SPICE_USB_DEVICE_WIDGET(gobject);
priv = self->priv;
if (!priv->session)
g_error("SpiceUsbDeviceWidget constructed without a session");
@@ -216,7 +207,7 @@ static GObject *spice_usb_device_widget_constructor(
GTK_MESSAGE_WARNING,
"dialog-warning");
g_clear_error(&err);
- return obj;
+ return;
}
g_signal_connect(priv->manager, "device-added",
@@ -237,8 +228,6 @@ static GObject *spice_usb_device_widget_constructor(
end:
spice_usb_device_widget_update_status(self);
-
- return obj;
}
static void spice_usb_device_widget_finalize(GObject *object)
@@ -269,7 +258,7 @@ static void spice_usb_device_widget_class_init(
g_type_class_add_private (klass, sizeof (SpiceUsbDeviceWidgetPrivate));
- gobject_class->constructor = spice_usb_device_widget_constructor;
+ gobject_class->constructed = spice_usb_device_widget_constructed;
gobject_class->finalize = spice_usb_device_widget_finalize;
gobject_class->get_property = spice_usb_device_widget_get_property;
gobject_class->set_property = spice_usb_device_widget_set_property;
commit dc1874b70a991c94526bfcae4912332c0bf5ea65
Author: Christophe Fergeau <cfergeau at redhat.com>
Date: Wed Jan 3 14:44:13 2018 +0100
session: Remove unused spice_gtk_session_get_read_only prototype
There is no such function implemented anywhere in the codebase.
This was mistakenly added in 222e25a029.
Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau at redhat.com>
diff --git a/src/spice-gtk-session-priv.h b/src/spice-gtk-session-priv.h
index d7fe313..0dbc9e9 100644
--- a/src/spice-gtk-session-priv.h
+++ b/src/spice-gtk-session-priv.h
@@ -37,7 +37,6 @@ struct _SpiceGtkSessionClass
void spice_gtk_session_request_auto_usbredir(SpiceGtkSession *self,
gboolean state);
-gboolean spice_gtk_session_get_read_only(SpiceGtkSession *self);
void spice_gtk_session_sync_keyboard_modifiers(SpiceGtkSession *self);
void spice_gtk_session_set_pointer_grabbed(SpiceGtkSession *self, gboolean grabbed);
gboolean spice_gtk_session_get_pointer_grabbed(SpiceGtkSession *self);
More information about the Spice-commits
mailing list