Re: [Evolution-hackers] Shedding some light on evolution-data-server's #ESourceRegistryWatcher



On Sun, 2020-04-19 at 14:20 +0200, Juozas Miškinis wrote:
Hey everyone!

I've been having some trouble trying to capture the "add/remove task
list" events in evolution-data-server and I was hoping that you could
perhaps clear some things up for me.

1) Here's a barebone #ESourceRegistryWatcher implementation in gjs
(returns no errors) which DOESN'T WORK (i.e. _onAppeared and
_onDisappeared methods aren't executed upon task list
addition/removal): https://paste.gnome.org/pboxc98jo 
2) Here's a similar WORKING approach that combines
#ESourceRegistryWatcher and ESourceRegistry::source-added signal
(which captures all types of #ESources): 
https://paste.gnome.org/phr0crkit

The reason to combine them here is not clear to me, but without the
watcher (i.e. if I removed line 27 in 
https://paste.gnome.org/phr0crkit), registry.connect('source-
added'...) wouldn't work either.

Here's my main question: is there anything obviously wrong with what
I have in #1?

        Hi,
I'm sorry I cannot help more, I do not speak gjs-ish, especially how it
works with respect of asynchronous calls, but I have few guesses, like
I'd rather use synchronous calls and make sure the variables you
assigned the instances to are not vanished during garbage collection.
Again, I do not know how gjs works and what it does with the GObject
introspection generated code.

I know that the ESourceRegistryWatcher works properly, it is used by
evolution-alarm-notify and some other parts of Evolution itself.

I'd also try to use C, to see whether it'll work, which may prove the
problem in the gjs code/usage, not in evolution-data-server itself.
        Bye,
        Milan



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