[Vala] Signal disconnecting. Patch attempt.



Hey there everyone.

I kinda felt bad by asking so much in this mail list without actually
doing nothing :)

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.

Attaching the file for you guys (my-first.patch)

Best regards and I hope you like the idea and further improve it to
include in Vala.

Alexandre Moreira.

PS: Just for your information, this patch is applied on the
vala/valacodegenerator.vala file. I'm not very familiar with this
patching thingie :)

Attachment: my-first.patch
Description: Text Data



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