Logo Search packages:      
Sourcecode: d-conf version File versions  Download package

dconf-dump.c

/* dconf-dump.c generated by valac 0.12.0, the Vala compiler
 * generated from dconf-dump.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <dconf.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <gobject/gvaluecollector.h>

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_key_file_free0(var) ((var == NULL) ? NULL : (var = (g_key_file_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

#define TYPE_DCONF_LOAD_STATE (dconf_load_state_get_type ())
#define DCONF_LOAD_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DCONF_LOAD_STATE, DConfLoadState))
#define DCONF_LOAD_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DCONF_LOAD_STATE, DConfLoadStateClass))
#define IS_DCONF_LOAD_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DCONF_LOAD_STATE))
#define IS_DCONF_LOAD_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DCONF_LOAD_STATE))
#define DCONF_LOAD_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DCONF_LOAD_STATE, DConfLoadStateClass))

typedef struct _DConfLoadState DConfLoadState;
typedef struct _DConfLoadStateClass DConfLoadStateClass;
typedef struct _DConfLoadStatePrivate DConfLoadStatePrivate;
typedef struct _ParamSpecDConfLoadState ParamSpecDConfLoadState;
#define _g_tree_destroy0(var) ((var == NULL) ? NULL : (var = (g_tree_destroy (var), NULL)))
#define _dconf_load_state_unref0(var) ((var == NULL) ? NULL : (var = (dconf_load_state_unref (var), NULL)))

00033 struct _DConfLoadState {
      GTypeInstance parent_instance;
      volatile int ref_count;
      DConfLoadStatePrivate * priv;
      gchar** keys;
      gint keys_length1;
      gint _keys_size_;
      GVariant** vals;
      gint vals_length1;
      gint _vals_size_;
};

00045 struct _DConfLoadStateClass {
      GTypeClass parent_class;
      void (*finalize) (DConfLoadState *self);
};

00050 struct _DConfLoadStatePrivate {
      gint n_keys;
      gint i;
};

00055 struct _ParamSpecDConfLoadState {
      GParamSpec parent_instance;
};


static gpointer dconf_load_state_parent_class = NULL;

void add_to_keyfile (GKeyFile* kf, DConfClient* client, const gchar* topdir, const gchar* rel);
void dconf_dump (gchar** args, int args_length1, GError** error);
GKeyFile* keyfile_from_stdin (GError** error);
gpointer dconf_load_state_ref (gpointer instance);
void dconf_load_state_unref (gpointer instance);
GParamSpec* param_spec_dconf_load_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_dconf_load_state (GValue* value, gpointer v_object);
void value_take_dconf_load_state (GValue* value, gpointer v_object);
gpointer value_get_dconf_load_state (const GValue* value);
GType dconf_load_state_get_type (void) G_GNUC_CONST;
#define DCONF_LOAD_STATE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DCONF_LOAD_STATE, DConfLoadStatePrivate))
enum  {
      DCONF_LOAD_STATE_DUMMY_PROPERTY
};
DConfLoadState* dconf_load_state_new (gint n);
DConfLoadState* dconf_load_state_construct (GType object_type, gint n);
gint dconf_load_state_add (DConfLoadState* self, void* key, void* value);
static void dconf_load_state_finalize (DConfLoadState* obj);
void dconf_load (gchar** args, int args_length1, GError** error);
static gint _dconf_load_state_add_gtraverse_func (void* key, void* value, gpointer self);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static gchar* string_slice (const gchar* self, glong start, glong end) {
      gchar* result = NULL;
      gint _tmp0_;
      glong string_length;
      gboolean _tmp1_ = FALSE;
      gboolean _tmp2_ = FALSE;
      gchar* _tmp3_ = NULL;
      g_return_val_if_fail (self != NULL, NULL);
      _tmp0_ = strlen (self);
      string_length = (glong) _tmp0_;
      if (start < 0) {
            start = string_length + start;
      }
      if (end < 0) {
            end = string_length + end;
      }
      if (start >= 0) {
            _tmp1_ = start <= string_length;
      } else {
            _tmp1_ = FALSE;
      }
      g_return_val_if_fail (_tmp1_, NULL);
      if (end >= 0) {
            _tmp2_ = end <= string_length;
      } else {
            _tmp2_ = FALSE;
      }
      g_return_val_if_fail (_tmp2_, NULL);
      g_return_val_if_fail (start <= end, NULL);
      _tmp3_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
      result = _tmp3_;
      return result;
}


void add_to_keyfile (GKeyFile* kf, DConfClient* client, const gchar* topdir, const gchar* rel) {
      gchar* _tmp0_;
      gchar* this_dir;
      gchar* this_group = NULL;
      gint _tmp3_;
      gchar** _tmp4_ = NULL;
      g_return_if_fail (kf != NULL);
      g_return_if_fail (client != NULL);
      g_return_if_fail (topdir != NULL);
      _tmp0_ = g_strconcat (topdir, rel, NULL);
      this_dir = _tmp0_;
      if (g_strcmp0 (rel, "") != 0) {
            gchar* _tmp1_ = NULL;
            _tmp1_ = string_slice (rel, (glong) 0, (glong) (-1));
            _g_free0 (this_group);
            this_group = _tmp1_;
      } else {
            gchar* _tmp2_;
            _tmp2_ = g_strdup ("/");
            _g_free0 (this_group);
            this_group = _tmp2_;
      }
      _tmp4_ = dconf_client_list (client, this_dir, &_tmp3_);
      {
            gchar** item_collection;
            int item_collection_length1;
            int item_it;
            item_collection = _tmp4_;
            item_collection_length1 = _tmp3_;
            for (item_it = 0; item_it < _tmp3_; item_it = item_it + 1) {
                  gchar* _tmp5_;
                  gchar* item;
                  _tmp5_ = g_strdup (item_collection[item_it]);
                  item = _tmp5_;
                  {
                        gboolean _tmp6_;
                        _tmp6_ = g_str_has_suffix (item, "/");
                        if (_tmp6_) {
                              gchar* _tmp7_;
                              gchar* _tmp8_;
                              _tmp7_ = g_strconcat (rel, item, NULL);
                              _tmp8_ = _tmp7_;
                              add_to_keyfile (kf, client, topdir, _tmp8_);
                              _g_free0 (_tmp8_);
                        } else {
                              gchar* _tmp9_;
                              gchar* _tmp10_;
                              GVariant* _tmp11_ = NULL;
                              GVariant* _tmp12_;
                              GVariant* val;
                              _tmp9_ = g_strconcat (this_dir, item, NULL);
                              _tmp10_ = _tmp9_;
                              _tmp11_ = dconf_client_read (client, _tmp10_);
                              _tmp12_ = _tmp11_;
                              _g_free0 (_tmp10_);
                              val = _tmp12_;
                              if (val != NULL) {
                                    gchar* _tmp13_ = NULL;
                                    gchar* _tmp14_;
                                    _tmp13_ = g_variant_print (val, TRUE);
                                    _tmp14_ = _tmp13_;
                                    g_key_file_set_value (kf, this_group, item, _tmp14_);
                                    _g_free0 (_tmp14_);
                              }
                              _g_variant_unref0 (val);
                        }
                        _g_free0 (item);
                  }
            }
            item_collection = (_vala_array_free (item_collection, item_collection_length1, (GDestroyNotify) g_free), NULL);
      }
      _g_free0 (this_group);
      _g_free0 (this_dir);
}


void dconf_dump (gchar** args, int args_length1, GError** error) {
      DConfClient* _tmp0_ = NULL;
      DConfClient* client;
      GKeyFile* _tmp1_ = NULL;
      GKeyFile* kf;
      gchar* _tmp2_;
      gchar* dir;
      gchar* _tmp3_ = NULL;
      gchar* _tmp4_;
      GError * _inner_error_ = NULL;
      _tmp0_ = dconf_client_new (NULL, NULL, NULL, NULL);
      client = _tmp0_;
      _tmp1_ = g_key_file_new ();
      kf = _tmp1_;
      _tmp2_ = g_strdup (args[2]);
      dir = _tmp2_;
      dconf_is_dir (dir, &_inner_error_);
      if (_inner_error_ != NULL) {
            g_propagate_error (error, _inner_error_);
            _g_free0 (dir);
            _g_key_file_free0 (kf);
            _g_object_unref0 (client);
            return;
      }
      add_to_keyfile (kf, client, dir, "");
      _tmp3_ = g_key_file_to_data (kf, NULL, NULL);
      _tmp4_ = _tmp3_;
      g_print ("%s", _tmp4_);
      _g_free0 (_tmp4_);
      _g_free0 (dir);
      _g_key_file_free0 (kf);
      _g_object_unref0 (client);
}


GKeyFile* keyfile_from_stdin (GError** error) {
      GKeyFile* result = NULL;
      const gchar* tmp = NULL;
      gchar buffer[1024] = {0};
      GString* _tmp0_ = NULL;
      GString* s;
      GKeyFile* _tmp2_ = NULL;
      GKeyFile* kf;
      GError * _inner_error_ = NULL;
      _tmp0_ = g_string_new ("");
      s = _tmp0_;
      while (TRUE) {
            const gchar* _tmp1_ = NULL;
            _tmp1_ = fgets (buffer, 1024, stdin);
            tmp = _tmp1_;
            if (!(tmp != NULL)) {
                  break;
            }
            g_string_append (s, tmp);
      }
      _tmp2_ = g_key_file_new ();
      kf = _tmp2_;
      g_key_file_load_from_data (kf, s->str, (gsize) s->len, 0, &_inner_error_);
      if (_inner_error_ != NULL) {
            g_propagate_error (error, _inner_error_);
            _g_key_file_free0 (kf);
            _g_string_free0 (s);
            return NULL;
      }
      result = kf;
      _g_string_free0 (s);
      return result;
}


DConfLoadState* dconf_load_state_construct (GType object_type, gint n) {
      DConfLoadState* self = NULL;
      gchar** _tmp0_ = NULL;
      GVariant** _tmp1_ = NULL;
      self = (DConfLoadState*) g_type_create_instance (object_type);
      _tmp0_ = g_new0 (gchar*, (n + 1) + 1);
      self->keys = (_vala_array_free (self->keys, self->keys_length1, (GDestroyNotify) g_free), NULL);
      self->keys = _tmp0_;
      self->keys_length1 = n + 1;
      self->_keys_size_ = n + 1;
      _tmp1_ = g_new0 (GVariant*, n + 1);
      self->vals = (_vala_array_free (self->vals, self->vals_length1, (GDestroyNotify) g_variant_unref), NULL);
      self->vals = _tmp1_;
      self->vals_length1 = n;
      self->_vals_size_ = n;
      self->priv->n_keys = n;
      self->priv->i = 0;
      return self;
}


DConfLoadState* dconf_load_state_new (gint n) {
      return dconf_load_state_construct (TYPE_DCONF_LOAD_STATE, n);
}


static gpointer _g_variant_ref0 (gpointer self) {
      return self ? g_variant_ref (self) : NULL;
}


gint dconf_load_state_add (DConfLoadState* self, void* key, void* value) {
      gint result = 0;
      gchar* _tmp0_;
      gchar* _tmp1_;
      GVariant* _tmp2_;
      GVariant* _tmp3_;
      g_return_val_if_fail (self != NULL, 0);
      g_assert (self->priv->i < self->priv->n_keys);
      _tmp0_ = g_strdup ((const gchar*) key);
      _tmp1_ = _tmp0_;
      _g_free0 (self->keys[self->priv->i]);
      self->keys[self->priv->i] = _tmp1_;
      _tmp2_ = _g_variant_ref0 ((GVariant*) value);
      _tmp3_ = _tmp2_;
      _g_variant_unref0 (self->vals[self->priv->i]);
      self->vals[self->priv->i] = _tmp3_;
      self->priv->i++;
      result = (gint) FALSE;
      return result;
}


static void value_dconf_load_state_init (GValue* value) {
      value->data[0].v_pointer = NULL;
}


static void value_dconf_load_state_free_value (GValue* value) {
      if (value->data[0].v_pointer) {
            dconf_load_state_unref (value->data[0].v_pointer);
      }
}


static void value_dconf_load_state_copy_value (const GValue* src_value, GValue* dest_value) {
      if (src_value->data[0].v_pointer) {
            dest_value->data[0].v_pointer = dconf_load_state_ref (src_value->data[0].v_pointer);
      } else {
            dest_value->data[0].v_pointer = NULL;
      }
}


static gpointer value_dconf_load_state_peek_pointer (const GValue* value) {
      return value->data[0].v_pointer;
}


static gchar* value_dconf_load_state_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
      if (collect_values[0].v_pointer) {
            DConfLoadState* object;
            object = collect_values[0].v_pointer;
            if (object->parent_instance.g_class == NULL) {
                  return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
            } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
                  return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
            }
            value->data[0].v_pointer = dconf_load_state_ref (object);
      } else {
            value->data[0].v_pointer = NULL;
      }
      return NULL;
}


static gchar* value_dconf_load_state_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
      DConfLoadState** object_p;
      object_p = collect_values[0].v_pointer;
      if (!object_p) {
            return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
      }
      if (!value->data[0].v_pointer) {
            *object_p = NULL;
      } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
            *object_p = value->data[0].v_pointer;
      } else {
            *object_p = dconf_load_state_ref (value->data[0].v_pointer);
      }
      return NULL;
}


GParamSpec* param_spec_dconf_load_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
      ParamSpecDConfLoadState* spec;
      g_return_val_if_fail (g_type_is_a (object_type, TYPE_DCONF_LOAD_STATE), NULL);
      spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
      G_PARAM_SPEC (spec)->value_type = object_type;
      return G_PARAM_SPEC (spec);
}


gpointer value_get_dconf_load_state (const GValue* value) {
      g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DCONF_LOAD_STATE), NULL);
      return value->data[0].v_pointer;
}


void value_set_dconf_load_state (GValue* value, gpointer v_object) {
      DConfLoadState* old;
      g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DCONF_LOAD_STATE));
      old = value->data[0].v_pointer;
      if (v_object) {
            g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_DCONF_LOAD_STATE));
            g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
            value->data[0].v_pointer = v_object;
            dconf_load_state_ref (value->data[0].v_pointer);
      } else {
            value->data[0].v_pointer = NULL;
      }
      if (old) {
            dconf_load_state_unref (old);
      }
}


void value_take_dconf_load_state (GValue* value, gpointer v_object) {
      DConfLoadState* old;
      g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DCONF_LOAD_STATE));
      old = value->data[0].v_pointer;
      if (v_object) {
            g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_DCONF_LOAD_STATE));
            g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
            value->data[0].v_pointer = v_object;
      } else {
            value->data[0].v_pointer = NULL;
      }
      if (old) {
            dconf_load_state_unref (old);
      }
}


static void dconf_load_state_class_init (DConfLoadStateClass * klass) {
      dconf_load_state_parent_class = g_type_class_peek_parent (klass);
      DCONF_LOAD_STATE_CLASS (klass)->finalize = dconf_load_state_finalize;
      g_type_class_add_private (klass, sizeof (DConfLoadStatePrivate));
}


static void dconf_load_state_instance_init (DConfLoadState * self) {
      self->priv = DCONF_LOAD_STATE_GET_PRIVATE (self);
      self->ref_count = 1;
}


static void dconf_load_state_finalize (DConfLoadState* obj) {
      DConfLoadState * self;
      self = DCONF_LOAD_STATE (obj);
      self->keys = (_vala_array_free (self->keys, self->keys_length1, (GDestroyNotify) g_free), NULL);
      self->vals = (_vala_array_free (self->vals, self->vals_length1, (GDestroyNotify) g_variant_unref), NULL);
}


GType dconf_load_state_get_type (void) {
      static volatile gsize dconf_load_state_type_id__volatile = 0;
      if (g_once_init_enter (&dconf_load_state_type_id__volatile)) {
            static const GTypeValueTable g_define_type_value_table = { value_dconf_load_state_init, value_dconf_load_state_free_value, value_dconf_load_state_copy_value, value_dconf_load_state_peek_pointer, "p", value_dconf_load_state_collect_value, "p", value_dconf_load_state_lcopy_value };
            static const GTypeInfo g_define_type_info = { sizeof (DConfLoadStateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dconf_load_state_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DConfLoadState), 0, (GInstanceInitFunc) dconf_load_state_instance_init, &g_define_type_value_table };
            static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
            GType dconf_load_state_type_id;
            dconf_load_state_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DConfLoadState", &g_define_type_info, &g_define_type_fundamental_info, 0);
            g_once_init_leave (&dconf_load_state_type_id__volatile, dconf_load_state_type_id);
      }
      return dconf_load_state_type_id__volatile;
}


gpointer dconf_load_state_ref (gpointer instance) {
      DConfLoadState* self;
      self = instance;
      g_atomic_int_inc (&self->ref_count);
      return instance;
}


void dconf_load_state_unref (gpointer instance) {
      DConfLoadState* self;
      self = instance;
      if (g_atomic_int_dec_and_test (&self->ref_count)) {
            DCONF_LOAD_STATE_GET_CLASS (self)->finalize (self);
            g_type_free_instance ((GTypeInstance *) self);
      }
}


static gint _dconf_load_state_add_gtraverse_func (void* key, void* value, gpointer self) {
      gint result;
      result = dconf_load_state_add (self, key, value);
      return result;
}


void dconf_load (gchar** args, int args_length1, GError** error) {
      gchar* _tmp0_;
      gchar* dir;
      GTree* _tmp1_ = NULL;
      GTree* tree;
      GKeyFile* _tmp2_ = NULL;
      GKeyFile* kf;
      gsize _tmp3_;
      gchar** _tmp4_ = NULL;
      gint _tmp21_;
      DConfLoadState* _tmp22_ = NULL;
      DConfLoadState* list;
      DConfClient* _tmp23_ = NULL;
      DConfClient* client;
      GError * _inner_error_ = NULL;
      _tmp0_ = g_strdup (args[2]);
      dir = _tmp0_;
      dconf_is_dir (dir, &_inner_error_);
      if (_inner_error_ != NULL) {
            g_propagate_error (error, _inner_error_);
            _g_free0 (dir);
            return;
      }
      _tmp1_ = g_tree_new (g_strcmp0);
      tree = _tmp1_;
      _tmp2_ = keyfile_from_stdin (&_inner_error_);
      kf = _tmp2_;
      if (_inner_error_ != NULL) {
            g_propagate_error (error, _inner_error_);
            _g_tree_destroy0 (tree);
            _g_free0 (dir);
            return;
      }
      _tmp4_ = g_key_file_get_groups (kf, &_tmp3_);
      {
            gchar** group_collection;
            int group_collection_length1;
            int group_it;
            group_collection = _tmp4_;
            group_collection_length1 = _tmp3_;
            for (group_it = 0; group_it < _tmp3_; group_it = group_it + 1) {
                  gchar* _tmp5_;
                  gchar* group;
                  _tmp5_ = g_strdup (group_collection[group_it]);
                  group = _tmp5_;
                  {
                        gsize _tmp6_;
                        gchar** _tmp7_ = NULL;
                        gchar** _tmp8_;
                        gint _tmp8__length1;
                        gint __tmp8__size_;
                        _tmp7_ = g_key_file_get_keys (kf, group, &_tmp6_, &_inner_error_);
                        _tmp8_ = _tmp7_;
                        _tmp8__length1 = _tmp6_;
                        __tmp8__size_ = _tmp6_;
                        if (_inner_error_ != NULL) {
                              g_propagate_error (error, _inner_error_);
                              _g_free0 (group);
                              group_collection = (_vala_array_free (group_collection, group_collection_length1, (GDestroyNotify) g_free), NULL);
                              _g_key_file_free0 (kf);
                              _g_tree_destroy0 (tree);
                              _g_free0 (dir);
                              return;
                        }
                        {
                              gchar** key_collection;
                              int key_collection_length1;
                              int key_it;
                              key_collection = _tmp8_;
                              key_collection_length1 = _tmp8__length1;
                              for (key_it = 0; key_it < _tmp8__length1; key_it = key_it + 1) {
                                    gchar* _tmp9_;
                                    gchar* key;
                                    _tmp9_ = g_strdup (key_collection[key_it]);
                                    key = _tmp9_;
                                    {
                                          gchar* _tmp10_ = NULL;
                                          gchar* _tmp13_;
                                          gchar* rel;
                                          gchar* _tmp14_ = NULL;
                                          gchar* _tmp15_;
                                          gchar* _tmp16_;
                                          GVariant* _tmp17_ = NULL;
                                          GVariant* _tmp18_;
                                          GVariant* _tmp19_;
                                          gchar* _tmp20_;
                                          if (g_strcmp0 (group, "/") == 0) {
                                                gchar* _tmp11_;
                                                _tmp11_ = g_strdup ("");
                                                _g_free0 (_tmp10_);
                                                _tmp10_ = _tmp11_;
                                          } else {
                                                gchar* _tmp12_;
                                                _tmp12_ = g_strconcat (group, "/", NULL);
                                                _g_free0 (_tmp10_);
                                                _tmp10_ = _tmp12_;
                                          }
                                          _tmp13_ = g_strconcat (_tmp10_, key, NULL);
                                          rel = _tmp13_;
                                          dconf_is_rel_key (rel, &_inner_error_);
                                          if (_inner_error_ != NULL) {
                                                g_propagate_error (error, _inner_error_);
                                                _g_free0 (rel);
                                                _g_free0 (_tmp10_);
                                                _g_free0 (key);
                                                key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
                                                _g_free0 (group);
                                                group_collection = (_vala_array_free (group_collection, group_collection_length1, (GDestroyNotify) g_free), NULL);
                                                _g_key_file_free0 (kf);
                                                _g_tree_destroy0 (tree);
                                                _g_free0 (dir);
                                                return;
                                          }
                                          _tmp14_ = g_key_file_get_value (kf, group, key, &_inner_error_);
                                          _tmp15_ = _tmp14_;
                                          if (_inner_error_ != NULL) {
                                                g_propagate_error (error, _inner_error_);
                                                _g_free0 (rel);
                                                _g_free0 (_tmp10_);
                                                _g_free0 (key);
                                                key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
                                                _g_free0 (group);
                                                group_collection = (_vala_array_free (group_collection, group_collection_length1, (GDestroyNotify) g_free), NULL);
                                                _g_key_file_free0 (kf);
                                                _g_tree_destroy0 (tree);
                                                _g_free0 (dir);
                                                return;
                                          }
                                          _tmp16_ = _tmp15_;
                                          _tmp17_ = g_variant_parse (NULL, _tmp16_, NULL, NULL, &_inner_error_);
                                          _tmp18_ = _tmp17_;
                                          _g_free0 (_tmp16_);
                                          _tmp19_ = _tmp18_;
                                          if (_inner_error_ != NULL) {
                                                g_propagate_error (error, _inner_error_);
                                                _g_free0 (rel);
                                                _g_free0 (_tmp10_);
                                                _g_free0 (key);
                                                key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
                                                _g_free0 (group);
                                                group_collection = (_vala_array_free (group_collection, group_collection_length1, (GDestroyNotify) g_free), NULL);
                                                _g_key_file_free0 (kf);
                                                _g_tree_destroy0 (tree);
                                                _g_free0 (dir);
                                                return;
                                          }
                                          _tmp20_ = g_strdup (rel);
                                          g_tree_insert (tree, _tmp20_, _tmp19_);
                                          _g_free0 (rel);
                                          _g_free0 (_tmp10_);
                                          _g_free0 (key);
                                    }
                              }
                              key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
                        }
                        _g_free0 (group);
                  }
            }
            group_collection = (_vala_array_free (group_collection, group_collection_length1, (GDestroyNotify) g_free), NULL);
      }
      _tmp21_ = g_tree_nnodes (tree);
      _tmp22_ = dconf_load_state_new (_tmp21_);
      list = _tmp22_;
      g_tree_foreach (tree, _dconf_load_state_add_gtraverse_func, list);
      _tmp23_ = dconf_client_new (NULL, NULL, NULL, NULL);
      client = _tmp23_;
      dconf_client_write_many (client, dir, list->keys, list->vals, list->vals_length1, NULL, NULL, &_inner_error_);
      if (_inner_error_ != NULL) {
            g_propagate_error (error, _inner_error_);
            _g_object_unref0 (client);
            _dconf_load_state_unref0 (list);
            _g_key_file_free0 (kf);
            _g_tree_destroy0 (tree);
            _g_free0 (dir);
            return;
      }
      _g_object_unref0 (client);
      _dconf_load_state_unref0 (list);
      _g_key_file_free0 (kf);
      _g_tree_destroy0 (tree);
      _g_free0 (dir);
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
      if ((array != NULL) && (destroy_func != NULL)) {
            int i;
            for (i = 0; i < array_length; i = i + 1) {
                  if (((gpointer*) array)[i] != NULL) {
                        destroy_func (((gpointer*) array)[i]);
                  }
            }
      }
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
      _vala_array_destroy (array, array_length, destroy_func);
      g_free (array);
}




Generated by  Doxygen 1.6.0   Back to index