[nautilus] dbus-manager: migrate to G_DECLARE_* format
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] dbus-manager: migrate to G_DECLARE_* format
- Date: Thu, 28 Jun 2018 05:46:32 +0000 (UTC)
commit a945d22b5cfecb3416100a7c032e86f0b8657fef
Author: Yi-Soo An <yisooan gmail com>
Date: Wed Jun 27 21:47:31 2018 +0900
dbus-manager: migrate to G_DECLARE_* format
G_DECLARE_* macro is used for emitting the usual declarations.
It is better than previous way for developers.
src/nautilus-dbus-manager.c | 10 +---------
src/nautilus-dbus-manager.h | 5 ++---
2 files changed, 3 insertions(+), 12 deletions(-)
---
diff --git a/src/nautilus-dbus-manager.c b/src/nautilus-dbus-manager.c
index 3611a2358..6be4d855b 100644
--- a/src/nautilus-dbus-manager.c
+++ b/src/nautilus-dbus-manager.c
@@ -30,8 +30,6 @@
#define DEBUG_FLAG NAUTILUS_DEBUG_DBUS
#include "nautilus-debug.h"
-#include <gio/gio.h>
-
struct _NautilusDBusManager
{
GObject parent;
@@ -39,11 +37,6 @@ struct _NautilusDBusManager
NautilusDBusFileOperations *file_operations;
};
-struct _NautilusDBusManagerClass
-{
- GObjectClass parent_class;
-};
-
G_DEFINE_TYPE (NautilusDBusManager, nautilus_dbus_manager, G_TYPE_OBJECT);
static void
@@ -161,8 +154,7 @@ nautilus_dbus_manager_class_init (NautilusDBusManagerClass *klass)
NautilusDBusManager *
nautilus_dbus_manager_new (void)
{
- return g_object_new (nautilus_dbus_manager_get_type (),
- NULL);
+ return g_object_new (NAUTILUS_TYPE_DBUS_MANAGER, NULL);
}
gboolean
diff --git a/src/nautilus-dbus-manager.h b/src/nautilus-dbus-manager.h
index ff59f34f7..7ff4f8e94 100644
--- a/src/nautilus-dbus-manager.h
+++ b/src/nautilus-dbus-manager.h
@@ -25,10 +25,9 @@
#include <glib-object.h>
#include <gio/gio.h>
-typedef struct _NautilusDBusManager NautilusDBusManager;
-typedef struct _NautilusDBusManagerClass NautilusDBusManagerClass;
+#define NAUTILUS_TYPE_DBUS_MANAGER (nautilus_dbus_manager_get_type())
+G_DECLARE_FINAL_TYPE (NautilusDBusManager, nautilus_dbus_manager, NAUTILUS, DBUS_MANAGER, GObject)
-GType nautilus_dbus_manager_get_type (void);
NautilusDBusManager * nautilus_dbus_manager_new (void);
gboolean nautilus_dbus_manager_register (NautilusDBusManager *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]