[Geany-devel] Race condition when saving geany.conf

Dimitar Zhekov hamster at xxxxx
Wed Feb 24 18:35:38 UTC 2010


On Wed, 24 Feb 2010 20:11:43 +0300
Dimitar Zhekov <hamster at mbox.contact.bg> wrote:

> 1. Temporarily clear Project Based Session Files.

To clarify this a bit, since "temporarily clear" obviously won't work
just like that.

For saving, a save_configuration_file(name, gboolean project_session)
should suffice. The project_session argument will determine the
behaviour, while the project_prefs.project_session value will be saved
in the .conf file. The standard save_configuration() will then invoke
save_configuration_file(geany.conf, project_prefs.project_session).

For loading, clearing project_prefs.project_session in
main.c:load_startup_files() before invoking load_session_project_file()
and restoring it afterwards should do the trick. It'll be techically
cleaner to pass an additional force_non_project_session argument to
load_session_project_file() -> project_load_file() -> load_config(),
but not worth the effort IMHO.

--
E-gards: Jimmy



More information about the Devel mailing list