Re: RFC GnomeGoal #3
- From: "David Trowbridge" <trowbrds gmail com>
- To: "Shaun McCance" <shaunm gnome org>
- Cc: desktop-devel-list gnome org
- Subject: Re: RFC GnomeGoal #3
- Date: Fri, 11 Aug 2006 11:03:27 -0700
gnome_config is deprecated, in favor of GKeyFile.
Unfortunately, GKeyFile is a lower-level API than gnome_config, making
you do things like figure out where to put the file yourself (and
really, with key:value files, figuring out where to put it is the
harder part).
-David
On 8/11/06, Shaun McCance <shaunm gnome org> wrote:
On Fri, 2006-08-11 at 11:22 +0100, Bastien Nocera wrote:
> Heya,
>
> I've written up on GNOME Goal #3:
> http://live.gnome.org/GnomeGoalsSaveState
>
> Currently, a lot of applications will be using GConf to save state, like
> window sizes, whether or not a window is maximised on startup, etc.
>
> This is against GConf policy, as GConf might be read-only, or locked
> down, but this sort of information should still be saved run-to-run.
>
> I'm awaiting comments on this, before making it official. Vincent
> mentioned that it would be a good idea to get code to save state in a
> library, although there isn't that much code to be shared IMO.
We have a very easy library for doing this: libgnome. The
gnome_config family of functions are easy to work with for
something this simple.
http://developer.gnome.org/doc/API/2.0/libgnome/libgnome-gnome-config.html
It's what Yelp uses to store the width and height of its
window. See here:
http://cvs.gnome.org/viewcvs/yelp/src/yelp-window.c?rev=1.210&view=markup
Search for "window_configure_cb". Search again. And now
a third time. Ah, there it is. And the code for getting
that information is in the window_init function. It's way
less code than using GKeyFile.
And since we're on the subject, I consider it a fundamental
flaw in all of these approaches that we're storing window
positions and sizes without regard for what machine we're
running on. (Yes, Yelp has this flaw too.) If I'm running
multiple machines off the same NFS home directory, and one
of them has a smaller resolution, bad things will happen.
--
Shaun
_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/desktop-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]