GNOME Bugzilla – Bug 310354
plain gtk version of gnumeric should remember config preferences
Last modified: 2005-10-31 16:33:16 UTC
Distribution/Version: unknown/2.6.12.2 When you select configuration options in a plain gtk build of gnumeric, these are not saved and remembered for the next session. The "goconf" apparatus in this case is just a bunch of dummy stubs that do nothing.
Created attachment 49166 [details] [review] patch to gnumeric 1.5.2 The attached diff to gnumeric-gconf.c implements the functionality I desire, using the traditional method of a plain text .rc file in the user's home directory.
Created attachment 50912 [details] [review] updated patch, for gnumeric 1.5.3 I'm trying again, with a patch that is updated for the recently released gnumeric 1.5.3.
I don't quite understand why we want to do all this by hand when glib supplies gkeyfile.h
If using the gkeyfile apparatus will enhance the probability of getting this patch accepted, I'm willing to go that way (re-jig my patch accordingly). However, I'm not sure of the force of Morten's "do all this by hand." By my count, the patch includes 32 functions, maybe 3 of which could be replaced by constructions using gkeyfile functionality (i.e. the functions that directly read and write the per-user plain text config file). The replacement would surely burn more CPU cycles then the original, since gkeyfile is just a wrapper (with some redundancy, in context) for what I do using ISO C in the few replaceable functions.
I'm thinking of redoing this using gkeyfile. Would that make it acceptable? (I mean, with reasonable probability; I realize nobody's going to commit to accepting code sight unseen.)
I would think that it would make it acceptable.
Seconded.
Created attachment 52748 [details] [review] new patch, using g_key_file
In general I hate a noisy program that prints unnecessary info to stdout, but I think we should print some warning if the configuration info cannot be written to the file.
Created attachment 53018 [details] [review] revised patch with warning if config file can;t be written
I'll dump this in after 1.6.1. There are a few more issues -- such as not using g_build_filename -- that we can deal with afterwards.
Patch is in with a few fixes: use g_fopen, not fopen. use g_build_filename. let g_strdup handle NULLs.