GNOME Bugzilla – Bug 683262
Do not throw user's configuration file warnings
Last modified: 2018-09-21 13:47:10 UTC
Libgda should not implicitly create user's configuration. Either it should be ignored (as not requested by userland) or configured explicitly. Related Midgard2 issue: https://github.com/midgardproject/midgard-php5/issues/90
Since I don't want to break the way it currently works, I can propose you to either create the GdaConfig (singleton) using some special crafted property, or by using an environment variable (or both actually). Does it suit you?
As a matter of fact, you can already create a GdaConfig object where no user configuration is created: simply, at the start of your code, do: ... GdaConfig *conf; conf = GDA_CONFIG (g_object_new (GDA_TYPE_CONFIG, "user-file", NULL, NULL)); ...
Can we work around it with environment variable? It affects us badly :( https://github.com/midgardproject/midgard-core/issues/186
There is no workaround using an environment variable in the current version of Libgda. Even if you don't use the GdaConfig object, it is used internally by Libgda. The GdaConfig object is a singleton (i.e. there is only one created). The only and clean solution is to create the GdaConfig object _before_ libgda creates it itself, which means right after having called gda_init(): ... gda_init(); GdaConfig *config; config = GDA_CONFIG (g_object_new (GDA_TYPE_CONFIG, "user-filename, NULL, "system-filename", NULL, NULL)); g_object_unref (config); ... and then use Libgda normally.
So is this a WONTFIX?
I wouldn't mark it as WONTFIX. Even if it is in current, available gda versions. Library shouldn't make any assumption that application based on library needs particular configuration file, and shouldn't make assumption that such file is located in home directory.
The GdaConfig object handles Libgda's configuration and is thus a required component when using Libgda. I can't change the behaviour of that object regarding how it uses config files as it would break existing programs. What's wrong with the solution I proposed in comment #4?
There's no need for big changes. Just set proper GError instead of g_warning. That's better approach for GIR, testing, etc IMO. Proposed solution might be good, but it's workaround only.
Is this still an issue with recent versions?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libgda/issues/67.