[dconf] Add dconf_changeset_is_empty()



commit e27f915e9b019dfe82e6d7c1db793a93378875a9
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Oct 23 17:28:57 2012 +0200

    Add dconf_changeset_is_empty()

 common/dconf-changeset.c |   14 ++++++++++++++
 common/dconf-changeset.h |    2 ++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/common/dconf-changeset.c b/common/dconf-changeset.c
index 177f682..a5c98da 100644
--- a/common/dconf-changeset.c
+++ b/common/dconf-changeset.c
@@ -560,3 +560,17 @@ dconf_changeset_new_write (const gchar *path,
 
   return changeset;
 }
+
+/**
+ * dconf_changeset_is_empty:
+ * @changeset: a #DConfChangeset
+ *
+ * Checks if @changeset is empty (ie: contains no changes).
+ *
+ * Returns: %TRUE if @changeset is empty
+ **/
+gboolean
+dconf_changeset_is_empty (DConfChangeset *changeset)
+{
+  return !g_hash_table_size (changeset->table);
+}
diff --git a/common/dconf-changeset.h b/common/dconf-changeset.h
index c2a5435..1aecabe 100644
--- a/common/dconf-changeset.h
+++ b/common/dconf-changeset.h
@@ -38,6 +38,8 @@ DConfChangeset *        dconf_changeset_new_write                       (const g
 DConfChangeset *        dconf_changeset_ref                             (DConfChangeset           *changeset);
 void                    dconf_changeset_unref                           (DConfChangeset           *changeset);
 
+gboolean                dconf_changeset_is_empty                        (DConfChangeset           *changeset);
+
 void                    dconf_changeset_set                             (DConfChangeset           *changeset,
                                                                          const gchar              *path,
                                                                          GVariant                 *value);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]