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 683262 - Do not throw user's configuration file warnings
Do not throw user's configuration file warnings
Status: RESOLVED OBSOLETE
Product: libgda
Classification: Other
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: malerba
gnome-db Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-03 11:02 UTC by Piotr Pokora
Modified: 2018-09-21 13:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Piotr Pokora 2012-09-03 11:02:56 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
Comment 1 malerba 2012-09-03 19:17:23 UTC
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?
Comment 2 malerba 2012-09-03 19:25:50 UTC
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));
...
Comment 3 Piotr Pokora 2012-12-18 11:56:16 UTC
Can we work around it with environment variable?

It affects us badly :(
https://github.com/midgardproject/midgard-core/issues/186
Comment 4 malerba 2012-12-18 21:42:27 UTC
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.
Comment 5 Tobias Mueller 2013-04-07 00:44:33 UTC
So is this a WONTFIX?
Comment 6 Piotr Pokora 2013-04-07 09:46:26 UTC
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.
Comment 7 malerba 2013-04-07 18:40:37 UTC
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?
Comment 8 Piotr Pokora 2013-04-08 06:27:35 UTC
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.
Comment 9 Alexandre Franke 2017-07-17 18:33:15 UTC
Is this still an issue with recent versions?
Comment 10 GNOME Infrastructure Team 2018-09-21 13:47:10 UTC
-- 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.