Merge lp:~renatofilho/buteo-sync-plugins-contacts/rename-account-service into lp:buteo-sync-plugins-contacts

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Michael Sheldon
Approved revision: 17
Merged at revision: 7
Proposed branch: lp:~renatofilho/buteo-sync-plugins-contacts/rename-account-service
Merge into: lp:buteo-sync-plugins-contacts
Diff against target: 200 lines (+36/-16)
9 files modified
accounts/CMakeLists.txt (+1/-1)
accounts/address-book-app.application (+1/-1)
accounts/google-buteo-contacts.service (+2/-2)
buteo-contact-client/UAuth.cpp (+5/-0)
buteo-contact-client/UContactsBackend.cpp (+10/-4)
buteo-contact-client/UContactsClient.cpp (+14/-5)
google/GContactsClient.cpp (+1/-1)
google/xmls/sync/CMakeLists.txt (+1/-1)
google/xmls/sync/google-buteo-contacts.xml (+1/-1)
To merge this branch: bzr merge lp:~renatofilho/buteo-sync-plugins-contacts/rename-account-service
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Michael Sheldon (community) Approve
Review via email: mp+273532@code.launchpad.net

Commit message

Append 'buteo' on online account files to avoid conflict with EDS files.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
8. By Renato Araujo Oliveira Filho

Renamed uoa related service names, to avoid conflict with old services.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
9. By Renato Araujo Oliveira Filho

Renamed online account service to 'google-contacts'.

10. By Renato Araujo Oliveira Filho

Revert category name change.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
11. By Renato Araujo Oliveira Filho

Rename service id to avoid conflicts with EDS.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
12. By Renato Araujo Oliveira Filho

Renamed sync profile teplate to the new service id name.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
13. By Renato Araujo Oliveira Filho

Fixed cmake with the new file name.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
14. By Renato Araujo Oliveira Filho

Fixed typo on filename.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
15. By Renato Araujo Oliveira Filho

Updated missing string with the new service name.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
16. By Renato Araujo Oliveira Filho

Append a extra space in source name to avoid problems with syncevolution.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Are there any related MPs required for this MP to build/function as expected?
NO

Is your branch in sync with latest trunk?
YES

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
YES

Did you successfully run all tests found in your component's Test Plan on device or emulator?
YES

If you changed the UI, was the change specified/approved by design?
NO UI CHANGE.

If you changed UI labels, did you update the pot file?
NO LABEL CHANGED

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
NO PACKAGE CHANGED

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Code looks good

review: Approve
17. By Renato Araujo Oliveira Filho

Add log info message to be printed on log level 6;

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'accounts/CMakeLists.txt'
--- accounts/CMakeLists.txt 2015-07-09 15:57:07 +0000
+++ accounts/CMakeLists.txt 2015-10-15 19:20:43 +0000
@@ -1,5 +1,5 @@
1set(SERVICE_FILES1set(SERVICE_FILES
2 google-contacts.service2 google-buteo-contacts.service
3)3)
4set(APPLICATION_FILES4set(APPLICATION_FILES
5 address-book-app.application5 address-book-app.application
66
=== modified file 'accounts/address-book-app.application'
--- accounts/address-book-app.application 2015-07-09 15:57:07 +0000
+++ accounts/address-book-app.application 2015-10-15 19:20:43 +0000
@@ -4,7 +4,7 @@
4 <desktop-entry>address-book-app.desktop</desktop-entry>4 <desktop-entry>address-book-app.desktop</desktop-entry>
55
6 <service-types>6 <service-types>
7 <service-type id="contacts">7 <service-type id="buteo-contacts">
8 <description>Synchronize your contacts</description>8 <description>Synchronize your contacts</description>
9 </service-type>9 </service-type>
10 </service-types>10 </service-types>
1111
=== renamed file 'accounts/google-contacts.service' => 'accounts/google-buteo-contacts.service'
--- accounts/google-contacts.service 2015-07-09 15:57:07 +0000
+++ accounts/google-buteo-contacts.service 2015-10-15 19:20:43 +0000
@@ -1,6 +1,6 @@
1<?xml version="1.0" encoding="UTF-8"?>1<?xml version="1.0" encoding="UTF-8"?>
2<service id="google-contacts">2<service id="google-buteo-contacts">
3 <type>contacts</type>3 <type>buteo-contacts</type>
4 <name>Google Contacts</name>4 <name>Google Contacts</name>
5 <provider>google</provider>5 <provider>google</provider>
6</service>6</service>
77
=== modified file 'buteo-contact-client/UAuth.cpp'
--- buteo-contact-client/UAuth.cpp 2015-07-21 19:15:51 +0000
+++ buteo-contact-client/UAuth.cpp 2015-10-15 19:20:43 +0000
@@ -69,6 +69,11 @@
69{69{
70 Q_D(UAuth);70 Q_D(UAuth);
7171
72 if ((accountId == 0) || serviceName.isEmpty()) {
73 LOG_DEBUG("Invalid account id or service name:" << accountId << serviceName);
74 return false;
75 }
76
72 d->mServiceName = serviceName;77 d->mServiceName = serviceName;
73 if (d->mAccountManager && d_ptr->mAccount) {78 if (d->mAccountManager && d_ptr->mAccount) {
74 LOG_DEBUG("GAuth already initialized");79 LOG_DEBUG("GAuth already initialized");
7580
=== modified file 'buteo-contact-client/UContactsBackend.cpp'
--- buteo-contact-client/UContactsBackend.cpp 2015-09-16 13:32:10 +0000
+++ buteo-contact-client/UContactsBackend.cpp 2015-10-15 19:20:43 +0000
@@ -97,7 +97,13 @@
97 contact.setType(QContactType::TypeGroup);97 contact.setType(QContactType::TypeGroup);
9898
99 QContactDisplayLabel label;99 QContactDisplayLabel label;
100 label.setLabel(syncTarget);100 //WORKAROUND: append a extra space in the end of the source name
101 //this is necessary to avoid conflict with old sources used by syncevolution
102 //SyncEvolution sync profile sync contacts from gooble based on the source name
103 //creating a new source with the same name could cause the sync to happen in the
104 //wrong source
105 //FIXME: remove this when syncevolution get removed from image
106 label.setLabel(syncTarget + " ");
101 contact.saveDetail(&label);107 contact.saveDetail(&label);
102108
103 // set the new source as default109 // set the new source as default
@@ -333,11 +339,11 @@
333 QMap<int, QContactManager::Error> errors;339 QMap<int, QContactManager::Error> errors;
334 QMap<int, UContactsStatus> statusMap;340 QMap<int, UContactsStatus> statusMap;
335341
336 if(iMgr->removeContacts(aContactIDList , &errors)) {342 if(aContactIDList.isEmpty() || iMgr->removeContacts(aContactIDList , &errors)) {
337 LOG_DEBUG("Successfully Removed all contacts ");343 LOG_DEBUG("Successfully Removed all contacts ");
338 }344 }
339 else {345 else {
340 LOG_WARNING("Failed Removing Contacts");346 LOG_WARNING("Failed Removing Contacts" << errors);
341 }347 }
342348
343 // QContactManager will populate errorMap only for errors, but we use this as a status map,349 // QContactManager will populate errorMap only for errors, but we use this as a status map,
@@ -356,8 +362,8 @@
356 }362 }
357 else363 else
358 {364 {
359 LOG_DEBUG("contact with id " << contactId << " and index " << i <<" is in error");
360 QContactManager::Error errorCode = errors.value(i);365 QContactManager::Error errorCode = errors.value(i);
366 LOG_WARNING("Removing contact with id " << contactId << " and index " << i <<" is an error" << errorCode);
361 status.errorCode = errorCode;367 status.errorCode = errorCode;
362 statusMap.insert(i, status);368 statusMap.insert(i, status);
363 }369 }
364370
=== modified file 'buteo-contact-client/UContactsClient.cpp'
--- buteo-contact-client/UContactsClient.cpp 2015-09-24 17:49:06 +0000
+++ buteo-contact-client/UContactsClient.cpp 2015-10-15 19:20:43 +0000
@@ -49,8 +49,13 @@
49 : mAuth(0),49 : mAuth(0),
50 mContactBackend(0),50 mContactBackend(0),
51 mRemoteSource(0),51 mRemoteSource(0),
52 mSlowSync(false),
53 mAborted(false),
52 mServiceName(serviceName),54 mServiceName(serviceName),
53 mAborted(false)55 mProgress(0),
56 mAccountId(0),
57 mSyncDirection(Buteo::SyncProfile::SYNC_DIRECTION_TWO_WAY),
58 mConflictResPolicy(Buteo::SyncProfile::CR_POLICY_PREFER_REMOTE_CHANGES)
54 {59 {
55 }60 }
5661
@@ -115,6 +120,7 @@
115 return false;120 return false;
116 }121 }
117122
123 LOG_INFO ("Init sync for account:" << d->mAccountId << d->mServiceName);
118 d->mAuth = crateAuthenticator(this);124 d->mAuth = crateAuthenticator(this);
119 if (!d->mAuth || !d->mAuth->init(d->mAccountId, d->mServiceName)) {125 if (!d->mAuth || !d->mAuth->init(d->mAccountId, d->mServiceName)) {
120 LOG_CRITICAL("Fail to create auth object");126 LOG_CRITICAL("Fail to create auth object");
@@ -135,8 +141,6 @@
135 goto init_fail;141 goto init_fail;
136 }142 }
137143
138 d->mItemResults.insert(syncTargetId(), Buteo::DatabaseResults());
139
140 // sign in.144 // sign in.
141 connect(d->mAuth, SIGNAL(success()), SLOT(start()));145 connect(d->mAuth, SIGNAL(success()), SLOT(start()));
142 connect(d->mAuth, SIGNAL(failed()), SLOT(onAuthenticationError()));146 connect(d->mAuth, SIGNAL(failed()), SLOT(onAuthenticationError()));
@@ -150,7 +154,8 @@
150 // Take necessary action when sync is finished154 // Take necessary action when sync is finished
151 connect(this,155 connect(this,
152 SIGNAL(syncFinished(Sync::SyncStatus)),156 SIGNAL(syncFinished(Sync::SyncStatus)),
153 SLOT(onSyncFinished(Sync::SyncStatus)));157 SLOT(onSyncFinished(Sync::SyncStatus)),
158 Qt::QueuedConnection);
154159
155 return true;160 return true;
156161
@@ -300,11 +305,13 @@
300 return false;305 return false;
301 }306 }
302307
303 if (!d->mContactBackend->init(d->mAccountId, d->mAuth->accountDisplayName())) {308 if (!d->mContactBackend->init(d->mAccountId,
309 d->mAuth->accountDisplayName())) {
304 LOG_WARNING("Fail to init contact backend");310 LOG_WARNING("Fail to init contact backend");
305 return false;311 return false;
306 }312 }
307313
314 d->mItemResults.insert(syncTargetId(), Buteo::DatabaseResults());
308 switch (d->mSyncDirection)315 switch (d->mSyncDirection)
309 {316 {
310 case Buteo::SyncProfile::SYNC_DIRECTION_TWO_WAY:317 case Buteo::SyncProfile::SYNC_DIRECTION_TWO_WAY:
@@ -788,6 +795,8 @@
788 FUNCTION_CALL_TRACE;795 FUNCTION_CALL_TRACE;
789 Q_D(UContactsClient);796 Q_D(UContactsClient);
790797
798 LOG_INFO("Sync finished with state:" << aState);
799
791 switch(aState)800 switch(aState)
792 {801 {
793 case Sync::SYNC_ERROR:802 case Sync::SYNC_ERROR:
794803
=== modified file 'google/GContactsClient.cpp'
--- google/GContactsClient.cpp 2015-07-21 19:15:51 +0000
+++ google/GContactsClient.cpp 2015-10-15 19:20:43 +0000
@@ -38,7 +38,7 @@
3838
39#include "buteosyncfw_p.h"39#include "buteosyncfw_p.h"
4040
41static const QString GOOGLE_CONTACTS_SERVICE ("google-contacts");41static const QString GOOGLE_CONTACTS_SERVICE ("google-buteo-contacts");
4242
43extern "C" GContactsClient* createPlugin(const QString& aPluginName,43extern "C" GContactsClient* createPlugin(const QString& aPluginName,
44 const Buteo::SyncProfile& aProfile,44 const Buteo::SyncProfile& aProfile,
4545
=== modified file 'google/xmls/sync/CMakeLists.txt'
--- google/xmls/sync/CMakeLists.txt 2015-07-09 15:57:07 +0000
+++ google/xmls/sync/CMakeLists.txt 2015-10-15 19:20:43 +0000
@@ -1,3 +1,3 @@
1install(FILES google-contacts.xml1install(FILES google-buteo-contacts.xml
2 DESTINATION "/etc/buteo/profiles/sync"2 DESTINATION "/etc/buteo/profiles/sync"
3)3)
44
=== renamed file 'google/xmls/sync/google-contacts.xml' => 'google/xmls/sync/google-buteo-contacts.xml'
--- google/xmls/sync/google-contacts.xml 2015-07-17 13:52:41 +0000
+++ google/xmls/sync/google-buteo-contacts.xml 2015-10-15 19:20:43 +0000
@@ -1,7 +1,7 @@
1<?xml version="1.0" encoding="UTF-8"?>1<?xml version="1.0" encoding="UTF-8"?>
2<profile type="sync" name="google-contacts">2<profile type="sync" name="google-contacts">
3 <key value="contacts" name="category"/>3 <key value="contacts" name="category"/>
4 <key value="google-contacts" name="remote_service_name"/>4 <key value="google-buteo-contacts" name="remote_service_name"/>
5 <key value="online" name="destinationtype"/>5 <key value="online" name="destinationtype"/>
6 <key value="false" name="enabled"/>6 <key value="false" name="enabled"/>
7 <key value="true" name="hidden"/>7 <key value="true" name="hidden"/>

Subscribers

People subscribed via source and target branches