After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 651366 - [Patch] Do not abort on missing schemas
[Patch] Do not abort on missing schemas
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gsettings
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: Allison Karlitskaya (desrt)
gtkdev
: 651390 651391 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-05-29 01:35 UTC by ecyrbe
Modified: 2012-01-22 02:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
no abort patch for gsettings (2.88 KB, patch)
2011-05-29 01:35 UTC, ecyrbe
none Details | Review

Description ecyrbe 2011-05-29 01:35:18 UTC
Created attachment 188823 [details] [review]
no abort patch for gsettings

This patch allows for not aborting on missing schemas or keys.
I know that this is the intended behaviour by the developpers.
But some developpers might want to have the choice to not abort while developing their applications or plugins. Especialy when developping for gnome-shell that is one process only.
There might be a better solution for developpers, maybe add a FLAG for g_error not aborting if G_DONT_ABORT is set.
With this patch, you can still abort if you set the G_DEBUG environnement variable.
Comment 1 ecyrbe 2011-05-29 05:31:30 UTC
As John Stowers suggested, i can also provide a patch with : g_settings_try_new
or/and g_settings_exist
Comment 2 Christian Persch 2011-05-29 11:10:43 UTC
How is a g_critical any better than a g_error? You're still acknowledging that you made a programming error, not a runtime error.

See also bug 620642.
Comment 3 ecyrbe 2011-05-29 12:24:02 UTC
I like your patch, but since it was also rejected, i think that i'll try to implement g_settings_exists(string schema_name); as ryan seems to be ok for this sort of addition
Comment 4 ecyrbe 2011-05-29 13:51:09 UTC
The last porposal patch was sumitted on Bug 651391.
Comment 5 Allison Karlitskaya (desrt) 2011-05-29 14:35:52 UTC
I -don't- seem to think that g_settings_exists or g_settings_try_new is OK.
Comment 6 Allison Karlitskaya (desrt) 2011-05-29 14:36:53 UTC
*** Bug 651391 has been marked as a duplicate of this bug. ***
Comment 7 Allison Karlitskaya (desrt) 2011-05-29 14:38:11 UTC
*** Bug 651390 has been marked as a duplicate of this bug. ***
Comment 8 ecyrbe 2011-05-29 15:30:30 UTC
(In reply to comment #5)
> I -don't- seem to think that g_settings_exists or g_settings_try_new is OK.

You said on Bug 620642 :

> this is really too much.
> 
> For the use case we discussed on IRC I will probably just add a:
> 
> bool g_settings_exists(string schema_name);
> 
> sort of thing

If you changed your mind, say it, but don't say that i'm lying, please...

Just to not waste your time no more (and mine as i'm the one putting some effort to not have my apps aborting), if you don't want to supply the developpers of your apis some way to check that something could go wrong, just says so, i will change my tools for another thing than gsettings, or maybe fork it, as dconf independant backend anyway....
Comment 9 Allison Karlitskaya (desrt) 2011-05-29 15:46:58 UTC
That comment was a year ago and I did change my mind since.  We added g_settings_list_schemas() instead.

You should have known from the extremely long mailing list discussion and the fact that you participated in previous bugs (bug #649143, bug #620642, bug #651225) that we didn't consider this to be a desired feature.  Repeated filing bugs for (largely) the same issue won't get you anywhere.

If you *really* *really* want to be sure that you can handle installation errors in your software, you can use g_settings_list_schemas() to discover if your schema is listed.  I don't recommend that you do this, but the mechanism is available to you if you want.

Please refrain from idle threats of forking GLib.
Comment 10 ecyrbe 2011-05-29 15:54:11 UTC
Please don't consider forking as a threat, it's only a sane thing to do when you don't agree with the maintainers of some code that you think is usefull.
Everybody does it, in fact, every distribution does it when their patch don't get accepted.

Anyway, message received, i will not bother you anymore on this issue, i'll deal with it my way.
Comment 11 Matthias Clasen 2012-01-22 02:38:35 UTC
The requested functionality is available by now, in the form of GSettingsSchemaSource