[Xfce4-commits] [xfce/xfconf] 24/31: Remove XFCONF_TYPE_G_VALUE_ARRAY collection dbus-glib type as it is no longer required.

noreply at xfce.org noreply at xfce.org
Thu Jun 1 13:33:17 CEST 2017


This is an automated email from the git hooks/post-receive script.

a   l   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfconf.

commit 0546a8519dd5fa9fece07d3c1d5ca42a435ef593
Author: Ali Abdallah <aliovx at gmail.com>
Date:   Mon Apr 25 14:31:59 2016 +0200

    Remove XFCONF_TYPE_G_VALUE_ARRAY collection dbus-glib type as
    it is no longer required.
---
 common/xfconf-common-private.h          |  6 ------
 common/xfconf-gvaluefuncs.c             |  6 +++---
 xfconf-perl/xs/XfconfBinding.xs         |  2 +-
 xfconf-perl/xs/XfconfChannel.xs         |  8 ++++----
 xfconf-query/main.c                     | 10 +++++-----
 xfconf/xfconf-channel.c                 | 10 +++++-----
 xfconfd/xfconf-backend-perchannel-xml.c |  6 +++---
 7 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/common/xfconf-common-private.h b/common/xfconf-common-private.h
index e5cd892..f9c78f8 100644
--- a/common/xfconf-common-private.h
+++ b/common/xfconf-common-private.h
@@ -21,12 +21,6 @@
 #ifndef __XFCONF_COMMON_PRIVATE_H__
 #define __XFCONF_COMMON_PRIVATE_H__
 
-#if 0
-#define XFCONF_TYPE_G_VALUE_ARRAY  (dbus_g_type_get_collection("GPtrArray", G_TYPE_VALUE))
-#endif
-
-#define XFCONF_TYPE_G_VALUE_ARRAY  G_TYPE_PTR_ARRAY
-
 #define I_(string) (g_intern_static_string((string)))
 
 #endif  /* __XFCONF_COMMON_PRIVATE_H__ */
diff --git a/common/xfconf-gvaluefuncs.c b/common/xfconf-gvaluefuncs.c
index 0ceeba9..b801373 100644
--- a/common/xfconf-gvaluefuncs.c
+++ b/common/xfconf-gvaluefuncs.c
@@ -79,7 +79,7 @@ _xfconf_gtype_from_string(const gchar *type)
     else if(!strcmp(type, "bool"))
         return G_TYPE_BOOLEAN;
     else if(!strcmp(type, "array"))
-        return XFCONF_TYPE_G_VALUE_ARRAY;
+        return G_TYPE_PTR_ARRAY;
     else if(!strcmp(type, "uint"))
         return G_TYPE_UINT;
     else if(!strcmp(type, "uchar"))
@@ -129,7 +129,7 @@ _xfconf_string_from_gtype(GType gtype)
                 return "uint16";
             else if(gtype == XFCONF_TYPE_INT16)
                 return "int16";
-            else if(gtype == XFCONF_TYPE_G_VALUE_ARRAY)
+            else if(gtype == G_TYPE_PTR_ARRAY)
                 return "array";
             break;
     }
@@ -243,7 +243,7 @@ _xfconf_gvalue_from_string(GValue *value,
             } else if(XFCONF_TYPE_INT16 == G_VALUE_TYPE(value)) {
                 HANDLE_INT(G_MINSHORT, G_MAXSHORT, xfconf_g_value_set_int16);
                 return TRUE;
-            } else if(XFCONF_TYPE_G_VALUE_ARRAY == G_VALUE_TYPE(value)) {
+            } else if(G_TYPE_PTR_ARRAY == G_VALUE_TYPE(value)) {
                 GPtrArray *arr = g_ptr_array_sized_new(1);
                 g_value_take_boxed(value, arr);
                 return TRUE;
diff --git a/xfconf-perl/xs/XfconfBinding.xs b/xfconf-perl/xs/XfconfBinding.xs
index 4ca8f4c..2a4cff5 100644
--- a/xfconf-perl/xs/XfconfBinding.xs
+++ b/xfconf-perl/xs/XfconfBinding.xs
@@ -40,7 +40,7 @@ xfconf_g_property_bind(channel, xfconf_property, xfconf_property_type, object, o
             GType xfconf_gtype = _xfconf_gtype_from_string(xfconf_property_type);
             if(xfconf_gtype == G_TYPE_INVALID)
                 croak("Xfce4::Xfconf::Binding::bind(): can't determine xfconf property type from \"%s\"", xfconf_property_type);
-            if(xfconf_gtype == G_TYPE_NONE || xfconf_gtype == XFCONF_TYPE_G_VALUE_ARRAY)
+            if(xfconf_gtype == G_TYPE_NONE || xfconf_gtype == G_TYPE_PTR_ARRAY)
                 croak("Xfce4::Xfconf::Binding::bind(): invalid xfconf property type \"%s\" for binding", xfconf_property_type);
             RETVAL = xfconf_g_property_bind(channel, xfconf_property, xfconf_gtype,
                                             object, object_property);
diff --git a/xfconf-perl/xs/XfconfChannel.xs b/xfconf-perl/xs/XfconfChannel.xs
index 12126b0..8bac211 100644
--- a/xfconf-perl/xs/XfconfChannel.xs
+++ b/xfconf-perl/xs/XfconfChannel.xs
@@ -96,7 +96,7 @@ xfconf_channel_get_property(channel, property, default_value=NULL)
     PPCODE:
         if(!xfconf_channel_get_property(channel, property, &val)) {
             XPUSHs((default_value ? default_value : &PL_sv_undef));
-        } else if(G_VALUE_TYPE(&val) == XFCONF_TYPE_G_VALUE_ARRAY) {
+        } else if(G_VALUE_TYPE(&val) == G_TYPE_PTR_ARRAY) {
             GPtrArray *arr = g_value_get_boxed(&val);
             gint i;
 
@@ -149,10 +149,10 @@ _set_property(channel, property, value, arraytypes=NULL)
             case 9:  gtype = G_TYPE_DOUBLE; break;
             case 10: gtype = G_TYPE_BOOLEAN; break;
             case 11: gtype = G_TYPE_STRING; break;
-            case 12: gtype = XFCONF_TYPE_G_VALUE_ARRAY; break;
+            case 12: gtype = G_TYPE_PTR_ARRAY; break;
         }
 
-        if(gtype != XFCONF_TYPE_G_VALUE_ARRAY) {
+        if(gtype != G_TYPE_PTR_ARRAY) {
             g_value_init(&val, gtype);
             gperl_value_from_sv(&val, value);
             RETVAL = xfconf_channel_set_property(channel, property, &val);
@@ -201,7 +201,7 @@ _set_property(channel, property, value, arraytypes=NULL)
                         gtype = G_TYPE_STRING;
                 }
 
-                if(gtype == G_TYPE_NONE || gtype == XFCONF_TYPE_G_VALUE_ARRAY) {
+                if(gtype == G_TYPE_NONE || gtype == G_TYPE_PTR_ARRAY) {
                     xfconf_array_free(arr);
                     croak("Xfce4::Xfconf::Channel::set_array(): value cannot be of type 'empty' or 'array' at index %d", i);
                 }
diff --git a/xfconf-query/main.c b/xfconf-query/main.c
index 4702e63..df8ba43 100644
--- a/xfconf-query/main.c
+++ b/xfconf-query/main.c
@@ -134,7 +134,7 @@ xfconf_query_list_contents (GSList *sorted_contents, GHashTable *channel_content
         {
             property_value = g_hash_table_lookup (channel_contents, li->data);
 
-            if (XFCONF_TYPE_G_VALUE_ARRAY != G_VALUE_TYPE (property_value))
+            if (G_TYPE_PTR_ARRAY != G_VALUE_TYPE (property_value))
             {
                 string = _xfconf_string_from_gvalue (property_value);
             }
@@ -363,7 +363,7 @@ main(int argc, char **argv)
                 return EXIT_FAILURE;
             }
 
-            if(XFCONF_TYPE_G_VALUE_ARRAY != G_VALUE_TYPE(&value))
+            if(G_TYPE_PTR_ARRAY != G_VALUE_TYPE(&value))
             {
                 gchar *str_val = _xfconf_string_from_gvalue(&value);
                 g_print("%s\n", str_val ? str_val : _("(unknown)"));
@@ -439,7 +439,7 @@ main(int argc, char **argv)
                     return EXIT_FAILURE;
                 }
 
-                if(XFCONF_TYPE_G_VALUE_ARRAY == gtype)
+                if(G_TYPE_PTR_ARRAY == gtype)
                 {
                     xfconf_query_printerr(_("A value type must be specified to change an array into a single value"));
                     return EXIT_FAILURE;
@@ -475,7 +475,7 @@ main(int argc, char **argv)
                     for(new_types = 0; type[new_types]; ++new_types)
                         ;
                 }
-                else if(G_VALUE_TYPE(&value) == XFCONF_TYPE_G_VALUE_ARRAY)
+                else if(G_VALUE_TYPE(&value) == G_TYPE_PTR_ARRAY)
                 {
                     arr_old = g_value_get_boxed(&value);
                     new_types = arr_old->len;
@@ -522,7 +522,7 @@ main(int argc, char **argv)
                 if(G_VALUE_TYPE(&value))
                     g_value_unset(&value);
 
-                g_value_init(&value, XFCONF_TYPE_G_VALUE_ARRAY);
+                g_value_init(&value, G_TYPE_PTR_ARRAY);
                 g_value_set_boxed(&value, arr_new);
 
                 if(!xfconf_channel_set_property(channel, property_name, &value))
diff --git a/xfconf/xfconf-channel.c b/xfconf/xfconf-channel.c
index ca02518..726a4f5 100644
--- a/xfconf/xfconf-channel.c
+++ b/xfconf/xfconf-channel.c
@@ -1270,7 +1270,7 @@ xfconf_channel_get_property(XfconfChannel *channel,
         {
             /* caller wants to convert the returned value into a diff type */
 
-            if(G_VALUE_TYPE(&val1) == XFCONF_TYPE_G_VALUE_ARRAY) {
+            if(G_VALUE_TYPE(&val1) == G_TYPE_PTR_ARRAY) {
                 /* we got an array back, so let's convert each item in
                  * the array to the target type */
                 GPtrArray *arr = xfconf_transform_array(g_value_get_boxed(&val1),
@@ -1278,7 +1278,7 @@ xfconf_channel_get_property(XfconfChannel *channel,
 
                 if(arr) {
                     g_value_unset(value);
-                    g_value_init(value, XFCONF_TYPE_G_VALUE_ARRAY);
+                    g_value_init(value, G_TYPE_PTR_ARRAY);
                     g_value_take_boxed(value, arr);
                 } else
                     ret = FALSE;
@@ -1346,11 +1346,11 @@ xfconf_channel_set_property(XfconfChannel *channel,
         val = &tmp_val;
         g_value_init(&tmp_val, G_TYPE_INT);
         g_value_set_int(&tmp_val, xfconf_g_value_get_int16(value));
-    } else if(G_VALUE_TYPE(value) == XFCONF_TYPE_G_VALUE_ARRAY) {
+    } else if(G_VALUE_TYPE(value) == G_TYPE_PTR_ARRAY) {
         arr_new = xfconf_fixup_16bit_ints(g_value_get_boxed(value));
         if(arr_new) {
             val = &tmp_val;
-            g_value_init(&tmp_val, XFCONF_TYPE_G_VALUE_ARRAY);
+            g_value_init(&tmp_val, G_TYPE_PTR_ARRAY);
             g_value_set_boxed(&tmp_val, arr_new);
         } else
             val = (GValue *)value;
@@ -1752,7 +1752,7 @@ xfconf_channel_set_arrayv(XfconfChannel *channel,
 
     values_new = xfconf_fixup_16bit_ints(values);
 
-    g_value_init(&val, XFCONF_TYPE_G_VALUE_ARRAY);
+    g_value_init(&val, G_TYPE_PTR_ARRAY);
     g_value_set_static_boxed(&val, values_new ? values_new : values);
     
     ret = xfconf_channel_set_internal(channel, property, &val);
diff --git a/xfconfd/xfconf-backend-perchannel-xml.c b/xfconfd/xfconf-backend-perchannel-xml.c
index 5264c03..601bd9f 100644
--- a/xfconfd/xfconf-backend-perchannel-xml.c
+++ b/xfconfd/xfconf-backend-perchannel-xml.c
@@ -1316,7 +1316,7 @@ xfconf_xml_handle_property(XmlParserState *state,
             return FALSE;
         }
 
-        if(XFCONF_TYPE_G_VALUE_ARRAY == value_type) {
+        if(G_TYPE_PTR_ARRAY == value_type) {
             /* FIXME: use stacks here */
             state->list_property = g_strdup(fullpath);
             state->list_value = value_to_set;
@@ -1362,7 +1362,7 @@ xfconf_xml_handle_value(XmlParserState *state,
     }
 
     value_type = _xfconf_gtype_from_string(type);
-    if(XFCONF_TYPE_G_VALUE_ARRAY == value_type) {
+    if(G_TYPE_PTR_ARRAY == value_type) {
         if(error) {
             g_set_error(error, G_MARKUP_ERROR,
                         G_MARKUP_ERROR_INVALID_CONTENT,
@@ -1771,7 +1771,7 @@ xfconf_format_xml_tag(GString *elem_str,
                 }
 
                 *is_array = TRUE;
-            } else if(XFCONF_TYPE_G_VALUE_ARRAY == G_VALUE_TYPE(value)) {
+            } else if(G_TYPE_PTR_ARRAY == G_VALUE_TYPE(value)) {
                 GPtrArray *arr;
                 guint i;
                 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list