← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~agateau/dbusmenu/dbus-compliant-names into lp:dbusmenu

 

Aurélien Gâteau has proposed merging lp:~agateau/dbusmenu/dbus-compliant-names into lp:dbusmenu.

Requested reviews:
  Ted Gould (ted)

For more details, see:
https://code.launchpad.net/~agateau/dbusmenu/dbus-compliant-names/+merge/51878

Rename dbus properties to follow dbus naming conventions. Hopefully I didn't mess up the code with my search-and-replace. At least it still builds.
-- 
https://code.launchpad.net/~agateau/dbusmenu/dbus-compliant-names/+merge/51878
Your team ayatana-commits is subscribed to branch lp:dbusmenu.
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c	2011-02-24 14:33:38 +0000
+++ libdbusmenu-glib/client.c	2011-03-02 11:11:22 +0000
@@ -1026,7 +1026,7 @@
 	}
 
 	/* Check the text direction if available */
-	GVariant * textdir = g_dbus_proxy_get_cached_property(priv->menuproxy, "text-direction");
+	GVariant * textdir = g_dbus_proxy_get_cached_property(priv->menuproxy, "TextDirection");
 	if (textdir != NULL) {
 		GVariant * str = textdir;
 		if (g_variant_is_of_type(str, G_VARIANT_TYPE_VARIANT)) {
@@ -1069,10 +1069,10 @@
 	gchar * invalid;
 	gint i = 0;
 	for (invalid = invalidated[i]; invalid != NULL; invalid = invalidated[++i]) {
-		if (g_strcmp0(invalid, "text-direction") == 0) {
+		if (g_strcmp0(invalid, "TextDirection") == 0) {
 			priv->text_direction = DBUSMENU_TEXT_DIRECTION_NONE;
 		}
-		if (g_strcmp0(invalid, "status") == 0) {
+		if (g_strcmp0(invalid, "Status") == 0) {
 			priv->status = DBUSMENU_STATUS_NORMAL;
 		}
 	}
@@ -1082,7 +1082,7 @@
 	gchar * key; GVariant * value;
 	g_variant_iter_init(&iters, properties);
 	while (g_variant_iter_next(&iters, "{sv}", &key, &value)) {
-		if (g_strcmp0(key, "text-direction") == 0) {
+		if (g_strcmp0(key, "TextDirection") == 0) {
 			GVariant * str = value;
 			if (g_variant_is_of_type(str, G_VARIANT_TYPE_VARIANT)) {
 				str = g_variant_get_variant(str);
@@ -1090,7 +1090,7 @@
 
 			priv->text_direction = dbusmenu_text_direction_get_value_from_nick(g_variant_get_string(str, NULL));
 		}
-		if (g_strcmp0(key, "status") == 0) {
+		if (g_strcmp0(key, "Status") == 0) {
 			GVariant * str = value;
 			if (g_variant_is_of_type(str, G_VARIANT_TYPE_VARIANT)) {
 				str = g_variant_get_variant(str);

=== modified file 'libdbusmenu-glib/dbus-menu.xml'
--- libdbusmenu-glib/dbus-menu.xml	2011-03-01 17:49:47 +0000
+++ libdbusmenu-glib/dbus-menu.xml	2011-03-02 11:11:22 +0000
@@ -164,14 +164,14 @@
 		]]></dox:d>
 
 <!-- Properties -->
-		<property name="version" type="u" access="read">
+		<property name="Version" type="u" access="read">
 			<dox:d>
 			Provides the version of the DBusmenu API that this API is
 			implementing.
 			</dox:d>
 		</property>
 
-		<property name="text-direction" type="s" access="read">
+		<property name="TextDirection" type="s" access="read">
 			<dox:d>
 			Represents the way the text direction of the application.  This
 			allows the server to handle mismatches intelligently.  For left-
@@ -179,7 +179,7 @@
 			</dox:d>
 		</property>
 
-		<property name="status" type="s" access="read">
+		<property name="Status" type="s" access="read">
 			<dox:d>
 			Tells if the menus are in a normal state or they believe that they
 			could use some attention.  Cases for showing them would be if help

=== modified file 'libdbusmenu-glib/server.c'
--- libdbusmenu-glib/server.c	2011-03-01 17:16:56 +0000
+++ libdbusmenu-glib/server.c	2011-03-02 11:11:22 +0000
@@ -501,7 +501,7 @@
 			GVariantBuilder params;
 			g_variant_builder_init(&params, G_VARIANT_TYPE_ARRAY);
 			g_variant_builder_add_value(&params, g_variant_new_string(DBUSMENU_INTERFACE));
-			GVariant * dict = g_variant_new_dict_entry(g_variant_new_string("text-direction"), g_variant_new_string(dbusmenu_text_direction_get_nick(priv->text_direction)));
+			GVariant * dict = g_variant_new_dict_entry(g_variant_new_string("TextDirection"), g_variant_new_string(dbusmenu_text_direction_get_nick(priv->text_direction)));
 			g_variant_builder_add_value(&params, g_variant_new_array(NULL, &dict, 1));
 			g_variant_builder_add_value(&params, g_variant_new_array(G_VARIANT_TYPE_STRING, NULL, 0));
 			GVariant * vparams = g_variant_builder_end(&params);
@@ -525,7 +525,7 @@
 			GVariantBuilder params;
 			g_variant_builder_init(&params, G_VARIANT_TYPE_ARRAY);
 			g_variant_builder_add_value(&params, g_variant_new_string(DBUSMENU_INTERFACE));
-			GVariant * dict = g_variant_new_dict_entry(g_variant_new_string("status"), g_variant_new_string(dbusmenu_status_get_nick(instatus)));
+			GVariant * dict = g_variant_new_dict_entry(g_variant_new_string("Status"), g_variant_new_string(dbusmenu_status_get_nick(instatus)));
 			g_variant_builder_add_value(&params, g_variant_new_array(NULL, &dict, 1));
 			g_variant_builder_add_value(&params, g_variant_new_array(G_VARIANT_TYPE_STRING, NULL, 0));
 			GVariant * vparams = g_variant_builder_end(&params);
@@ -740,11 +740,11 @@
 	g_return_val_if_fail(g_strcmp0(interface, DBUSMENU_INTERFACE) == 0, NULL);
 	g_return_val_if_fail(g_strcmp0(path, priv->dbusobject) == 0, NULL);
 
-	if (g_strcmp0(property, "version") == 0) {
+	if (g_strcmp0(property, "Version") == 0) {
 		return g_variant_new_uint32(DBUSMENU_VERSION_NUMBER);
-	} else if (g_strcmp0(property, "text-direction") == 0) {
+	} else if (g_strcmp0(property, "TextDirection") == 0) {
 		return g_variant_new_string(dbusmenu_text_direction_get_nick(priv->text_direction));
-	} else if (g_strcmp0(property, "status") == 0) {
+	} else if (g_strcmp0(property, "Status") == 0) {
 		return g_variant_new_string(dbusmenu_status_get_nick(priv->status));
 	} else {
 		g_warning("Unknown property '%s'", property);


Follow ups