/soc/2013/ankitkv/gobjectification: 5fd94b14cc49: libgnt: Use G_...

Ankit Vani a at nevitus.org
Sat Nov 16 16:40:29 EST 2013


Changeset: 5fd94b14cc49f65d724e10dbb277ded2e518c497
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-11-17 02:06 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/5fd94b14cc49

Description:

libgnt: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called

diffstat:

 finch/gntmedia.c        |  2 +-
 finch/libgnt/gntbox.c   |  9 ++++-----
 finch/libgnt/gntlabel.c |  4 ++--
 finch/libgnt/gntline.c  |  2 +-
 finch/libgnt/gnttree.c  |  5 ++---
 5 files changed, 10 insertions(+), 12 deletions(-)

diffs (109 lines):

diff --git a/finch/gntmedia.c b/finch/gntmedia.c
--- a/finch/gntmedia.c
+++ b/finch/gntmedia.c
@@ -140,7 +140,7 @@ finch_media_class_init (FinchMediaClass 
 			"PurpleMedia",
 			"The PurpleMedia associated with this media.",
 			PURPLE_TYPE_MEDIA,
-			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+			G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
 
 	finch_media_signals[MESSAGE] = g_signal_new("message", G_TYPE_FROM_CLASS(klass),
 					G_SIGNAL_RUN_LAST, 0, NULL, NULL,
diff --git a/finch/libgnt/gntbox.c b/finch/libgnt/gntbox.c
--- a/finch/libgnt/gntbox.c
+++ b/finch/libgnt/gntbox.c
@@ -592,7 +592,7 @@ gnt_box_class_init(GntBoxClass *klass)
 			g_param_spec_boolean("vertical", "Vertical",
 				"Whether the child widgets in the box should be stacked vertically.",
 				TRUE,
-				G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
+				G_PARAM_READWRITE|G_PARAM_CONSTRUCT|G_PARAM_STATIC_STRINGS
 			)
 		);
 	g_object_class_install_property(gclass,
@@ -600,7 +600,7 @@ gnt_box_class_init(GntBoxClass *klass)
 			g_param_spec_boolean("homogeneous", "Homogeneous",
 				"Whether the child widgets in the box should have the same size.",
 				TRUE,
-				G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
+				G_PARAM_READWRITE|G_PARAM_CONSTRUCT|G_PARAM_STATIC_STRINGS
 			)
 		);
 
@@ -662,11 +662,10 @@ gnt_box_get_gtype(void)
 
 GntWidget *gnt_box_new(gboolean homo, gboolean vert)
 {
-	GntWidget *widget = g_object_new(GNT_TYPE_BOX, NULL);
+	GntWidget *widget = g_object_new(GNT_TYPE_BOX, "homogeneous", homo,
+			"vertical", vert, NULL);
 	GntBox *box = GNT_BOX(widget);
 
-	box->homogeneous = homo;
-	box->vertical = vert;
 	box->alignment = vert ? GNT_ALIGN_LEFT : GNT_ALIGN_MID;
 
 	return widget;
diff --git a/finch/libgnt/gntlabel.c b/finch/libgnt/gntlabel.c
--- a/finch/libgnt/gntlabel.c
+++ b/finch/libgnt/gntlabel.c
@@ -123,7 +123,7 @@ gnt_label_class_init(GntLabelClass *klas
 			g_param_spec_string("text", "Text",
 				"The text for the label.",
 				NULL,
-				G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
+				G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS
 			)
 		);
 
@@ -135,7 +135,7 @@ gnt_label_class_init(GntLabelClass *klas
 				GNT_TEXT_FLAG_NORMAL|GNT_TEXT_FLAG_BOLD|GNT_TEXT_FLAG_UNDERLINE|
 				GNT_TEXT_FLAG_BLINK|GNT_TEXT_FLAG_DIM|GNT_TEXT_FLAG_HIGHLIGHT,
 				GNT_TEXT_FLAG_NORMAL,
-				G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
+				G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS
 			)
 		);
 	GNTDEBUG;
diff --git a/finch/libgnt/gntline.c b/finch/libgnt/gntline.c
--- a/finch/libgnt/gntline.c
+++ b/finch/libgnt/gntline.c
@@ -120,7 +120,7 @@ gnt_line_class_init(GntLineClass *klass)
 			g_param_spec_boolean("vertical", "Vertical",
 				"Whether it's a vertical line or a horizontal one.",
 				TRUE,
-				G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
+				G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS
 			)
 		);
 }
diff --git a/finch/libgnt/gnttree.c b/finch/libgnt/gnttree.c
--- a/finch/libgnt/gnttree.c
+++ b/finch/libgnt/gnttree.c
@@ -1009,7 +1009,6 @@ gnt_tree_set_property(GObject *obj, guin
 			if (tree->priv->expander_level == g_value_get_int(value))
 				break;
 			tree->priv->expander_level = g_value_get_int(value);
-			g_object_notify(obj, "expander-level");
 		default:
 			break;
 	}
@@ -1054,7 +1053,7 @@ gnt_tree_class_init(GntTreeClass *klass)
 			g_param_spec_int("columns", "Columns",
 				"Number of columns in the tree.",
 				1, G_MAXINT, 1,
-				G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
+				G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS
 			)
 		);
 	g_object_class_install_property(gclass,
@@ -1062,7 +1061,7 @@ gnt_tree_class_init(GntTreeClass *klass)
 			g_param_spec_int("expander-level", "Expander level",
 				"Number of levels to show expander in the tree.",
 				0, G_MAXINT, 1,
-				G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
+				G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS
 			)
 		);
 



More information about the Commits mailing list