mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
Revert "gsettings-tool: warn if setting a value fails"
This reverts commit ea57feff96
.
It makes the gsettings tool fail any time it tries to set a
key to a value, that the key already has.
https://bugzilla.gnome.org/show_bug.cgi?id=641768
This commit is contained in:
parent
ce0f7cafa1
commit
eabad1923e
@ -457,7 +457,6 @@ gsettings_set (GSettings *settings,
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GVariant *existing;
|
GVariant *existing;
|
||||||
GVariant *new;
|
GVariant *new;
|
||||||
GVariant *stored;
|
|
||||||
gchar *freeme = NULL;
|
gchar *freeme = NULL;
|
||||||
|
|
||||||
existing = g_settings_get_value (settings, key);
|
existing = g_settings_get_value (settings, key);
|
||||||
@ -503,23 +502,16 @@ gsettings_set (GSettings *settings,
|
|||||||
if (!g_settings_range_check (settings, key, new))
|
if (!g_settings_range_check (settings, key, new))
|
||||||
{
|
{
|
||||||
g_printerr (_("The provided value is outside of the valid range\n"));
|
g_printerr (_("The provided value is outside of the valid range\n"));
|
||||||
|
g_variant_unref (new);
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_settings_set_value (settings, key, new);
|
g_settings_set_value (settings, key, new);
|
||||||
g_settings_sync ();
|
|
||||||
|
|
||||||
stored = g_settings_get_value (settings, key);
|
|
||||||
if (g_variant_equal (stored, existing))
|
|
||||||
{
|
|
||||||
g_printerr (_("Failed to set value\n"));
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_variant_unref (stored);
|
|
||||||
g_variant_unref (existing);
|
g_variant_unref (existing);
|
||||||
g_variant_unref (new);
|
g_variant_unref (new);
|
||||||
|
|
||||||
|
g_settings_sync ();
|
||||||
|
|
||||||
g_free (freeme);
|
g_free (freeme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user