GNOME Bugzilla – Bug 751119
e-source-registry-server: Watch for changes to .source files and reload
Last modified: 2015-06-19 07:46:19 UTC
See the description in the first patch.
Created attachment 305490 [details] [review] e-source-registry-server: Watch for changes to .source files and reload It is possible for evolution-source-registry to detect a newly-added source file before the author of the file has written to it; the registry will attempt to load the file, find it is invalid, and then ignore it. The registry should also listen for changes to files, and reload them accordingly. This means that the source file will get reloaded after the author has finished writing to it, and hence the source will get created.
Created attachment 305491 [details] [review] e-source-registry-server: Remove a spurious newline from a debug message
Review of attachment 305491 [details] [review]: This one looks fine, I'll make more tests with the other first.
Review of attachment 305490 [details] [review]: Please fix the things below and commit. Thanks. ::: libebackend/e-source-registry-server.c @@ +426,3 @@ + uri = g_file_get_uri (file); + g_debug ("Handling file monitor event %u for URI: %s", event_type, uri); + g_free (uri); I do not like to see the allocation and free of the uri even for cases when the logging is disabled. Also, please use e_source_registry_debug_print(), rather than the g_debug(). You can use e_source_registry_debug_enabled() for the allocation part too. @@ +452,3 @@ + event_type = G_FILE_MONITOR_EVENT_CREATED; + } else if (!e_server_side_source_load (E_SERVER_SIDE_SOURCE (source), + NULL, &error)) { make it one "not so long" line, please @@ +455,3 @@ + uri = g_file_get_uri (file); + g_warning ("Error reloading source ‘%s’: %s", + uri, error->message); similar here, no need to wrap here
Comment on attachment 305491 [details] [review] e-source-registry-server: Remove a spurious newline from a debug message Attachment 305491 [details] pushed as 8358fc9 - e-source-registry-server: Remove a spurious newline from a debug message
The following fix has been pushed: 16c8cb4 e-source-registry-server: Watch for changes to .source files and reload
Created attachment 305642 [details] [review] e-source-registry-server: Watch for changes to .source files and reload It is possible for evolution-source-registry to detect a newly-added source file before the author of the file has written to it; the registry will attempt to load the file, find it is invalid, and then ignore it. The registry should also listen for changes to files, and reload them accordingly. This means that the source file will get reloaded after the author has finished writing to it, and hence the source will get created.