[gtk+] displaymanager: Remove GInitable implementation
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] displaymanager: Remove GInitable implementation
- Date: Thu, 2 May 2013 14:32:13 +0000 (UTC)
commit f7ee5450e1abffb608a09d1d6608bd51fccaadad
Author: Benjamin Otte <otte redhat com>
Date: Thu May 2 16:17:30 2013 +0200
displaymanager: Remove GInitable implementation
This is not needed anymore, as only one type exists and that type can
always be instantiated.
gdk/gdkdisplaymanager.c | 19 +------------------
gdk/x11/gdkdisplaymanager-x11.c | 37 ++-----------------------------------
2 files changed, 3 insertions(+), 53 deletions(-)
---
diff --git a/gdk/gdkdisplaymanager.c b/gdk/gdkdisplaymanager.c
index ab2501c..cbc3ab2 100644
--- a/gdk/gdkdisplaymanager.c
+++ b/gdk/gdkdisplaymanager.c
@@ -130,24 +130,7 @@ static void gdk_display_manager_get_property (GObject *object,
static guint signals[LAST_SIGNAL] = { 0 };
-static void g_initable_iface_init (GInitableIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GdkDisplayManager, gdk_display_manager, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, g_initable_iface_init))
-
-static gboolean
-gdk_display_manager_initable_init (GInitable *initable,
- GCancellable *cancellable,
- GError **error)
-{
- return TRUE;
-}
-
-static void
-g_initable_iface_init (GInitableIface *iface)
-{
- iface->init = gdk_display_manager_initable_init;
-}
+G_DEFINE_TYPE (GdkDisplayManager, gdk_display_manager, G_TYPE_OBJECT)
static void
gdk_display_manager_class_init (GdkDisplayManagerClass *klass)
diff --git a/gdk/x11/gdkdisplaymanager-x11.c b/gdk/x11/gdkdisplaymanager-x11.c
index 1be6a51..7bc116d 100644
--- a/gdk/x11/gdkdisplaymanager-x11.c
+++ b/gdk/x11/gdkdisplaymanager-x11.c
@@ -31,8 +31,6 @@
struct _GdkX11DisplayManager
{
GdkDisplayManager parent;
-
- gboolean init_failed;
};
struct _GdkX11DisplayManagerClass
@@ -40,37 +38,7 @@ struct _GdkX11DisplayManagerClass
GdkDisplayManagerClass parent_class;
};
-static void g_initable_iface_init (GInitableIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GdkX11DisplayManager, gdk_x11_display_manager, GDK_TYPE_DISPLAY_MANAGER,
- G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, g_initable_iface_init))
-
-static gboolean
-gdk_x11_display_manager_initable_init (GInitable *initable,
- GCancellable *cancellable,
- GError **error)
-{
- Display *display;
-
- /* check that a connection to the default display is possible */
- display = XOpenDisplay (gdk_get_display_arg_name ());
- if (!display)
- {
- GDK_X11_DISPLAY_MANAGER (initable)->init_failed = TRUE;
- return FALSE;
- }
-
- XCloseDisplay (display);
-
- return TRUE;
-}
-
-void
-g_initable_iface_init (GInitableIface *iface)
-{
- iface->init = gdk_x11_display_manager_initable_init;
-}
-
+G_DEFINE_TYPE (GdkX11DisplayManager, gdk_x11_display_manager, GDK_TYPE_DISPLAY_MANAGER)
static void
gdk_x11_display_manager_init (GdkX11DisplayManager *manager)
@@ -80,8 +48,7 @@ gdk_x11_display_manager_init (GdkX11DisplayManager *manager)
static void
gdk_x11_display_manager_finalize (GObject *object)
{
- if (GDK_X11_DISPLAY_MANAGER (object)->init_failed == FALSE)
- g_error ("A GdkX11DisplayManager object was finalized. This should not happen");
+ g_error ("A GdkX11DisplayManager object was finalized. This should not happen");
G_OBJECT_CLASS (gdk_x11_display_manager_parent_class)->finalize (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]