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

Proposed by Renato Araujo Oliveira Filho
Status: Superseded
Proposed branch: lp:~renatofilho/address-book-service/rename-eds-extension
Merge into: lp:address-book-service
Diff against target: 442 lines (+261/-7)
9 files modified
debian/address-book-service.install (+0/-2)
debian/control (+27/-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/rename-eds-extension
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+300613@code.launchpad.net

This proposal has been superseded by a proposal from 2016-07-20.

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

Removed extra package.

218. By Renato Araujo Oliveira Filho

Fix control rules.

219. By Renato Araujo Oliveira Filho

Fixed control line length.

220. By Renato Araujo Oliveira Filho

Bump version to 0.1.2

221. By Renato Araujo Oliveira Filho

Fixed version number.

222. By Renato Araujo Oliveira Filho

Update dev pakcage name.

223. By Renato Araujo Oliveira Filho

More package fixes.

224. By Renato Araujo Oliveira Filho

Rename install files.

225. By Renato Araujo Oliveira Filho

Trunk merged.

Unmerged revisions

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

Subscribers

People subscribed via source and target branches