Merge lp:~aacid/ubuntu-system-settings-online-accounts/54_tests into lp:ubuntu-system-settings-online-accounts

Proposed by Albert Astals Cid on 2015-02-03
Status: Merged
Approved by: Alberto Mardegan on 2015-02-03
Approved revision: 227
Merged at revision: 228
Proposed branch: lp:~aacid/ubuntu-system-settings-online-accounts/54_tests
Merge into: lp:ubuntu-system-settings-online-accounts
Diff against target: 35 lines (+11/-1)
1 file modified
online-accounts-service/ui-proxy.cpp (+11/-1)
To merge this branch: bzr merge lp:~aacid/ubuntu-system-settings-online-accounts/54_tests
Reviewer Review Type Date Requested Status
Alberto Mardegan (community) 2015-02-03 Approve on 2015-02-03
Review via email: mp+248351@code.launchpad.net

Commit Message

Fix tests with Qt 5.4

Only call finished on disconnection if the finish timer is not running
otherwise we end up calling finish twice for the same ui proxy

Seems that with 5.3 the socket disconnected signal was being emitted a bit later
and thus did not affect the tests

To post a comment you must log in.
Alberto Mardegan (mardy) wrote :

Looks good, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'online-accounts-service/ui-proxy.cpp'
2--- online-accounts-service/ui-proxy.cpp 2015-01-14 09:31:14 +0000
3+++ online-accounts-service/ui-proxy.cpp 2015-02-03 10:24:06 +0000
4@@ -64,6 +64,7 @@
5
6 private Q_SLOTS:
7 void onNewConnection();
8+ void onDisconnected();
9 void onDataReady(QByteArray &data);
10 void onRequestCompleted();
11 void onFinishedTimer();
12@@ -136,6 +137,15 @@
13 m_ipc.write(ba);
14 }
15
16+void UiProxyPrivate::onDisconnected()
17+{
18+ Q_Q(UiProxy);
19+
20+ if (!m_finishedTimer.isActive()) {
21+ Q_EMIT q->finished();
22+ }
23+}
24+
25 void UiProxyPrivate::onNewConnection()
26 {
27 Q_Q(UiProxy);
28@@ -151,7 +161,7 @@
29
30 m_socket = socket;
31 QObject::connect(socket, SIGNAL(disconnected()),
32- q, SIGNAL(finished()));
33+ this, SLOT(onDisconnected()));
34 m_ipc.setChannels(socket, socket);
35 m_server.close(); // stop listening
36

Subscribers

People subscribed via source and target branches