Configuration files location for GNOME applet

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Configuration files location for GNOME applet

Andrew M.-3
Hi.
I recently developed a small GNOME applet and I wanted to share it among a
few friends. It uses a couple of files to save settings and I was
wondering what's the best location to store them.
Is ~/.myapplet/ acceptable or should I use another folder?

Andrew M.




--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuration files location for GNOME applet

Bernd Eckenfels
In article <[hidden email]> you wrote:
> I recently developed a small GNOME applet and I wanted to share it among a
> few friends. It uses a couple of files to save settings and I was
> wondering what's the best location to store them.
> Is ~/.myapplet/ acceptable or should I use another folder?

Isnt property saving part of the GNOME API? Besides that, .myapplet would be
fine.

Gruss
Bernd

PS: http://library.gnome.org/devel/platform-overview/stable/gconf.html.en


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuration files location for GNOME applet

Josselin Mouette
In reply to this post by Andrew M.-3
Le samedi 22 novembre 2008 à 00:27 +0100, Andrew M. a écrit :
> Hi.
> I recently developed a small GNOME applet and I wanted to share it among a
> few friends. It uses a couple of files to save settings and I was
> wondering what's the best location to store them.
> Is ~/.myapplet/ acceptable or should I use another folder?

If it’s an applet using libpanel-applet, you should really use GConf to
store the values so that the configuration can be instantiated once for
each instance of the applet.

If it’s merely an application using the notification area, you can use
~/.myapplet/ or ~/.gnome2/myapplet/, or course - but if you’re looking
for a way to store user settings, GConf is the recommended way as well.

Cheers,
--
 .''`.
: :' :      We are debian.org. Lower your prices, surrender your code.
`. `'       We will add your hardware and software distinctiveness to
  `-        our own. Resistance is futile.

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Configuration files location for GNOME applet

Michael Biebl-3
Josselin Mouette wrote:

> Le samedi 22 novembre 2008 à 00:27 +0100, Andrew M. a écrit :
>> Hi.
>> I recently developed a small GNOME applet and I wanted to share it among a
>> few friends. It uses a couple of files to save settings and I was
>> wondering what's the best location to store them.
>> Is ~/.myapplet/ acceptable or should I use another folder?
>
> If it’s an applet using libpanel-applet, you should really use GConf to
> store the values so that the configuration can be instantiated once for
> each instance of the applet.
>
> If it’s merely an application using the notification area, you can use
> ~/.myapplet/ or ~/.gnome2/myapplet/, or course - but if you’re looking
> for a way to store user settings, GConf is the recommended way as well.
If you are not using GConf, I'd recommend to use the XDG basedir spec [1],
rather then ~/.myapplet/

Glib already has support for this, see the g_get_user_config_dir() function (I'd
recommend to install devhelp and libglib2.0-doc for easier access of the glib
API doc)

HTH,
Michael

[1] http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html

--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?


signature.asc (268 bytes) Download Attachment