Merge lp:~renatofilho/address-book-service/create-eds-extension-package into lp:address-book-service

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 214
Merged at revision: 208
Proposed branch: lp:~renatofilho/address-book-service/create-eds-extension-package
Merge into: lp:address-book-service
Diff against target: 438 lines (+257/-7)
9 files modified
debian/address-book-service.install (+0/-2)
debian/control (+23/-0)
debian/evolution-data-server-ubuntu-dev.install (+2/-0)
debian/evolution-data-server-ubuntu.install (+2/-0)
eds-extension/CMakeLists.txt (+12/-1)
eds-extension/e-source-ubuntu.c (+181/-1)
eds-extension/e-source-ubuntu.h (+9/-0)
eds-extension/evolution-data-server-ubuntu.pc.in (+11/-0)
eds-extension/module-ubuntu-sources.c (+17/-3)
To merge this branch: bzr merge lp:~renatofilho/address-book-service/create-eds-extension-package
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Approve
Ken VanDine packaging Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+296447@code.launchpad.net

Commit message

Created a debian package "evolution-data-server-ubuntu" to used by others projects.

To post a comment you must log in.
208. By Renato Araujo Oliveira Filho

Created a debian package "evolution-data-server-ubuntu" to used by others projects.

209. By Renato Araujo Oliveira Filho

Fix package build.

210. By Renato Araujo Oliveira Filho

Add a 'metatada' field into the ubuntu eds extension.

Allow to use for any arbitrary data.

211. By Renato Araujo Oliveira Filho

Avoid warnings when using account-id 0.

212. By Renato Araujo Oliveira Filho

Does not delete sources if account-id is 0.

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :
Download full text (3.3 KiB)

FAILED: Continuous integration, rev:212
https://jenkins.canonical.com/system-apps/job/lp-address-book-service-ci/1/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/667
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/86
    FAILURE: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=xenial+overlay,testname=default/86/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=yakkety,testname=default/86/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/667
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/626
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/626
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/626
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/618
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/618/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/618
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/618/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/618
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/618/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/618
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/618/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/618
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/618/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/618
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/618/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/618
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/618/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/618
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/618/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/618
        deb: https://jenkins.canonical.com/system-apps/job/build-2-...

Read more...

review: Needs Fixing (continuous-integration)
213. By Renato Araujo Oliveira Filho

Fix memory leak.

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:213
https://jenkins.canonical.com/system-apps/job/lp-address-book-service-ci/3/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/802
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/135
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/802
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/737
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/737
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/737
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/729
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/729/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/729
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/729/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/729
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/729/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/729
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/729/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/729
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/729/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/729
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/729/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/729
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/729/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/729
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/729/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/729
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/729/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-3-clickpkg/20

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-address-book-service-ci/3/rebuild

review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

The description of evolution-data-server-ubuntu-dev is the same as evolution-data-server-ubuntu. You should change it a bit to reflect that it provides files necessary for development.

review: Needs Fixing
214. By Renato Araujo Oliveira Filho

Extend dev package description.

Revision history for this message
Ken VanDine (ken-vandine) wrote :

Packaging is good

review: Approve (packaging)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:214
https://jenkins.canonical.com/system-apps/job/lp-address-book-service-ci/4/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/931
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/164
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/931
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/838
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/838
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/838
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/835
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/835/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/835
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/835/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/835
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/835/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/835
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/835/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/835
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/835/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/835
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/835/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/835
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/835/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/835
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/835/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/835
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/835/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-address-book-service-ci/4/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/address-book-service.install'
2--- debian/address-book-service.install 2015-10-15 15:26:45 +0000
3+++ debian/address-book-service.install 2016-07-11 14:39:54 +0000
4@@ -1,5 +1,3 @@
5-usr/lib/*/libubuntu-source-eds.so
6-usr/lib/evolution-data-server/registry-modules/module-ubuntu-sources.so
7 usr/lib/*/address-book-service/address-book-service
8 usr/share/upstart/sessions/address-book-service.conf
9 usr/share/locale/*/LC_MESSAGES/address-book-service.mo
10
11=== modified file 'debian/control'
12--- debian/control 2015-10-15 15:26:45 +0000
13+++ debian/control 2016-07-11 14:39:54 +0000
14@@ -34,6 +34,7 @@
15 Architecture: any
16 Multi-Arch: same
17 Depends: address-book-updater (= ${binary:Version}),
18+ evolution-data-server-ubuntu (= ${binary:Version}),
19 evolution-data-server(>= 3.12.11),
20 libfolks-eds25,
21 ${misc:Depends},
22@@ -78,3 +79,25 @@
23 Description: Ubuntu contact service updater
24 A helper program to update address book service and address book app configuration and sync files.
25
26+Package: evolution-data-server-ubuntu
27+Architecture: any
28+Multi-Arch: same
29+Depends: ${misc:Depends},
30+ ${shlibs:Depends},
31+Description: EDS extension used by Ubuntu apps
32+ An EDS extension used by Ubuntu apps to store metadata about the online account and sync infomation.
33+
34+Package: evolution-data-server-ubuntu-dev
35+Architecture: any
36+Multi-Arch: same
37+Depends: evolution-data-server-ubuntu (= ${binary:Version}),
38+ ${misc:Depends},
39+ ${shlibs:Depends},
40+Description: EDS extension used by Ubuntu apps
41+ An EDS extension used by Ubuntu apps to store metadata about the online account and sync infomation.
42+ .
43+ This package contains header files for evolution-data-server-ubuntu.
44+
45+
46+
47+
48
49=== added file 'debian/evolution-data-server-ubuntu-dev.install'
50--- debian/evolution-data-server-ubuntu-dev.install 1970-01-01 00:00:00 +0000
51+++ debian/evolution-data-server-ubuntu-dev.install 2016-07-11 14:39:54 +0000
52@@ -0,0 +1,2 @@
53+usr/include/evolution-data-server-ubuntu/e-source-ubuntu.h
54+usr/share/pkgconfig/evolution-data-server-ubuntu.pc
55
56=== added file 'debian/evolution-data-server-ubuntu.install'
57--- debian/evolution-data-server-ubuntu.install 1970-01-01 00:00:00 +0000
58+++ debian/evolution-data-server-ubuntu.install 2016-07-11 14:39:54 +0000
59@@ -0,0 +1,2 @@
60+usr/lib/evolution-data-server/registry-modules/module-ubuntu-sources.so
61+usr/lib/*/libubuntu-source-eds.so
62
63=== modified file 'eds-extension/CMakeLists.txt'
64--- eds-extension/CMakeLists.txt 2015-07-13 20:25:36 +0000
65+++ eds-extension/CMakeLists.txt 2016-07-11 14:39:54 +0000
66@@ -13,12 +13,17 @@
67 OUTPUT_VARIABLE EDS_MODULES_DIR
68 OUTPUT_STRIP_TRAILING_WHITESPACE
69 )
70+set(UBUNTU_SOURCE_PC_FILE evolution-data-server-ubuntu.pc)
71+configure_file(${UBUNTU_SOURCE_PC_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${UBUNTU_SOURCE_PC_FILE} @ONLY)
72
73 # Ubuntu Source
74 set(UBUNTU_SOURCE_LIB ubuntu-source-eds)
75+set(UBUNTU_SOURCE_LIB_HEADERS
76+ e-source-ubuntu.h
77+)
78 set(UBUNTU_SOURCE_LIB_SRCS
79 e-source-ubuntu.c
80- e-source-ubuntu.h
81+ ${UBUNTU_SOURCE_LIB_HEADERS}
82 )
83 add_library(${UBUNTU_SOURCE_LIB} SHARED
84 ${UBUNTU_SOURCE_LIB_SRCS}
85@@ -32,6 +37,12 @@
86 install(TARGETS ${UBUNTU_SOURCE_LIB}
87 LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
88 )
89+install(FILES ${UBUNTU_SOURCE_LIB_HEADERS}
90+ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/evolution-data-server-ubuntu
91+)
92+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${UBUNTU_SOURCE_PC_FILE}
93+ DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/pkgconfig/
94+)
95
96 # Module Ubuntu Sources
97 set(MODULE_UBUNTU_SOURCES module-ubuntu-sources)
98
99=== modified file 'eds-extension/e-source-ubuntu.c'
100--- eds-extension/e-source-ubuntu.c 2015-07-13 20:25:36 +0000
101+++ eds-extension/e-source-ubuntu.c 2016-07-11 14:39:54 +0000
102@@ -39,7 +39,9 @@
103 guint account_id;
104 gchar *application_id;
105 gboolean auto_remove;
106+ gboolean writable;
107 gchar *provider;
108+ gchar *metadata;
109 AgAccount *account;
110 };
111
112@@ -48,7 +50,9 @@
113 PROP_ACCOUNT_ID,
114 PROP_APPLICATION_ID,
115 PROP_AUTOREMOVE,
116- PROP_ACCOUNT_PROVIDER
117+ PROP_ACCOUNT_PROVIDER,
118+ PROP_WRITABLE,
119+ PROP_METADATA
120 };
121
122 G_DEFINE_TYPE (
123@@ -77,6 +81,15 @@
124 e_source_ubuntu_set_autoremove (E_SOURCE_UBUNTU (object),
125 g_value_get_boolean (value));
126 return;
127+ case PROP_WRITABLE:
128+ e_source_ubuntu_set_writable (E_SOURCE_UBUNTU (object),
129+ g_value_get_boolean (value));
130+ return;
131+
132+ case PROP_METADATA:
133+ e_source_ubuntu_set_metadata (E_SOURCE_UBUNTU (object),
134+ g_value_get_string (value));
135+ return;
136 }
137
138 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
139@@ -109,6 +122,15 @@
140 e_source_ubuntu_dup_account_provider (E_SOURCE_UBUNTU (object)));
141 return;
142
143+ case PROP_WRITABLE:
144+ g_value_set_boolean (value,
145+ e_source_ubuntu_get_writable (E_SOURCE_UBUNTU (object)));
146+ return;
147+
148+ case PROP_METADATA:
149+ g_value_take_string (value,
150+ e_source_ubuntu_dup_metadata(E_SOURCE_UBUNTU (object)));
151+ return;
152 }
153
154 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
155@@ -128,6 +150,7 @@
156
157 g_free (priv->application_id);
158 g_free (priv->provider);
159+ g_free (priv->metadata);
160
161 /* Chain up to parent's finalize() method. */
162 G_OBJECT_CLASS (e_source_ubuntu_parent_class)->finalize (object);
163@@ -190,6 +213,32 @@
164
165 g_object_class_install_property (
166 object_class,
167+ PROP_WRITABLE,
168+ g_param_spec_boolean (
169+ "writable",
170+ "Writable source",
171+ "Writable source",
172+ TRUE,
173+ G_PARAM_READWRITE |
174+ G_PARAM_CONSTRUCT |
175+ G_PARAM_STATIC_STRINGS |
176+ E_SOURCE_PARAM_SETTING));
177+
178+ g_object_class_install_property (
179+ object_class,
180+ PROP_METADATA,
181+ g_param_spec_string (
182+ "metadata",
183+ "metadata",
184+ "Source metadata",
185+ NULL,
186+ G_PARAM_READWRITE |
187+ G_PARAM_CONSTRUCT |
188+ G_PARAM_STATIC_STRINGS |
189+ E_SOURCE_PARAM_SETTING));
190+
191+ g_object_class_install_property (
192+ object_class,
193 PROP_ACCOUNT_PROVIDER,
194 g_param_spec_string (
195 "account-provider",
196@@ -260,6 +309,7 @@
197 if (account_id != 0) {
198 AgManager *manager = ag_manager_new ();
199 extension->priv->account = ag_manager_get_account (manager, account_id);
200+ g_object_unref (manager);
201 }
202
203 g_mutex_unlock (&extension->priv->property_lock);
204@@ -408,3 +458,133 @@
205
206 g_object_notify (G_OBJECT (extension), "auto-remove");
207 }
208+
209+/**
210+ * e_source_ubuntu_get_writable:
211+ * @extension: an #ESourceUbuntu
212+ *
213+ * This can be used as extra flag.
214+ * For example for sources that are created from read-only remote sources.
215+ *
216+ * Returns: True if the source is marked as writable or False if not.
217+ *
218+ **/
219+gboolean
220+e_source_ubuntu_get_writable(ESourceUbuntu *extension)
221+{
222+ g_return_val_if_fail (E_IS_SOURCE_UBUNTU (extension), FALSE);
223+
224+ return extension->priv->writable;
225+}
226+
227+/**
228+ * e_source_ubuntu_set_writable:
229+ * @extension: an #ESourceUbuntu
230+ *
231+ * This can be used as extra flag.
232+ * For example for sources that are created from read-only remote sources.
233+ *
234+ * Sets if the source should be considered writable or not.
235+ *
236+ **/
237+void
238+e_source_ubuntu_set_writable(ESourceUbuntu *extension,
239+ gboolean flag)
240+{
241+ g_return_if_fail (E_IS_SOURCE_UBUNTU (extension));
242+
243+ g_mutex_lock (&extension->priv->property_lock);
244+
245+ if (extension->priv->writable == flag) {
246+ g_mutex_unlock (&extension->priv->property_lock);
247+ return;
248+ }
249+
250+ extension->priv->writable = flag;
251+
252+ g_mutex_unlock (&extension->priv->property_lock);
253+
254+ g_object_notify (G_OBJECT (extension), "writable");
255+}
256+
257+/**
258+ * e_source_ubuntu_get_metadata:
259+ * @extension: an #ESourceUbuntu
260+ *
261+ * Returns the metadata string of the application associated
262+ * with the #ESource to which @extension belongs. Can be %NULL or an empty
263+ * string.
264+ *
265+ * Returns: the associated metadata
266+ *
267+ **/
268+const gchar *
269+e_source_ubuntu_get_metadata (ESourceUbuntu *extension)
270+{
271+ g_return_val_if_fail (E_IS_SOURCE_UBUNTU (extension), NULL);
272+
273+ return extension->priv->metadata;
274+}
275+
276+/**
277+ * e_source_ubuntu_dup_metadata:
278+ * @extension: an #ESourceUbuntu
279+ *
280+ * Thread-safe variation of e_source_ubuntu_get_metadata().
281+ * Use this function when accessing @extension from multiple threads.
282+ *
283+ * The returned string should be freed with g_free() when no longer needed.
284+ *
285+ * Returns: a newly-allocated copy of #ESourceUbuntu:metadata
286+ *
287+ **/
288+gchar *
289+e_source_ubuntu_dup_metadata (ESourceUbuntu *extension)
290+{
291+ const gchar *metadata;
292+ gchar *duplicate;
293+
294+ g_return_val_if_fail (E_IS_SOURCE_UBUNTU (extension), NULL);
295+
296+ g_mutex_lock (&extension->priv->property_lock);
297+
298+ metadata = e_source_ubuntu_get_metadata(extension);
299+ duplicate = g_strdup (metadata);
300+
301+ g_mutex_unlock (&extension->priv->property_lock);
302+
303+ return duplicate;
304+}
305+
306+/**
307+ * e_source_ubuntu_set_metadata:
308+ * @extension: an #ESourceUbuntu
309+ * @metadata: (allow-none): the associated metadata, or %NULL
310+ *
311+ * Sets the metadata associated with the #ESource to which @extension belongs.
312+ *
313+ * The internal copy of @metadata is automatically stripped of leading
314+ * and trailing whitespace. If the resulting string is empty, %NULL is set
315+ * instead.
316+ *
317+ **/
318+void
319+e_source_ubuntu_set_metadata (ESourceUbuntu *extension,
320+ const gchar *metadata)
321+{
322+ g_return_if_fail (E_IS_SOURCE_UBUNTU (extension));
323+
324+ g_mutex_lock (&extension->priv->property_lock);
325+
326+ if (g_strcmp0 (extension->priv->metadata, metadata) == 0) {
327+ g_mutex_unlock (&extension->priv->property_lock);
328+ return;
329+ }
330+
331+ g_free (extension->priv->metadata);
332+ extension->priv->metadata = e_util_strdup_strip (metadata);
333+
334+ g_mutex_unlock (&extension->priv->property_lock);
335+
336+ g_object_notify (G_OBJECT (extension), "metadata");
337+}
338
339=== modified file 'eds-extension/e-source-ubuntu.h'
340--- eds-extension/e-source-ubuntu.h 2015-07-13 20:25:36 +0000
341+++ eds-extension/e-source-ubuntu.h 2016-07-11 14:39:54 +0000
342@@ -87,9 +87,18 @@
343 void e_source_ubuntu_set_autoremove (ESourceUbuntu *extension,
344 gboolean flag);
345
346+gboolean e_source_ubuntu_get_writable (ESourceUbuntu *extension);
347+void e_source_ubuntu_set_writable (ESourceUbuntu *extension,
348+ gboolean flag);
349+
350 const gchar * e_source_ubuntu_get_account_provider(ESourceUbuntu *extension);
351 gchar * e_source_ubuntu_dup_account_provider(ESourceUbuntu *extension);
352
353+const gchar * e_source_ubuntu_get_metadata (ESourceUbuntu *extension);
354+gchar * e_source_ubuntu_dup_metadata (ESourceUbuntu *extension);
355+void e_source_ubuntu_set_metadata (ESourceUbuntu *extension,
356+ const gchar *metadata);
357+
358 G_END_DECLS
359
360 #endif /* E_SOURCE_UBUNTU_H */
361
362=== added file 'eds-extension/evolution-data-server-ubuntu.pc.in'
363--- eds-extension/evolution-data-server-ubuntu.pc.in 1970-01-01 00:00:00 +0000
364+++ eds-extension/evolution-data-server-ubuntu.pc.in 2016-07-11 14:39:54 +0000
365@@ -0,0 +1,11 @@
366+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
367+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/evolution-data-server-ubuntu/
368+
369+Name: evolution-data-server-ubuntu
370+Description: EDS extension used by Ubuntu apps
371+Version: 1.0
372+Libs: -L${libdir} -lubuntu-source-eds
373+Cflags: -I${includedir}
374+Requires: libedataserver-1.2
375+
376+
377
378=== modified file 'eds-extension/module-ubuntu-sources.c'
379--- eds-extension/module-ubuntu-sources.c 2015-12-11 18:01:33 +0000
380+++ eds-extension/module-ubuntu-sources.c 2016-07-11 14:39:54 +0000
381@@ -128,6 +128,10 @@
382 GSList *link;
383 GQueue trash = G_QUEUE_INIT;
384
385+ if (ag_account_id == 0) {
386+ return;
387+ }
388+
389 server = ubuntu_sources_get_server (extension);
390
391 eds_id_list = g_hash_table_lookup (extension->uoa_to_eds,
392@@ -166,19 +170,25 @@
393 {
394 ESourceUbuntu *ubuntu_ext;
395 AgAccountId ag_account_id;
396- AgAccount *ag_account;
397+ AgAccount *ag_account = NULL;
398
399 g_debug("Register new source: %s/%s", e_source_get_display_name(source),
400 e_source_get_uid(source));
401
402 if (!e_source_has_extension (source, E_SOURCE_EXTENSION_UBUNTU)) {
403+ g_debug("\tSource does not have ubuntu extension!");
404 return FALSE;
405 }
406
407 ubuntu_ext = e_source_get_extension (source, E_SOURCE_EXTENSION_UBUNTU);
408 ag_account_id = e_source_ubuntu_get_account_id (ubuntu_ext);
409- ag_account = ag_manager_get_account (extension->ag_manager,
410- ag_account_id);
411+ if (ag_account_id > 0) {
412+ ag_account = ag_manager_get_account (extension->ag_manager,
413+ ag_account_id);
414+ } else {
415+ // accept sources with empty account
416+ return TRUE;
417+ }
418
419 if (ag_account) {
420 GSList *eds_id_list;
421@@ -300,6 +310,9 @@
422 {
423 g_debug("loading ubuntu sources");
424
425+ if (extension->ag_manager != NULL)
426+ return;
427+
428 extension->ag_manager = ag_manager_new ();
429
430 /* This populates a hash table of UOA ID -> ESource UID strings by
431@@ -410,6 +423,7 @@
432 static void
433 e_ubuntu_sources_init (EUbuntuSources *extension)
434 {
435+ extension->ag_manager = NULL;
436 extension->uoa_to_eds = g_hash_table_new_full (
437 (GHashFunc) g_direct_hash,
438 (GEqualFunc) g_direct_equal,

Subscribers

People subscribed via source and target branches