Beispiel #1
0
static gboolean
gconf_settings_backend_write (GSettingsBackend *backend,
                              const gchar      *key,
                              GVariant         *value,
                              gpointer          origin_tag)
{
  GConfSettingsBackend *gconf = GCONF_SETTINGS_BACKEND (backend);
  GConfValue           *gconf_value;
  GError               *error;

  g_variant_ref_sink (value);
  gconf_value = gconf_settings_backend_gvariant_to_gconf_value (value);
  g_variant_unref (value);
  if (gconf_value == NULL)
    return FALSE;

  error = NULL;
  gconf_client_set (gconf->priv->client, key, gconf_value, &error);
  gconf_value_free (gconf_value);

  if (error != NULL)
    {
      g_error_free (error);
      return FALSE;
    }

  g_settings_backend_changed (backend, key, origin_tag);

  g_hash_table_replace (gconf->priv->ignore_notifications,
                        g_strdup (key), GINT_TO_POINTER (1));

  return TRUE;
}
Beispiel #2
0
static void
gconf_settings_backend_reset (GSettingsBackend *backend,
                              const gchar      *key,
                              gpointer          origin_tag)
{
  GConfSettingsBackend *gconf = GCONF_SETTINGS_BACKEND (backend);

  if (gconf_client_unset (gconf->priv->client, key, NULL))
    g_settings_backend_changed (backend, key, origin_tag);
}
static void
g_keyfile_settings_backend_reset (GSettingsBackend *backend,
                                  const gchar      *key,
                                  gpointer          origin_tag)
{
  GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend);

  if (set_to_keyfile (kfsb, key, NULL))
    g_keyfile_settings_backend_keyfile_write (kfsb);

  g_settings_backend_changed (backend, key, origin_tag);
}
Beispiel #4
0
static void
gconf_settings_backend_notified (GConfClient          *client,
                                 guint                 cnxn_id,
                                 GConfEntry           *entry,
                                 GConfSettingsBackend *gconf)
{
  if (g_hash_table_lookup_extended (gconf->priv->ignore_notifications, entry->key,
                                    NULL, NULL))
    {
      g_hash_table_remove (gconf->priv->ignore_notifications, entry->key);
      return;
    }

  g_settings_backend_changed (G_SETTINGS_BACKEND (gconf), entry->key, NULL);
}
static gboolean
g_keyfile_settings_backend_write (GSettingsBackend *backend,
                                  const gchar      *key,
                                  GVariant         *value,
                                  gpointer          origin_tag)
{
  GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend);
  gboolean success;

  if (!kfsb->writable)
    return FALSE;

  success = set_to_keyfile (kfsb, key, value);

  if (success)
    {
      g_settings_backend_changed (backend, key, origin_tag);
      g_keyfile_settings_backend_keyfile_write (kfsb);
    }

  return success;
}