Re: [Vala] Signal disconnecting. Patch attempt.



On Fre, 2007-03-16 at 20:27 -0300, Alexandre Moreira wrote:
On 3/16/07, Jürg Billeter <j bitron ch> wrote:
On Don, 2007-03-15 at 23:38 -0300, Alexandre Moreira wrote:
I am completely aware to the fact that I know pretty much nothing
about the way Vala compiler works, but I tried what seemed to be an
"easy-to-make-work" patch.

I'm sure there is a lot of cases where this thing might break and the
code is not well factored, but it suits my immediate needs. I just
felt like uploading the patch for you guys, so you can see the idea
and improve on it.

The patch is to add the following syntax:

object.signal -= somefunction;

so one can disconnect from a signal.

I only tested it in a very simple use case (which is the use case I'll
use the most) : Disconnecting a method of the current object (self)
from a signal.

The patch itself is a very simple copy/paste with little modifications
from the original += behavior.

Thanks for the patch, I've only had to change it to use
g_signal_handlers_disconnect_matched instead of
g_signal_handlers_disconnect_by_func as the latter disconnects all
signals with the same handler, disregarding the signal you specify. I've
committed it to SVN.


Oh, great! I'll build svn as soon as I get back to my computer (this
one has no linux here). I plan on handing more patches as soon as I
learn more about the internals of the Vala compiler.

By the way, is there any lose documentation on how the different
classes interact with each other ? Something like a sketch on the
class diagrams ? If you have anything in paper and is able to scan and
send I can get it digitalized with Dia so we get a basic information
for new developers.

There is no class diagram, the code comments describe some parts of the
interaction.

Jürg




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]