[buoh/cleanups: 25/31] BuohViewStatus: use glib-mkenums



commit 1e8cb1346086fac17f8b272f3171317ea87d9582
Author: Jan Tojnar <jtojnar gmail com>
Date:   Tue Jan 22 05:59:53 2019 +0100

    BuohViewStatus: use glib-mkenums

 data/meson.build |  2 +-
 src/buoh-view.c  | 21 ---------------------
 src/buoh-view.h  |  2 --
 src/meson.build  |  5 ++++-
 4 files changed, 5 insertions(+), 25 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index ec37c83..638406f 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -42,7 +42,7 @@ install_data(
 
 gnome.mkenums(
   'org.gnome.buoh.enums.xml',
-  sources: enum_headers,
+  sources: settings_headers,
   comments: '<!-- @comment@ -->',
   fhead: '<schemalist>',
   vhead: '  <@type@ id="org.gnome.buoh.@EnumName@">',
diff --git a/src/buoh-view.c b/src/buoh-view.c
index 059b6a5..414fa01 100644
--- a/src/buoh-view.c
+++ b/src/buoh-view.c
@@ -76,27 +76,6 @@ static void     buoh_view_scale_changed_cb   (GObject        *object,
 
 G_DEFINE_TYPE (BuohView, buoh_view, GTK_TYPE_NOTEBOOK)
 
-GType
-buoh_view_status_get_type (void)
-{
-        static GType etype = 0;
-
-        if (G_UNLIKELY (etype == 0)) {
-                static const GEnumValue values[] = {
-                        { STATE_MESSAGE_WELCOME, "STATE_MESSAGE_WELCOME", "welcome" },
-                        { STATE_MESSAGE_ERROR,   "STATE_MESSAGE_ERROR",   "error"   },
-                        { STATE_COMIC_LOADING,   "STATE_COMIC_LOADING",   "loading" },
-                        { STATE_COMIC_LOADED,    "STATE_COMIC_LOADED",    "loaded"  },
-                        { STATE_EMPTY,           "STATE_EMPTY",           "empty"   },
-                        { 0, NULL, NULL }
-                };
-
-                etype = g_enum_register_static ("BuohViewStatus", values);
-        }
-
-        return etype;
-}
-
 static void
 buoh_view_init (BuohView *buoh_view)
 {
diff --git a/src/buoh-view.h b/src/buoh-view.h
index 159d912..14f3079 100644
--- a/src/buoh-view.h
+++ b/src/buoh-view.h
@@ -31,8 +31,6 @@ G_BEGIN_DECLS
 #define BUOH_TYPE_VIEW buoh_view_get_type ()
 G_DECLARE_FINAL_TYPE (BuohView, buoh_view, BUOH, VIEW, GtkNotebook)
 
-#define BUOH_TYPE_VIEW_STATUS buoh_view_status_get_type ()
-
 typedef enum {
         STATE_MESSAGE_WELCOME,
         STATE_MESSAGE_ERROR,
diff --git a/src/meson.build b/src/meson.build
index 53d7a06..bb6a4b8 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,6 +1,9 @@
-enum_headers = files(
+settings_headers = files(
   'buoh-settings.h',
 )
+enum_headers = settings_headers + files(
+  'buoh-view.h',
+)
 
 sources = files(
   'buoh-add-comic-dialog.c',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]