[Geany] More Features

Enrico Tröger enrico.troeger at xxxxx
Wed Nov 21 19:00:51 UTC 2007


On Tue, 20 Nov 2007 16:59:55 +0100, Bo Lorentsen <bl at lue.dk> wrote:

> > It isn't really needed. There is no consistent handle for the
> > project's keyfile while Geany is running. The file is only opened
> > when the project is opened, configured or closed. Plugins already
> > have access to the project's configuration file path. Maybe, when
> > opening or closing a project, the used handle can be passed to the
> > signal handler to minimize file access(i.e. the plugin doesn't have
> > to open and write the configuration file again on project
> > open/close).
> Passing a valid keyfile pointer when firing the signals would be a
> huge help, and a nice way of doing this.
I just added three signals: project-open, project-save and
project-close. project-open and project-save submit the keyfile object
which may be modified. Some basic documentation can be found at the top
of src/plugindata.h, I'll write some more plugin documentation soon.

At the moment, I'm not completely sure whether it is save to pass the
keyfile object when emitting the signal. It might be it can already be
invalid(due to free()) in the signal handler although my tests worked
fine. I just don't know for sure whether g_signal_emit emits the signal
instantly and wait for all connected handlers to return or whether it
returns before handlers are finished. In the latter case, the passed
keyfile object may become invalid because after the signal(e.g.
project-open) is emitted, the keyfile object is freed.


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20071121/360f7066/attachment.pgp>


More information about the Users mailing list