[gedit] encodings combo: use g_object_class_install_properties
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] encodings combo: use g_object_class_install_properties
- Date: Sun, 13 Sep 2015 19:16:09 +0000 (UTC)
commit 0d785119b3b10dbcff271a7c1623b37eb3b540e4
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Sep 13 20:30:25 2015 +0200
encodings combo: use g_object_class_install_properties
gedit/gedit-encodings-combo-box.c | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/gedit/gedit-encodings-combo-box.c b/gedit/gedit-encodings-combo-box.c
index f19c6ed..4bd5ca4 100644
--- a/gedit/gedit-encodings-combo-box.c
+++ b/gedit/gedit-encodings-combo-box.c
@@ -54,9 +54,12 @@ enum
enum
{
PROP_0,
- PROP_SAVE_MODE
+ PROP_SAVE_MODE,
+ LAST_PROP
};
+static GParamSpec *properties[LAST_PROP];
+
G_DEFINE_TYPE (GeditEncodingsComboBox, gedit_encodings_combo_box, GTK_TYPE_COMBO_BOX)
static void update_menu (GeditEncodingsComboBox *combo_box);
@@ -155,15 +158,14 @@ gedit_encodings_combo_box_class_init (GeditEncodingsComboBoxClass *klass)
/* TODO It'd be clearer if "save-mode" is renamed as "mode" with an
* enum: loading, saving. Or something like that.
*/
- g_object_class_install_property (object_class,
- PROP_SAVE_MODE,
- g_param_spec_boolean ("save-mode",
- "Save Mode",
- "Save Mode",
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
+ properties[PROP_SAVE_MODE] =
+ g_param_spec_boolean ("save-mode",
+ "Save Mode",
+ "Save Mode",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT | 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]