[evolution-data-server/gnome-3-36] ESourceRegistryWatcher: The 'filter' signal listener should not be required



commit 811c86d4767833682cf582281c2c2fb7d84f5a10
Author: Milan Crha <mcrha redhat com>
Date:   Mon Apr 20 18:42:19 2020 +0200

    ESourceRegistryWatcher: The 'filter' signal listener should not be required
    
    The documentation says the 'filter' signal is not needed, in which case all
    the sources are included, but this did not work properly, because glib
    overrode the signal output value to FALSE, even it had been preset to TRUE.

 src/libedataserver/e-source-registry-watcher.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/libedataserver/e-source-registry-watcher.c b/src/libedataserver/e-source-registry-watcher.c
index 0ad4692ad..c6aa984d3 100644
--- a/src/libedataserver/e-source-registry-watcher.c
+++ b/src/libedataserver/e-source-registry-watcher.c
@@ -109,7 +109,10 @@ source_registry_watcher_try_add (ESourceRegistryWatcher *watcher,
        if (!uid)
                return FALSE;
 
-       g_signal_emit (watcher, signals[FILTER], 0, source, &can_include);
+       /* Check whether anything is listening, because glib overrides the result
+          value with FALSE, when there's nothing listening. */
+       if (g_signal_has_handler_pending (watcher, signals[FILTER], 0, FALSE))
+               g_signal_emit (watcher, signals[FILTER], 0, source, &can_include);
 
        if (!can_include) {
                if (with_remove_check)


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