[glib/wip/gsettings-list: 297/297] Merge from master
- From: Rodrigo Moya <rodrigo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gsettings-list: 297/297] Merge from master
- Date: Tue, 16 Nov 2010 13:09:42 +0000 (UTC)
commit 247b37620ca4b573fa2753b1b9a8379024e52f6b
Merge: 7b7667c 010913c
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Tue Nov 16 14:08:50 2010 +0100
Merge from master
INSTALL.in | 2 +-
NEWS | 277 +++
autogen.sh | 2 +-
build/win32/vs9/README.txt | 20 +-
build/win32/vs9/gio.vcprojin | 7 +
build/win32/vs9/glib.sln | 85 +
build/win32/vs9/glib.vcprojin | 314 +++-
build/win32/vs9/glib.vsprops | 30 +-
build/win32/vs9/gmodule.vcproj | 4 +-
configure.ac | 16 +-
docs/reference/gio/Makefile.am | 2 +
docs/reference/gio/gio-docs.xml | 5 +
docs/reference/gio/gio-sections.txt | 141 +-
docs/reference/gio/gio.types | 2 +-
docs/reference/gio/migrating-gconf.xml | 64 +
docs/reference/glib/glib-docs.sgml | 1 +
docs/reference/glib/glib-sections.txt | 114 +-
docs/reference/glib/tmpl/.gitignore | 2 +
docs/reference/glib/tmpl/date.sgml | 19 +-
docs/reference/glib/tmpl/glib-unused.sgml | 40 -
docs/reference/glib/tmpl/macros_misc.sgml | 6 +
docs/reference/glib/tmpl/messages.sgml | 27 +-
docs/reference/glib/tmpl/version.sgml | 41 +
docs/reference/gobject/Makefile.am | 2 +-
docs/reference/gobject/gobject-sections.txt | 3 +
docs/reference/gobject/tut_gobject.xml | 28 +-
docs/reference/gobject/tut_gsignal.xml | 12 +-
docs/reference/gobject/tut_gtype.xml | 66 +-
docs/reference/gobject/tut_howto.xml | 20 +-
docs/reference/gobject/tut_tools.xml | 6 +-
gio/Makefile.am | 16 +-
gio/gaction.c | 30 +-
gio/gaction.h | 2 +-
gio/gactiongroup.c | 101 +-
gio/gactiongroup.h | 80 +-
gio/gappinfo.c | 19 +-
gio/gapplication.c | 2100 +++++++++--------
gio/gapplication.h | 178 +-
gio/gapplicationcommandline.c | 542 ++++
gio/gapplicationcommandline.h | 118 +
gio/gapplicationimpl-dbus.c | 1030 ++++++++
gio/gapplicationimpl.h | 54 +
gio/gasyncinitable.c | 7 +-
gio/gasyncresult.c | 4 +-
gio/gbufferedinputstream.c | 35 +-
gio/gbufferedoutputstream.c | 5 +-
gio/gcancellable.c | 2 +-
gio/gcontenttype.c | 6 +-
gio/gconverterinputstream.c | 2 +-
gio/gconverteroutputstream.c | 2 +-
gio/gcredentials.c | 2 +-
gio/gdatainputstream.c | 262 ++-
gio/gdatainputstream.h | 66 +-
gio/gdbusaddress.c | 9 +-
gio/gdbusapplication.c | 424 ----
gio/gdbusauth.c | 4 +-
gio/gdbusconnection.c | 258 ++-
gio/gdbuserror.c | 2 +-
gio/gdbusmessage.c | 14 +-
gio/gdbusmethodinvocation.c | 6 +-
gio/gdbusprivate.c | 26 +-
gio/gdbusproxy.c | 21 +-
gio/gdelayedsettingsbackend.c | 16 +-
gio/gdesktopappinfo.c | 63 +-
gio/gdesktopappinfo.h | 4 +
gio/gdrive.c | 4 +-
gio/gdummyproxyresolver.c | 3 +-
gio/gemblem.c | 2 +-
gio/gemblemedicon.c | 15 +-
gio/gfile.c | 169 +-
gio/gfileenumerator.c | 11 +-
gio/gfileicon.c | 7 +-
gio/gfileinfo.c | 4 +-
gio/gfileinputstream.c | 12 +-
gio/gfileiostream.c | 7 +-
gio/gfileoutputstream.c | 12 +-
gio/gicon.c | 4 +-
gio/ginetsocketaddress.c | 2 +-
gio/ginitable.c | 6 +-
gio/ginputstream.c | 35 +-
gio/gio-marshal.list | 5 +-
gio/gio.h | 2 +
gio/gio.symbols | 84 +-
gio/gioenums.h | 35 +-
gio/giomodule.c | 18 +-
gio/giomodule.h | 2 +-
gio/giostream.c | 8 +-
gio/giotypes.h | 2 +
gio/gkeyfilesettingsbackend.c | 2 +-
gio/glib-compile-schemas.c | 232 ++-
gio/gloadableicon.c | 7 +-
gio/glocalfileinfo.c | 14 +-
gio/gmemoryoutputstream.c | 2 +-
gio/gmount.c | 16 +-
gio/gnetworkaddress.c | 11 +-
gio/gnetworkservice.c | 66 +-
gio/gnullapplication.c | 74 -
gio/goutputstream.c | 52 +-
gio/gperiodic.c | 744 ++++++
gio/gperiodic.h | 88 +
gio/gproxy.c | 4 +-
gio/gproxyaddressenumerator.c | 17 +-
gio/gproxyresolver.c | 6 +-
gio/gregistrysettingsbackend.c | 21 +-
gio/gresolver.c | 24 +-
gio/gschema.dtd | 18 +-
gio/gseekable.c | 3 +-
gio/gsettings-bash-completion.sh | 76 +-
gio/gsettings-tool.c | 1153 ++++-----
gio/gsettings.c | 385 +++-
gio/gsettings.h | 11 +-
gio/gsettingsbackend.c | 93 +-
gio/gsettingsbackendinternal.h | 2 -
gio/gsettingsschema.c | 144 +-
gio/gsimpleaction.c | 20 +-
gio/gsimpleactiongroup.c | 24 +-
gio/gsimpleasyncresult.c | 100 +-
gio/gsimpleasyncresult.h | 12 +-
gio/gsocket.c | 74 +-
gio/gsocketaddressenumerator.c | 10 +-
gio/gsocketclient.c | 27 +-
gio/gsocketconnectable.c | 4 +-
gio/gsocketconnection.c | 9 +-
gio/gsocketcontrolmessage.c | 17 +-
gio/gsocketinputstream.c | 5 +-
gio/gsocketlistener.c | 14 +-
gio/gsocketoutputstream.c | 5 +-
gio/gsocks4aproxy.c | 8 +-
gio/gsocks5proxy.c | 5 +-
gio/gsrvtarget.c | 4 +-
gio/gtcpconnection.c | 11 +-
gio/gthemedicon.c | 8 +-
gio/gunionvolumemonitor.c | 4 +-
gio/gunixconnection.c | 2 +-
gio/gunixcredentialsmessage.c | 2 +-
gio/gunixfdmessage.c | 2 +-
gio/gunixinputstream.c | 10 +-
gio/gunixmount.c | 3 +-
gio/gunixmounts.c | 10 +-
gio/gunixoutputstream.c | 12 +-
gio/gunixresolver.c | 18 +-
gio/gunixvolume.c | 3 +-
gio/gvdb/gvdb-reader.c | 75 +-
gio/gvdb/gvdb-reader.h | 6 +
gio/gvfs.c | 12 +-
gio/gvolume.c | 8 +-
gio/gvolumemonitor.c | 4 +-
gio/strinfo.c | 35 +-
gio/tests/.gitignore | 12 +-
gio/tests/Makefile.am | 43 +-
gio/tests/actions.c | 28 +-
gio/tests/application.c | 222 --
gio/tests/data-input-stream.c | 61 +-
gio/tests/gapplication-example-actions.c | 92 +
gio/tests/gapplication-example-cmdline.c | 43 +
gio/tests/gapplication-example-cmdline2.c | 103 +
gio/tests/gapplication-example-open.c | 56 +
gio/tests/gapplication.c | 233 ++
gio/tests/gdbus-connection-slow.c | 214 ++
gio/tests/gdbus-connection.c | 229 +--
gio/tests/gdbus-names.c | 1 +
gio/tests/gdbus-peer.c | 3 +-
gio/tests/gdbus-sessionbus.c | 4 +-
gio/tests/gdbus-tests.c | 56 +-
gio/tests/gschema-compile.c | 1 +
gio/tests/gsettings.c | 74 +-
gio/tests/socket.c | 86 +
gio/tests/testapp.c | 107 -
gio/tests/testapps.c | 604 -----
gio/tests/volumemonitor.c | 6 +-
glib/Makefile.am | 4 +-
glib/gdataset.c | 6 +-
glib/gdatetime.c | 2668 +++++++++++----------
glib/gdatetime.h | 250 ++-
glib/gdir.c | 16 +-
glib/giochannel.c | 2 +-
glib/glib.h | 1 +
glib/glib.symbols | 60 +-
glib/glist.c | 21 +-
glib/glist.h | 2 +
glib/gmain.c | 481 +++--
glib/gmain.h | 16 +-
glib/gmarkup.c | 2 +-
glib/gmarkup.h | 2 +-
glib/gmessages.c | 18 +-
glib/goption.c | 4 +-
glib/gpoll.c | 1 +
glib/gregex.c | 4 +
glib/gscanner.c | 8 +-
glib/gslist.c | 18 +
glib/gslist.h | 2 +
glib/gtimer.c | 75 +-
glib/gtimezone.c | 790 ++++++
glib/gtimezone.h | 81 +
glib/gtypes.h | 1 +
glib/gutils.c | 137 +-
glib/gutils.h | 3 +
glib/gvariant-core.c | 95 +-
glib/gvariant-serialiser.c | 3 +
glib/gvariant.c | 188 ++-
glib/gvariant.h | 7 +
glib/tests/.gitignore | 1 +
glib/tests/Makefile.am | 3 +
glib/tests/environment.c | 51 +
glib/tests/gdatetime.c | 552 +++--
glib/tests/gvariant.c | 95 +-
glib/tests/list.c | 63 +
gobject/gobject.c | 205 ++-
gobject/gobject.h | 18 +
gobject/gobject.symbols | 3 +
gobject/gsignal.c | 35 +-
gobject/gsignal.h | 5 +
gobject/gtypemodule.c | 4 +-
gobject/gvaluetypes.c | 19 +
gobject/tests/.gitignore | 2 +
gobject/tests/Makefile.am | 5 +-
gobject/tests/properties.c | 222 ++
gobject/tests/reference.c | 35 +
m4macros/glib-2.0.m4 | 8 +-
m4macros/gsettings.m4 | 24 +-
po/LINGUAS | 1 +
po/POTFILES.in | 3 +-
po/ar.po | 74 +-
po/be.po | 3376 ++++++++++++++++----------
po/bg.po | 2435 ++++++++++++-------
po/ca valencia po | 2095 +++++++++++------
po/cs.po | 2426 ++++++++++++-------
po/da.po | 1305 ++++++----
po/de.po | 1021 ++++----
po/el.po | 2439 +++++++++++++------
po/en_GB.po | 1237 +++++-----
po/es.po | 1694 ++++++++------
po/et.po | 1197 ++++-----
po/eu.po | 1435 ++++++------
po/fi.po | 1999 ++++++++++-----
po/fr.po | 1752 +++++++++-----
po/gl.po | 1709 ++++++++------
po/he.po | 1587 +++++++------
po/hu.po | 1250 +++++-----
po/id.po | 1463 ++++++------
po/it.po | 2353 ++++++++++++------
po/ja.po | 884 ++++----
po/lt.po | 2433 ++++++++++++-------
po/nb.po | 74 +-
po/nl.po | 2275 +++++++++++-------
po/pa.po | 1580 +++++++-----
po/pl.po | 1274 +++++-----
po/pt.po | 844 ++++----
po/pt_BR.po | 2487 ++++++++++++-------
po/ro.po | 2508 +++++++++++++++----
po/sl.po | 2913 ++++++++++++++---------
po/sr.po | 74 +-
po/sr latin po | 74 +-
po/sv.po | 774 +++---
po/ug.po | 3522 +++++++++++++++++++++++++++
po/zh_CN.po | 1709 ++++++++-----
po/zh_HK.po | 74 +-
po/zh_TW.po | 74 +-
tests/testglib.c | 3 +-
259 files changed, 48730 insertions(+), 27436 deletions(-)
---
diff --cc gio/gio.symbols
index ad700e9,90ea290..7900ae8
--- a/gio/gio.symbols
+++ b/gio/gio.symbols
@@@ -1558,11 -1583,8 +1583,13 @@@ g_settings_syn
g_settings_list_keys
g_settings_list_children
g_settings_get_mapped
+g_settings_add_child
+g_settings_can_add_child
+g_settings_can_remove_child
+g_settings_remove_child
+g_settings_get_destroyed
+ g_settings_get_range
+ g_settings_range_check
#endif
#endif
diff --cc gio/gsettings.c
index ffa0189,aa4a7bf..a07bb85
--- a/gio/gsettings.c
+++ b/gio/gsettings.c
@@@ -2652,219 -2911,6 +2916,130 @@@ g_settings_unbind (gpointer object
g_object_set_qdata (object, binding_quark, NULL);
}
+/* Children (add, remove, can_{add,remove}, list, get_destroyed) {{{1 */
+
+/**
+ * g_settings_add_child:
+ * @settings: a list #GSettings
+ * @prefix: the prefix of the new child name
+ * @name: return location for the new child name
+ * @returns: %TRUE if the child was added
+ *
+ * Adds a child to a list.
+ *
+ * The child will be created with a new unique name that starts with
+ * @prefix. For example, if @prefix is "item" then the child's name may
+ * end up looking like "item0", "item1", or so on. No particular format
+ * is specified -- only that the resulting name will have the given
+ * prefix.
+ *
+ * If the creation was successful then @name (if non-%NULL) is set to
+ * the name of the new child and %TRUE is returned.
+ *
+ * If the creation fails then %FALSE is returned and @name is untouched.
+ **/
+gboolean
+g_settings_add_child (GSettings *settings,
+ const gchar *prefix,
+ gchar **name)
+{
+ g_return_val_if_fail (G_IS_SETTINGS (settings), FALSE);
+ g_return_val_if_fail (prefix != NULL, FALSE);
+
+ return g_settings_backend_insert (settings->priv->backend,
+ settings->priv->path,
+ -1, prefix, name);
+}
+
+/**
+ * g_settings_remove_child:
+ * @settings: a list #GSettings
+ * @id: the id of the child to remove
+ * @returns: %TRUE if the child was successfully removed
+ *
+ * Removes a child from the list.
+ *
+ * In the case that the removal was successful then %TRUE is returned.
+ * In the case that it failed, %FALSE is returned.
+ *
+ * The return value of this function is not particularly useful, since
+ * it is not specified if the non-operation resulting from the request
+ * to remove a non-existent child is considered to be a success (and
+ * this situation can easily arise as a race condition). Most usually
+ * you will actually probably want to ignore the return value here and
+ * just monitor the "children-changed" signal and make changes to your
+ * user interface accordingly.
+ **/
+gboolean
+g_settings_remove_child (GSettings *settings,
+ const gchar *id)
+{
+ g_return_val_if_fail (G_IS_SETTINGS (settings), FALSE);
+ g_return_val_if_fail (id != NULL, FALSE);
+
+ return g_settings_backend_remove (settings->priv->backend,
+ settings->priv->path,
+ id);
+}
+
+/**
+ * g_settings_can_add_child:
+ * @settings: a #GSettings object
+ * @returns: %TRUE if a call to g_settings_add_child() would succeed
+ *
+ * Checks if it is valid to add children to @settings.
+ **/
+gboolean
+g_settings_can_add_child (GSettings *settings)
+{
+ g_return_val_if_fail (G_IS_SETTINGS (settings), FALSE);
+
+ return g_settings_backend_can_insert (settings->priv->backend,
+ settings->priv->path);
+}
+
+/**
+ * g_settings_can_remove_child:
+ * @settings: a #GSettings object
+ * @id: the identifier of an existing child
+ * @returns: %TRUE if a call to g_settings_remove_child() would succeed
+ *
+ * Checks if it is valid to remove @id from @settings.
+ *
+ * The return value of this function is unspecified for the case that
+ * @id does not exist.
+ **/
+gboolean
+g_settings_can_remove_child (GSettings *settings,
+ const gchar *id)
+{
+ g_return_val_if_fail (G_IS_SETTINGS (settings), FALSE);
+
+ return g_settings_backend_can_remove (settings->priv->backend,
+ settings->priv->path, id);
+}
+
+/**
+ * g_settings_get_destroyed:
+ * @settings: a #GSettings
+ * @returns: %TRUE if @settings has been destroyed
+ *
+ * Checks if @settings has been destroyed.
+ *
+ * If @settings is a member of a list (or a child thereof) and has since
+ * been removed from the list then it will be considered as having been
+ * destroyed. The "notify" signal will be emitted on the "destroyed"
+ * property and this function will return %TRUE thereafter.
+ *
+ * A destroyed #GSettings object is never revived and nearly all
+ * operations performed on it will be meaningless.
+ **/
+gboolean
+g_settings_get_destroyed (GSettings *settings)
+{
+ return settings->priv->destroyed;
+}
+
- /**
- * g_settings_list_keys:
- * @settings: a #GSettings object
- * @returns: a list of the keys on @settings
- *
- * Introspects the list of keys on @settings.
- *
- * You should probably not be calling this function from "normal" code
- * (since you should already know what keys are in your schema). This
- * function is intended for introspection reasons.
- *
- * You should free the return value with g_strfreev() when you are done
- * with it.
- */
- gchar **
- g_settings_list_keys (GSettings *settings)
- {
- const GQuark *keys;
- gchar **strv;
- gint n_keys;
- gint i, j;
-
- keys = g_settings_schema_list (settings->priv->schema, &n_keys);
- strv = g_new (gchar *, n_keys + 1);
- for (i = j = 0; i < n_keys; i++)
- {
- const gchar *key = g_quark_to_string (keys[i]);
-
- if (!g_str_has_suffix (key, "/"))
- strv[j++] = g_strdup (key);
- }
- strv[j] = NULL;
-
- return strv;
- }
-
- /**
- * g_settings_list_children:
- * @settings: a #GSettings object
- * @returns: a list of the children on @settings
- *
- * Gets the list of children on @settings.
- *
- * The list is exactly the list of strings for which it is not an error
- * to call g_settings_get_child().
- *
- * For GSettings objects that are lists, this value can change at any
- * time and you should connect to the "children-changed" signal to watch
- * for those changes. Note that there is a race condition here: you may
- * request a child after listing it only for it to have been destroyed
- * in the meantime. For this reason, g_settings_get_child() may return
- * %NULL even for a child that was listed by this function.
- *
- * For GSettings objects that are not lists, you should probably not be
- * calling this function from "normal" code (since you should already
- * know what children are in your schema). This function may still be
- * useful there for introspection reasons, however.
- *
- * You should free the return value with g_strfreev() when you are done
- * with it.
- */
- gchar **
- g_settings_list_children (GSettings *settings)
- {
- const GQuark *keys;
- gchar **strv;
- gint n_keys;
- gint i, j;
-
- keys = g_settings_schema_list (settings->priv->schema, &n_keys);
- strv = g_new (gchar *, n_keys + 1);
- for (i = j = 0; i < n_keys; i++)
- {
- const gchar *key = g_quark_to_string (keys[i]);
-
- if (g_str_has_suffix (key, "/"))
- {
- gint length = strlen (key);
-
- strv[j] = g_memdup (key, length);
- strv[j][length - 1] = '\0';
- j++;
- }
- }
- strv[j] = NULL;
-
- return strv;
- }
-
/* Epilogue {{{1 */
/* vim:set foldmethod=marker: */
diff --cc gio/gsettings.h
index c051ac2,8226750..57c15f6
--- a/gio/gsettings.h
+++ b/gio/gsettings.h
@@@ -254,23 -259,6 +262,20 @@@ gpointer g_settings_get_
GSettingsGetMapping mapping,
gpointer user_data);
- gchar ** g_settings_list_children (GSettings *settings);
- gchar ** g_settings_list_keys (GSettings *settings);
-
+gboolean g_settings_can_add_child (GSettings *settings);
+
+gboolean g_settings_can_remove_child (GSettings *settings,
+ const gchar *id);
+
+gboolean g_settings_add_child (GSettings *settings,
+ const gchar *prefix,
+ gchar **name);
+
+gboolean g_settings_remove_child (GSettings *settings,
+ const gchar *id);
+
+gboolean g_settings_get_destroyed (GSettings *settings);
+
G_END_DECLS
#endif /* __G_SETTINGS_H__ */
diff --cc gio/gsettingsbackendinternal.h
index ea284e9,a6711cb..6a4230c
--- a/gio/gsettingsbackendinternal.h
+++ b/gio/gsettingsbackendinternal.h
@@@ -103,31 -91,7 +103,29 @@@ void g_settings_back
G_GNUC_INTERNAL
GPermission * g_settings_backend_get_permission (GSettingsBackend *backend,
const gchar *path);
+
+G_GNUC_INTERNAL
+gboolean g_settings_backend_check (GSettingsBackend *backend,
+ const gchar *path);
+G_GNUC_INTERNAL
+gboolean g_settings_backend_insert (GSettingsBackend *backend,
+ const gchar *path,
+ gint index,
+ const gchar *prefix,
+ gchar **name);
+G_GNUC_INTERNAL
+gboolean g_settings_backend_remove (GSettingsBackend *backend,
+ const gchar *path,
+ const gchar *id);
+G_GNUC_INTERNAL
+gboolean g_settings_backend_can_insert (GSettingsBackend *backend,
+ const gchar *path);
+G_GNUC_INTERNAL
+gboolean g_settings_backend_can_remove (GSettingsBackend *backend,
+ const gchar *path,
+ const gchar *id);
+
G_GNUC_INTERNAL
- GMainContext * g_settings_backend_get_active_context (void);
- G_GNUC_INTERNAL
GSettingsBackend * g_settings_backend_get_default (void);
G_GNUC_INTERNAL
void g_settings_backend_sync_default (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]