Merge lp:~renatofilho/address-book-app/no-updater into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Rejected
Rejected by: Renato Araujo Oliveira Filho
Proposed branch: lp:~renatofilho/address-book-app/no-updater
Merge into: lp:address-book-app
Diff against target: 248 lines (+8/-100)
7 files modified
src/app/addressbookapp.cpp (+0/-47)
src/app/addressbookapp.h (+0/-16)
src/imports/ABContactListPage.qml (+4/-10)
src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml (+3/-17)
src/imports/Ubuntu/Contacts/ContactListView.qml (+1/-3)
src/imports/Ubuntu/Contacts/contacts.cpp (+0/-6)
src/imports/Ubuntu/Contacts/contacts.h (+0/-1)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/no-updater
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+273702@code.launchpad.net

Commit message

Removed code used with 'updater'.

'Updater' was a tool to help in the migration from syncevoltuion to buteo.

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

Removed missing function call.

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)

Unmerged revisions

484. By Renato Araujo Oliveira Filho

Removed missing function call.

483. By Renato Araujo Oliveira Filho

Removed code used with 'updater'.

'Updater' was a tool to help in the migration from syncevoltuion to buteo.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/addressbookapp.cpp'
2--- src/app/addressbookapp.cpp 2015-09-29 19:03:44 +0000
3+++ src/app/addressbookapp.cpp 2015-10-07 14:45:30 +0000
4@@ -119,7 +119,6 @@
5 bool AddressBookApp::setup()
6 {
7 installIconPath();
8- connectWithServer();
9
10 bool fullScreen = false;
11
12@@ -279,29 +278,6 @@
13 }
14 }
15
16-void AddressBookApp::startUpdate()
17-{
18- if (m_updateWatcher) {
19- return;
20- }
21-
22- QDBusMessage startUpdateCall = QDBusMessage::createMethodCall("com.canonical.pim.updater",
23- "/com/canonical/pim/Updater",
24- "com.canonical.pim.Updater",
25- "startUpdate");
26- QDBusPendingCall pcall = QDBusConnection::sessionBus().asyncCall(startUpdateCall);
27- m_updateWatcher.reset(new QDBusPendingCallWatcher(pcall, this));
28- QObject::connect(m_updateWatcher.data(), SIGNAL(finished(QDBusPendingCallWatcher*)),
29- this, SLOT(onUpdateCallFinished(QDBusPendingCallWatcher*)));
30- Q_EMIT updatingChanged();
31-}
32-
33-void AddressBookApp::onUpdateCallFinished(QDBusPendingCallWatcher *watcher)
34-{
35- m_updateWatcher.reset(0);
36- Q_EMIT updatingChanged();
37-}
38-
39 void AddressBookApp::parseUrl(const QString &arg)
40 {
41 QUrl url = QUrl::fromPercentEncoding(arg.toUtf8());
42@@ -421,18 +397,6 @@
43 m_pickingMode = (name == "pick");
44 }
45
46-void AddressBookApp::connectWithServer()
47-{
48- m_server.reset(new QDBusInterface("com.canonical.pim",
49- "/com/canonical/pim/AddressBook",
50- "com.canonical.pim.AddressBook"));
51- if (!m_server->isValid()) {
52- qWarning() << "Fail to connect with pim service.";
53- }
54- connect(m_server.data(), SIGNAL(safeModeChanged()), SIGNAL(serverSafeModeChanged()));
55- Q_EMIT serverSafeModeChanged();
56-}
57-
58 void AddressBookApp::activateWindow()
59 {
60 if (m_view) {
61@@ -463,14 +427,3 @@
62 {
63 return m_netManager->isOnline();
64 }
65-
66-bool AddressBookApp::serverSafeMode() const
67-{
68- QDBusReply<bool> reply = m_server->call("safeMode");
69- return reply.value();
70-}
71-
72-bool AddressBookApp::updating() const
73-{
74- return !m_updateWatcher.isNull();
75-}
76
77=== modified file 'src/app/addressbookapp.h'
78--- src/app/addressbookapp.h 2015-09-16 01:08:07 +0000
79+++ src/app/addressbookapp.h 2015-10-07 14:45:30 +0000
80@@ -18,8 +18,6 @@
81 #define ADDRESSBOOK_APP_H
82
83 #include <QtCore/QObject>
84-#include <QtDBus/QDBusInterface>
85-#include <QtDBus/QDBusPendingCallWatcher>
86 #include <QtGui/QGuiApplication>
87 #include <QtQuick/QQuickView>
88 #include <QtNetwork/QNetworkConfigurationManager>
89@@ -30,8 +28,6 @@
90 Q_PROPERTY(bool firstRun READ isFirstRun CONSTANT)
91 Q_PROPERTY(QString callbackApplication READ callbackApplication WRITE setCallbackApplication NOTIFY callbackApplicationChanged)
92 Q_PROPERTY(bool isOnline READ isOnline NOTIFY isOnlineChanged)
93- Q_PROPERTY(bool serverSafeMode READ serverSafeMode NOTIFY serverSafeModeChanged)
94- Q_PROPERTY(bool updating READ updating NOTIFY updatingChanged)
95
96 public:
97 AddressBookApp(int &argc, char **argv);
98@@ -43,14 +39,10 @@
99 void setCallbackApplication(const QString &application);
100
101 bool isOnline() const;
102- bool serverSafeMode() const;
103- bool updating() const;
104
105 Q_SIGNALS:
106 void callbackApplicationChanged();
107 void isOnlineChanged();
108- void serverSafeModeChanged();
109- void updatingChanged();
110
111 public Q_SLOTS:
112 void activateWindow();
113@@ -60,23 +52,15 @@
114 bool isFirstRun() const;
115 void unsetFirstRun() const;
116 void goBackToSourceApp();
117- void startUpdate();
118-
119 // debug
120 void elapsed() const;
121
122-private Q_SLOTS:
123- void onUpdateCallFinished(QDBusPendingCallWatcher *watcher);
124-
125 private:
126 void callQMLMethod(const QString name, QStringList args);
127- void connectWithServer();
128
129 private:
130 QQuickView *m_view;
131 QScopedPointer<QNetworkConfigurationManager> m_netManager;
132- QScopedPointer<QDBusInterface> m_server;
133- QScopedPointer<QDBusPendingCallWatcher> m_updateWatcher;
134 QString m_initialArg;
135 QString m_callbackApplication;
136 bool m_viewReady;
137
138=== modified file 'src/imports/ABContactListPage.qml'
139--- src/imports/ABContactListPage.qml 2015-09-16 01:08:07 +0000
140+++ src/imports/ABContactListPage.qml 2015-10-07 14:45:30 +0000
141@@ -226,17 +226,11 @@
142 }
143 },
144 Action {
145- visible: (application.isOnline && (contactList.syncEnabled || application.serverSafeMode))
146+ visible: (application.isOnline && contactList.syncEnabled)
147 text: contactList.syncing ? i18n.tr("Syncing") : i18n.tr("Sync")
148- iconName: application.serverSafeMode ? "reset" : "reload"
149- enabled: !contactList.syncing && !application.updating
150- onTriggered: {
151- if (application.serverSafeMode) {
152- application.startUpdate()
153- } else {
154- contactList.sync()
155- }
156- }
157+ iconName: "reload"
158+ enabled: !contactList.syncing
159+ onTriggered: contactList.sync()
160 },
161 Action {
162 text: i18n.tr("Settings")
163
164=== modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml'
165--- src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml 2015-09-29 19:03:44 +0000
166+++ src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml 2015-10-07 14:45:30 +0000
167@@ -422,23 +422,9 @@
168 id: aletMessageDialog
169
170 title: i18n.dtr("address-book-app", "Contact Editor")
171- text: {
172- if (ContactsUI.Contacts.updateIsRunning()) {
173- return i18n.dtr("address-book-app",
174- "Your <b>%1</b> contact sync account needs to be upgraded.\nWait until the upgrade is complete to edit contacts.")
175- .arg(contactEditor.contact.syncTarget.syncTarget)
176- }
177- if (Qt.application.name === "AddressBookApp") {
178- i18n.dtr("address-book-app",
179- "Your <b>%1</b> contact sync account needs to be upgraded. Use the sync button to upgrade the Contacts app.\nOnly local contacts will be editable until upgrade is complete.")
180- .arg(contactEditor.contact.syncTarget.syncTarget)
181- } else {
182- i18n.dtr("address-book-app",
183- "Your <b>%1</b> contact sync account needs to be upgraded by running Contacts app.\nOnly local contacts will be editable until upgrade is complete.")
184- .arg(contactEditor.contact.syncTarget.syncTarget);
185- }
186- }
187-
188+ text: i18n.dtr("address-book-app",
189+ "Your address book <b>%1</b> is read-only. You can not edit this contact at the moment.")
190+ .arg(contactEditor.contact.syncTarget.syncTarget);
191 Button {
192 text: i18n.dtr("address-book-app", "Close")
193 onClicked: PopupUtils.close(aletMessageDialog)
194
195=== modified file 'src/imports/Ubuntu/Contacts/ContactListView.qml'
196--- src/imports/Ubuntu/Contacts/ContactListView.qml 2015-09-18 13:18:40 +0000
197+++ src/imports/Ubuntu/Contacts/ContactListView.qml 2015-10-07 14:45:30 +0000
198@@ -217,7 +217,7 @@
199 // Using only '(buteoSync.syncProfilesByCategory("contacts").length > 0)'
200 // the value will be checked only on app startup
201 readonly property bool syncEnabled: (buteoSync.profilesCount > 0) &&
202- (buteoSync.syncProfilesByCategory("contacts").length > 0)
203+ (buteoSync.syncProfilesByCategory("buteo-contacts").length > 0)
204 /*!
205 \qmlproperty bool busy
206
207@@ -231,8 +231,6 @@
208 */
209 property bool showBusyIndicator: true
210
211- property var _busyDialog: null
212-
213 /*!
214 This handler is called when the selection mode is finished without be canceled
215 */
216
217=== modified file 'src/imports/Ubuntu/Contacts/contacts.cpp'
218--- src/imports/Ubuntu/Contacts/contacts.cpp 2015-09-18 13:18:40 +0000
219+++ src/imports/Ubuntu/Contacts/contacts.cpp 2015-10-07 14:45:30 +0000
220@@ -22,7 +22,6 @@
221 #include <QtCore/QDebug>
222 #include <QtCore/QDir>
223 #include <QtCore/QUrl>
224-#include <QtCore/QLockFile>
225
226 #include "config.h"
227
228@@ -105,8 +104,3 @@
229 {
230 return QFile::remove(file.toLocalFile());
231 }
232-
233-bool UbuntuContacts::updateIsRunning() const
234-{
235- return QFile::exists(QDir::tempPath() + "/address-book-updater.lock");
236-}
237
238=== modified file 'src/imports/Ubuntu/Contacts/contacts.h'
239--- src/imports/Ubuntu/Contacts/contacts.h 2015-09-18 13:18:40 +0000
240+++ src/imports/Ubuntu/Contacts/contacts.h 2015-10-07 14:45:30 +0000
241@@ -36,7 +36,6 @@
242 Q_INVOKABLE QUrl copyImage(QObject *contact, const QUrl &imageUrl);
243 Q_INVOKABLE bool containsLetters(const QString &value);
244 Q_INVOKABLE bool removeFile(const QUrl &file);
245- Q_INVOKABLE bool updateIsRunning() const;
246 };
247
248 #endif //_UBUNTU_CONTACTS_H_

Subscribers

People subscribed via source and target branches