diff options
author | Milan Crha <mcrha@redhat.com> | 2013-11-22 16:53:44 +0100 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2013-11-22 16:53:44 +0100 |
commit | 43feee44173ea2cefccff92127389598517bf79f (patch) | |
tree | 7d0c518ef14bd341410f617459ad07b3c7ac10df /libebackend/e-source-registry-server.c | |
parent | c42ad427e4d2e3282f88e476d71843d07eb54e8f (diff) | |
download | evolution-data-server-43feee44173ea2cefccff92127389598517bf79f.tar.gz |
ESourceRegistry: Ignore hidden files from .source folder monitoring
There used to be a critical warning on the source registry console:
** Failed to load key file at
'file:///home/user/.config/evolution/sources/.goutputstream-1P9V6W':
File must have a '.source' extension
There is nothing the source registry can do with these files (because
they are created by GIO), but ignore them during the folder monitoring,
instead of spreading useless runtime warning.
Diffstat (limited to 'libebackend/e-source-registry-server.c')
-rw-r--r-- | libebackend/e-source-registry-server.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libebackend/e-source-registry-server.c b/libebackend/e-source-registry-server.c index 562fd031e..6d39142a4 100644 --- a/libebackend/e-source-registry-server.c +++ b/libebackend/e-source-registry-server.c @@ -900,14 +900,10 @@ source_registry_server_monitor_changed_cb (GFileMonitor *monitor, ESource *source; GError *error = NULL; + /* it can return NULL source for hidden files */ source = e_server_side_source_new (server, file, &error); - /* Sanity check. */ - g_return_if_fail ( - ((source != NULL) && (error == NULL)) || - ((source == NULL) && (error != NULL))); - - if (error == NULL) { + if (!error && source) { /* File monitors are only placed on directories * where data sources are writable and removable, * so it should be safe to assume these flags. */ @@ -918,7 +914,7 @@ source_registry_server_monitor_changed_cb (GFileMonitor *monitor, e_source_registry_server_add_source (server, source); g_object_unref (source); - } else { + } else if (error) { e_source_registry_server_load_error ( server, file, error); g_error_free (error); |