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
=== modified file 'debian/address-book-service.install'
--- debian/address-book-service.install 2015-10-15 15:26:45 +0000
+++ debian/address-book-service.install 2016-07-11 14:39:54 +0000
@@ -1,5 +1,3 @@
1usr/lib/*/libubuntu-source-eds.so
2usr/lib/evolution-data-server/registry-modules/module-ubuntu-sources.so
3usr/lib/*/address-book-service/address-book-service1usr/lib/*/address-book-service/address-book-service
4usr/share/upstart/sessions/address-book-service.conf2usr/share/upstart/sessions/address-book-service.conf
5usr/share/locale/*/LC_MESSAGES/address-book-service.mo3usr/share/locale/*/LC_MESSAGES/address-book-service.mo
64
=== modified file 'debian/control'
--- debian/control 2015-10-15 15:26:45 +0000
+++ debian/control 2016-07-11 14:39:54 +0000
@@ -34,6 +34,7 @@
34Architecture: any34Architecture: any
35Multi-Arch: same35Multi-Arch: same
36Depends: address-book-updater (= ${binary:Version}),36Depends: address-book-updater (= ${binary:Version}),
37 evolution-data-server-ubuntu (= ${binary:Version}),
37 evolution-data-server(>= 3.12.11),38 evolution-data-server(>= 3.12.11),
38 libfolks-eds25,39 libfolks-eds25,
39 ${misc:Depends},40 ${misc:Depends},
@@ -78,3 +79,25 @@
78Description: Ubuntu contact service updater79Description: Ubuntu contact service updater
79 A helper program to update address book service and address book app configuration and sync files.80 A helper program to update address book service and address book app configuration and sync files.
8081
82Package: evolution-data-server-ubuntu
83Architecture: any
84Multi-Arch: same
85Depends: ${misc:Depends},
86 ${shlibs:Depends},
87Description: EDS extension used by Ubuntu apps
88 An EDS extension used by Ubuntu apps to store metadata about the online account and sync infomation.
89
90Package: evolution-data-server-ubuntu-dev
91Architecture: any
92Multi-Arch: same
93Depends: evolution-data-server-ubuntu (= ${binary:Version}),
94 ${misc:Depends},
95 ${shlibs:Depends},
96Description: EDS extension used by Ubuntu apps
97 An EDS extension used by Ubuntu apps to store metadata about the online account and sync infomation.
98 .
99 This package contains header files for evolution-data-server-ubuntu.
100
101
102
103
81104
=== added file 'debian/evolution-data-server-ubuntu-dev.install'
--- debian/evolution-data-server-ubuntu-dev.install 1970-01-01 00:00:00 +0000
+++ debian/evolution-data-server-ubuntu-dev.install 2016-07-11 14:39:54 +0000
@@ -0,0 +1,2 @@
1usr/include/evolution-data-server-ubuntu/e-source-ubuntu.h
2usr/share/pkgconfig/evolution-data-server-ubuntu.pc
03
=== added file 'debian/evolution-data-server-ubuntu.install'
--- debian/evolution-data-server-ubuntu.install 1970-01-01 00:00:00 +0000
+++ debian/evolution-data-server-ubuntu.install 2016-07-11 14:39:54 +0000
@@ -0,0 +1,2 @@
1usr/lib/evolution-data-server/registry-modules/module-ubuntu-sources.so
2usr/lib/*/libubuntu-source-eds.so
03
=== modified file 'eds-extension/CMakeLists.txt'
--- eds-extension/CMakeLists.txt 2015-07-13 20:25:36 +0000
+++ eds-extension/CMakeLists.txt 2016-07-11 14:39:54 +0000
@@ -13,12 +13,17 @@
13 OUTPUT_VARIABLE EDS_MODULES_DIR13 OUTPUT_VARIABLE EDS_MODULES_DIR
14 OUTPUT_STRIP_TRAILING_WHITESPACE14 OUTPUT_STRIP_TRAILING_WHITESPACE
15)15)
16set(UBUNTU_SOURCE_PC_FILE evolution-data-server-ubuntu.pc)
17configure_file(${UBUNTU_SOURCE_PC_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${UBUNTU_SOURCE_PC_FILE} @ONLY)
1618
17# Ubuntu Source19# Ubuntu Source
18set(UBUNTU_SOURCE_LIB ubuntu-source-eds)20set(UBUNTU_SOURCE_LIB ubuntu-source-eds)
21set(UBUNTU_SOURCE_LIB_HEADERS
22 e-source-ubuntu.h
23)
19set(UBUNTU_SOURCE_LIB_SRCS24set(UBUNTU_SOURCE_LIB_SRCS
20 e-source-ubuntu.c25 e-source-ubuntu.c
21 e-source-ubuntu.h26 ${UBUNTU_SOURCE_LIB_HEADERS}
22)27)
23add_library(${UBUNTU_SOURCE_LIB} SHARED28add_library(${UBUNTU_SOURCE_LIB} SHARED
24 ${UBUNTU_SOURCE_LIB_SRCS}29 ${UBUNTU_SOURCE_LIB_SRCS}
@@ -32,6 +37,12 @@
32install(TARGETS ${UBUNTU_SOURCE_LIB}37install(TARGETS ${UBUNTU_SOURCE_LIB}
33 LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}38 LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
34)39)
40install(FILES ${UBUNTU_SOURCE_LIB_HEADERS}
41 DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/evolution-data-server-ubuntu
42)
43install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${UBUNTU_SOURCE_PC_FILE}
44 DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/pkgconfig/
45)
3546
36# Module Ubuntu Sources47# Module Ubuntu Sources
37set(MODULE_UBUNTU_SOURCES module-ubuntu-sources)48set(MODULE_UBUNTU_SOURCES module-ubuntu-sources)
3849
=== modified file 'eds-extension/e-source-ubuntu.c'
--- eds-extension/e-source-ubuntu.c 2015-07-13 20:25:36 +0000
+++ eds-extension/e-source-ubuntu.c 2016-07-11 14:39:54 +0000
@@ -39,7 +39,9 @@
39 guint account_id;39 guint account_id;
40 gchar *application_id;40 gchar *application_id;
41 gboolean auto_remove;41 gboolean auto_remove;
42 gboolean writable;
42 gchar *provider;43 gchar *provider;
44 gchar *metadata;
43 AgAccount *account;45 AgAccount *account;
44};46};
4547
@@ -48,7 +50,9 @@
48 PROP_ACCOUNT_ID,50 PROP_ACCOUNT_ID,
49 PROP_APPLICATION_ID,51 PROP_APPLICATION_ID,
50 PROP_AUTOREMOVE,52 PROP_AUTOREMOVE,
51 PROP_ACCOUNT_PROVIDER53 PROP_ACCOUNT_PROVIDER,
54 PROP_WRITABLE,
55 PROP_METADATA
52};56};
5357
54G_DEFINE_TYPE (58G_DEFINE_TYPE (
@@ -77,6 +81,15 @@
77 e_source_ubuntu_set_autoremove (E_SOURCE_UBUNTU (object),81 e_source_ubuntu_set_autoremove (E_SOURCE_UBUNTU (object),
78 g_value_get_boolean (value));82 g_value_get_boolean (value));
79 return;83 return;
84 case PROP_WRITABLE:
85 e_source_ubuntu_set_writable (E_SOURCE_UBUNTU (object),
86 g_value_get_boolean (value));
87 return;
88
89 case PROP_METADATA:
90 e_source_ubuntu_set_metadata (E_SOURCE_UBUNTU (object),
91 g_value_get_string (value));
92 return;
80 }93 }
8194
82 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);95 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -109,6 +122,15 @@
109 e_source_ubuntu_dup_account_provider (E_SOURCE_UBUNTU (object)));122 e_source_ubuntu_dup_account_provider (E_SOURCE_UBUNTU (object)));
110 return;123 return;
111124
125 case PROP_WRITABLE:
126 g_value_set_boolean (value,
127 e_source_ubuntu_get_writable (E_SOURCE_UBUNTU (object)));
128 return;
129
130 case PROP_METADATA:
131 g_value_take_string (value,
132 e_source_ubuntu_dup_metadata(E_SOURCE_UBUNTU (object)));
133 return;
112 }134 }
113135
114 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);136 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -128,6 +150,7 @@
128150
129 g_free (priv->application_id);151 g_free (priv->application_id);
130 g_free (priv->provider);152 g_free (priv->provider);
153 g_free (priv->metadata);
131154
132 /* Chain up to parent's finalize() method. */155 /* Chain up to parent's finalize() method. */
133 G_OBJECT_CLASS (e_source_ubuntu_parent_class)->finalize (object);156 G_OBJECT_CLASS (e_source_ubuntu_parent_class)->finalize (object);
@@ -190,6 +213,32 @@
190213
191 g_object_class_install_property (214 g_object_class_install_property (
192 object_class,215 object_class,
216 PROP_WRITABLE,
217 g_param_spec_boolean (
218 "writable",
219 "Writable source",
220 "Writable source",
221 TRUE,
222 G_PARAM_READWRITE |
223 G_PARAM_CONSTRUCT |
224 G_PARAM_STATIC_STRINGS |
225 E_SOURCE_PARAM_SETTING));
226
227 g_object_class_install_property (
228 object_class,
229 PROP_METADATA,
230 g_param_spec_string (
231 "metadata",
232 "metadata",
233 "Source metadata",
234 NULL,
235 G_PARAM_READWRITE |
236 G_PARAM_CONSTRUCT |
237 G_PARAM_STATIC_STRINGS |
238 E_SOURCE_PARAM_SETTING));
239
240 g_object_class_install_property (
241 object_class,
193 PROP_ACCOUNT_PROVIDER,242 PROP_ACCOUNT_PROVIDER,
194 g_param_spec_string (243 g_param_spec_string (
195 "account-provider",244 "account-provider",
@@ -260,6 +309,7 @@
260 if (account_id != 0) {309 if (account_id != 0) {
261 AgManager *manager = ag_manager_new ();310 AgManager *manager = ag_manager_new ();
262 extension->priv->account = ag_manager_get_account (manager, account_id);311 extension->priv->account = ag_manager_get_account (manager, account_id);
312 g_object_unref (manager);
263 }313 }
264314
265 g_mutex_unlock (&extension->priv->property_lock);315 g_mutex_unlock (&extension->priv->property_lock);
@@ -408,3 +458,133 @@
408458
409 g_object_notify (G_OBJECT (extension), "auto-remove");459 g_object_notify (G_OBJECT (extension), "auto-remove");
410}460}
461
462/**
463 * e_source_ubuntu_get_writable:
464 * @extension: an #ESourceUbuntu
465 *
466 * This can be used as extra flag.
467 * For example for sources that are created from read-only remote sources.
468 *
469 * Returns: True if the source is marked as writable or False if not.
470 *
471 **/
472gboolean
473e_source_ubuntu_get_writable(ESourceUbuntu *extension)
474{
475 g_return_val_if_fail (E_IS_SOURCE_UBUNTU (extension), FALSE);
476
477 return extension->priv->writable;
478}
479
480/**
481 * e_source_ubuntu_set_writable:
482 * @extension: an #ESourceUbuntu
483 *
484 * This can be used as extra flag.
485 * For example for sources that are created from read-only remote sources.
486 *
487 * Sets if the source should be considered writable or not.
488 *
489 **/
490void
491e_source_ubuntu_set_writable(ESourceUbuntu *extension,
492 gboolean flag)
493{
494 g_return_if_fail (E_IS_SOURCE_UBUNTU (extension));
495
496 g_mutex_lock (&extension->priv->property_lock);
497
498 if (extension->priv->writable == flag) {
499 g_mutex_unlock (&extension->priv->property_lock);
500 return;
501 }
502
503 extension->priv->writable = flag;
504
505 g_mutex_unlock (&extension->priv->property_lock);
506
507 g_object_notify (G_OBJECT (extension), "writable");
508}
509
510/**
511 * e_source_ubuntu_get_metadata:
512 * @extension: an #ESourceUbuntu
513 *
514 * Returns the metadata string of the application associated
515 * with the #ESource to which @extension belongs. Can be %NULL or an empty
516 * string.
517 *
518 * Returns: the associated metadata
519 *
520 **/
521const gchar *
522e_source_ubuntu_get_metadata (ESourceUbuntu *extension)
523{
524 g_return_val_if_fail (E_IS_SOURCE_UBUNTU (extension), NULL);
525
526 return extension->priv->metadata;
527}
528
529/**
530 * e_source_ubuntu_dup_metadata:
531 * @extension: an #ESourceUbuntu
532 *
533 * Thread-safe variation of e_source_ubuntu_get_metadata().
534 * Use this function when accessing @extension from multiple threads.
535 *
536 * The returned string should be freed with g_free() when no longer needed.
537 *
538 * Returns: a newly-allocated copy of #ESourceUbuntu:metadata
539 *
540 **/
541gchar *
542e_source_ubuntu_dup_metadata (ESourceUbuntu *extension)
543{
544 const gchar *metadata;
545 gchar *duplicate;
546
547 g_return_val_if_fail (E_IS_SOURCE_UBUNTU (extension), NULL);
548
549 g_mutex_lock (&extension->priv->property_lock);
550
551 metadata = e_source_ubuntu_get_metadata(extension);
552 duplicate = g_strdup (metadata);
553
554 g_mutex_unlock (&extension->priv->property_lock);
555
556 return duplicate;
557}
558
559/**
560 * e_source_ubuntu_set_metadata:
561 * @extension: an #ESourceUbuntu
562 * @metadata: (allow-none): the associated metadata, or %NULL
563 *
564 * Sets the metadata associated with the #ESource to which @extension belongs.
565 *
566 * The internal copy of @metadata is automatically stripped of leading
567 * and trailing whitespace. If the resulting string is empty, %NULL is set
568 * instead.
569 *
570 **/
571void
572e_source_ubuntu_set_metadata (ESourceUbuntu *extension,
573 const gchar *metadata)
574{
575 g_return_if_fail (E_IS_SOURCE_UBUNTU (extension));
576
577 g_mutex_lock (&extension->priv->property_lock);
578
579 if (g_strcmp0 (extension->priv->metadata, metadata) == 0) {
580 g_mutex_unlock (&extension->priv->property_lock);
581 return;
582 }
583
584 g_free (extension->priv->metadata);
585 extension->priv->metadata = e_util_strdup_strip (metadata);
586
587 g_mutex_unlock (&extension->priv->property_lock);
588
589 g_object_notify (G_OBJECT (extension), "metadata");
590}
411591
=== modified file 'eds-extension/e-source-ubuntu.h'
--- eds-extension/e-source-ubuntu.h 2015-07-13 20:25:36 +0000
+++ eds-extension/e-source-ubuntu.h 2016-07-11 14:39:54 +0000
@@ -87,9 +87,18 @@
87void e_source_ubuntu_set_autoremove (ESourceUbuntu *extension,87void e_source_ubuntu_set_autoremove (ESourceUbuntu *extension,
88 gboolean flag);88 gboolean flag);
8989
90gboolean e_source_ubuntu_get_writable (ESourceUbuntu *extension);
91void e_source_ubuntu_set_writable (ESourceUbuntu *extension,
92 gboolean flag);
93
90const gchar * e_source_ubuntu_get_account_provider(ESourceUbuntu *extension);94const gchar * e_source_ubuntu_get_account_provider(ESourceUbuntu *extension);
91gchar * e_source_ubuntu_dup_account_provider(ESourceUbuntu *extension);95gchar * e_source_ubuntu_dup_account_provider(ESourceUbuntu *extension);
9296
97const gchar * e_source_ubuntu_get_metadata (ESourceUbuntu *extension);
98gchar * e_source_ubuntu_dup_metadata (ESourceUbuntu *extension);
99void e_source_ubuntu_set_metadata (ESourceUbuntu *extension,
100 const gchar *metadata);
101
93G_END_DECLS102G_END_DECLS
94103
95#endif /* E_SOURCE_UBUNTU_H */104#endif /* E_SOURCE_UBUNTU_H */
96105
=== added file 'eds-extension/evolution-data-server-ubuntu.pc.in'
--- eds-extension/evolution-data-server-ubuntu.pc.in 1970-01-01 00:00:00 +0000
+++ eds-extension/evolution-data-server-ubuntu.pc.in 2016-07-11 14:39:54 +0000
@@ -0,0 +1,11 @@
1libdir=@CMAKE_INSTALL_FULL_LIBDIR@
2includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/evolution-data-server-ubuntu/
3
4Name: evolution-data-server-ubuntu
5Description: EDS extension used by Ubuntu apps
6Version: 1.0
7Libs: -L${libdir} -lubuntu-source-eds
8Cflags: -I${includedir}
9Requires: libedataserver-1.2
10
11
012
=== modified file 'eds-extension/module-ubuntu-sources.c'
--- eds-extension/module-ubuntu-sources.c 2015-12-11 18:01:33 +0000
+++ eds-extension/module-ubuntu-sources.c 2016-07-11 14:39:54 +0000
@@ -128,6 +128,10 @@
128 GSList *link;128 GSList *link;
129 GQueue trash = G_QUEUE_INIT;129 GQueue trash = G_QUEUE_INIT;
130130
131 if (ag_account_id == 0) {
132 return;
133 }
134
131 server = ubuntu_sources_get_server (extension);135 server = ubuntu_sources_get_server (extension);
132136
133 eds_id_list = g_hash_table_lookup (extension->uoa_to_eds,137 eds_id_list = g_hash_table_lookup (extension->uoa_to_eds,
@@ -166,19 +170,25 @@
166{170{
167 ESourceUbuntu *ubuntu_ext;171 ESourceUbuntu *ubuntu_ext;
168 AgAccountId ag_account_id;172 AgAccountId ag_account_id;
169 AgAccount *ag_account;173 AgAccount *ag_account = NULL;
170174
171 g_debug("Register new source: %s/%s", e_source_get_display_name(source),175 g_debug("Register new source: %s/%s", e_source_get_display_name(source),
172 e_source_get_uid(source));176 e_source_get_uid(source));
173177
174 if (!e_source_has_extension (source, E_SOURCE_EXTENSION_UBUNTU)) {178 if (!e_source_has_extension (source, E_SOURCE_EXTENSION_UBUNTU)) {
179 g_debug("\tSource does not have ubuntu extension!");
175 return FALSE;180 return FALSE;
176 }181 }
177182
178 ubuntu_ext = e_source_get_extension (source, E_SOURCE_EXTENSION_UBUNTU);183 ubuntu_ext = e_source_get_extension (source, E_SOURCE_EXTENSION_UBUNTU);
179 ag_account_id = e_source_ubuntu_get_account_id (ubuntu_ext);184 ag_account_id = e_source_ubuntu_get_account_id (ubuntu_ext);
180 ag_account = ag_manager_get_account (extension->ag_manager,185 if (ag_account_id > 0) {
181 ag_account_id);186 ag_account = ag_manager_get_account (extension->ag_manager,
187 ag_account_id);
188 } else {
189 // accept sources with empty account
190 return TRUE;
191 }
182192
183 if (ag_account) {193 if (ag_account) {
184 GSList *eds_id_list;194 GSList *eds_id_list;
@@ -300,6 +310,9 @@
300{310{
301 g_debug("loading ubuntu sources");311 g_debug("loading ubuntu sources");
302312
313 if (extension->ag_manager != NULL)
314 return;
315
303 extension->ag_manager = ag_manager_new ();316 extension->ag_manager = ag_manager_new ();
304317
305 /* This populates a hash table of UOA ID -> ESource UID strings by318 /* This populates a hash table of UOA ID -> ESource UID strings by
@@ -410,6 +423,7 @@
410static void423static void
411e_ubuntu_sources_init (EUbuntuSources *extension)424e_ubuntu_sources_init (EUbuntuSources *extension)
412{425{
426 extension->ag_manager = NULL;
413 extension->uoa_to_eds = g_hash_table_new_full (427 extension->uoa_to_eds = g_hash_table_new_full (
414 (GHashFunc) g_direct_hash,428 (GHashFunc) g_direct_hash,
415 (GEqualFunc) g_direct_equal,429 (GEqualFunc) g_direct_equal,

Subscribers

People subscribed via source and target branches