[gedit] notebook popup: use g_object_class_install_properties
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] notebook popup: use g_object_class_install_properties
- Date: Sun, 13 Sep 2015 20:10:23 +0000 (UTC)
commit 9cab545ed488e56f55887b9b7c3af0184237a791
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Sep 13 22:03:58 2015 +0200
notebook popup: use g_object_class_install_properties
gedit/gedit-notebook-popup-menu.c | 46 ++++++++++++++++---------------------
1 files changed, 20 insertions(+), 26 deletions(-)
---
diff --git a/gedit/gedit-notebook-popup-menu.c b/gedit/gedit-notebook-popup-menu.c
index f780e02..95ef458 100644
--- a/gedit/gedit-notebook-popup-menu.c
+++ b/gedit/gedit-notebook-popup-menu.c
@@ -41,9 +41,12 @@ enum
{
PROP_0,
PROP_WINDOW,
- PROP_TAB
+ PROP_TAB,
+ LAST_PROP
};
+static GParamSpec *properties[LAST_PROP];
+
G_DEFINE_TYPE (GeditNotebookPopupMenu, gedit_notebook_popup_menu, GTK_TYPE_MENU)
static void
@@ -95,12 +98,6 @@ gedit_notebook_popup_menu_get_property (GObject *object,
}
static void
-gedit_notebook_popup_menu_finalize (GObject *object)
-{
- G_OBJECT_CLASS (gedit_notebook_popup_menu_parent_class)->finalize (object);
-}
-
-static void
update_sensitivity (GeditNotebookPopupMenu *menu)
{
GeditTabState state;
@@ -164,25 +161,22 @@ gedit_notebook_popup_menu_class_init (GeditNotebookPopupMenuClass *klass)
object_class->get_property = gedit_notebook_popup_menu_get_property;
object_class->set_property = gedit_notebook_popup_menu_set_property;
object_class->constructed = gedit_notebook_popup_menu_constructed;
- object_class->finalize = gedit_notebook_popup_menu_finalize;
-
- g_object_class_install_property (object_class,
- PROP_WINDOW,
- g_param_spec_object ("window",
- "Window",
- "The GeditWindow",
- GEDIT_TYPE_WINDOW,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
-
- g_object_class_install_property (object_class,
- PROP_TAB,
- g_param_spec_object ("tab",
- "Tab",
- "The GeditTab",
- GEDIT_TYPE_TAB,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+
+ properties[PROP_WINDOW] =
+ g_param_spec_object ("window",
+ "Window",
+ "The GeditWindow",
+ GEDIT_TYPE_WINDOW,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
+ properties[PROP_TAB] =
+ g_param_spec_object ("tab",
+ "Tab",
+ "The GeditTab",
+ GEDIT_TYPE_TAB,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
+ g_object_class_install_properties (object_class, LAST_PROP, properties);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]