Shedding some light on evolution-data-server's #ESourceRegistryWatcher

Juozas Miškinis <[email protected]> Sun, 19 Apr 2020 14:20:11 +0200
Newsgroups gmane.comp.gnome.evolution.devel
Message-ID <CAJcv9bLfUv28tyKUH9NOyhMZwwtHvouqsrwWCUSp-cb9zci98w@mail.gmail.com>
--===============8469779322905760601==
Content-Type: multipart/alternative; boundary="00000000000075b01105a3a3ced7"

--00000000000075b01105a3a3ced7
Content-Type: text/plain; charset="UTF-8"

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?

Thanks for the help,
Juozas

--00000000000075b01105a3a3ced7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hey everyone!<div><br></div><div>I&#39;ve been having some=
 trouble trying to capture the &quot;add/remove task list&quot; events in e=
volution-data-server and I was hoping that you could perhaps clear some thi=
ngs up for me.</div><div><br></div><div>1) Here&#39;s a barebone #ESourceRe=
gistryWatcher implementation in gjs (returns no errors)  which DOESN&#39;T =
WORK (i.e. _onAppeared and _onDisappeared methods aren&#39;t executed upon =
task list addition/removal):=C2=A0<a href=3D"https://paste.gnome.org/pboxc9=
8jo">https://paste.gnome.org/pboxc98jo</a>=C2=A0</div><div>2) Here&#39;s a =
similar WORKING approach that combines #ESourceRegistryWatcher and ESourceR=
egistry::source-added signal (which captures all types of #ESources):=C2=A0=
<a href=3D"https://paste.gnome.org/phr0crkit">https://paste.gnome.org/phr0c=
rkit</a></div><div><br></div><div>The reason to combine them here is not cl=
ear to me, but without the watcher (i.e. if I removed line 27 in <a href=3D=
"https://paste.gnome.org/phr0crkit">https://paste.gnome.org/phr0crkit</a>),=
 registry.connect(&#39;source-added&#39;...) wouldn&#39;t work either.</div=
><div><br></div><div>Here&#39;s my main question: is there anything=C2=A0ob=
viously wrong with what I have=C2=A0in #1?</div><div><br></div><div>Thanks =
for the help,</div><div>Juozas</div></div>

--00000000000075b01105a3a3ced7--

--===============8469779322905760601==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
evolution-hackers mailing list
[email protected]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-hackers

--===============8469779322905760601==--