summaryrefslogtreecommitdiff
path: root/libebackend/e-source-registry-server.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-06-21 08:54:29 -0400
committerMatthew Barnes <mbarnes@redhat.com>2012-06-21 09:05:06 -0400
commitaf9783dc5c913ec73a5010a3a795b9bee0617b09 (patch)
tree544ebcf152f7a79698705c8d0adf1f716f1d3acb /libebackend/e-source-registry-server.c
parent1d00bd4960e296a32810ca920d78d26245e9bc09 (diff)
downloadevolution-data-server-af9783dc5c913ec73a5010a3a795b9bee0617b09.tar.gz
EServerSideSource: Don't write changes to disk until exported.
If a collection backend is configuring an EServerSideSource from a worker thread, avoid writing changes to disk prematurely. Explicitly calling e_source_write_sync() still works as advertised whether the source is exported or not.
Diffstat (limited to 'libebackend/e-source-registry-server.c')
-rw-r--r--libebackend/e-source-registry-server.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libebackend/e-source-registry-server.c b/libebackend/e-source-registry-server.c
index b06a1a651..542f28802 100644
--- a/libebackend/e-source-registry-server.c
+++ b/libebackend/e-source-registry-server.c
@@ -1276,6 +1276,11 @@ e_source_registry_server_add_source (ESourceRegistryServer *server,
g_signal_emit (server, signals[SOURCE_ADDED], 0, source);
+ /* This is to ensure the source data gets written to disk, since
+ * the ESource is exported now. Could be racy otherwise if this
+ * function is called from a worker thread. */
+ e_source_changed (source);
+
/* Adopt any orphans that have been waiting for this object. */
source_registry_server_adopt_orphans (server, source);
}