Merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/fixdevicedetection into lp:qtcreator-plugin-ubuntu

Proposed by Benjamin Zeller
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 391
Merged at revision: 397
Proposed branch: lp:~zeller-benjamin/qtcreator-plugin-ubuntu/fixdevicedetection
Merge into: lp:qtcreator-plugin-ubuntu
Diff against target: 158 lines (+31/-8)
1 file modified
src/ubuntu/ubuntudevice.cpp (+31/-8)
To merge this branch: bzr merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/fixdevicedetection
Reviewer Review Type Date Requested Status
Zoltan Balogh Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+259729@code.launchpad.net

Commit message

Fix bug lp:1456627 "Almost unusuable while non-Ubuntu device connected through adb"

Description of the change

Fix bug lp:1456627 "Almost unusuable while non-Ubuntu device connected through adb"

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

OK

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ubuntu/ubuntudevice.cpp'
2--- src/ubuntu/ubuntudevice.cpp 2015-05-05 09:38:13 +0000
3+++ src/ubuntu/ubuntudevice.cpp 2015-05-21 08:14:58 +0000
4@@ -159,14 +159,11 @@
5 {
6 Q_UNUSED(code)
7
8- if (code == 0) {
9- m_errorCount = 0;
10- } else {
11- if(m_errorCount > 3) {
12- setProcessState(UbuntuDevice::Failed);
13- m_reply.clear();
14- return;
15- }
16+
17+ if(m_errorCount > 3) {
18+ setProcessState(UbuntuDevice::Failed);
19+ m_reply.clear();
20+ return;
21 }
22
23 switch(m_dev->m_processState) {
24@@ -176,6 +173,8 @@
25 m_errorCount++;
26 waitForEmulatorStart();
27 break;
28+ } else {
29+ m_errorCount = 0;
30 }
31
32 m_dev->m_emulatorSerial = m_reply.trimmed();
33@@ -191,6 +190,8 @@
34 m_errorCount++;
35 waitForBoot();
36 break;
37+ } else {
38+ m_errorCount = 0;
39 }
40 //for now the script will wait forever until the shell is available
41 detect();
42@@ -220,6 +221,8 @@
43 break;
44 }
45
46+ m_errorCount = 0;
47+
48 m_dev->m_framework = framework;
49
50 //will trigger the device updated signal
51@@ -235,6 +238,8 @@
52 m_errorCount++;
53 detectHasNetworkConnection();
54 break;
55+ } else {
56+ m_errorCount = 0;
57 }
58
59 if (m_reply.trimmed() == QString::fromLatin1(Constants::ONE_STR)) {
60@@ -258,6 +263,7 @@
61 break;
62 }
63 case UbuntuDevice::CloneNetwork:{
64+ m_errorCount = 0;
65 endAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_NETWORK_CONF_COPIED));
66 detectHasNetworkConnection();
67 break;
68@@ -267,6 +273,8 @@
69 m_errorCount++;
70 detectOpenSsh();
71 break;
72+ } else {
73+ m_errorCount = 0;
74 }
75
76 if (m_reply.trimmed() != QLatin1String(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_NONE)
77@@ -299,12 +307,14 @@
78 break;
79 }
80 case UbuntuDevice::InstallOpenSSH:{
81+ m_errorCount = 0;
82 endAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_SSH_WAS_INSTALLED));
83
84 detectOpenSsh();
85 break;
86 }
87 case UbuntuDevice::RemoveOpenSSH:{
88+ m_errorCount = 0;
89 endAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_SSH_WAS_REMOVED));
90
91 detectOpenSsh();
92@@ -315,6 +325,8 @@
93 m_errorCount++;
94 startSshService();
95 break;
96+ } else {
97+ m_errorCount = 0;
98 }
99
100 if(m_dev->m_openSSHStarted != UbuntuDevice::Available) {
101@@ -327,6 +339,7 @@
102 break;
103 }
104 case UbuntuDevice::EnablePortForwarding:{
105+ m_errorCount = 0;
106 endAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_PORTS_FORWARDED));
107
108 deployPublicKey();
109@@ -337,6 +350,8 @@
110 m_errorCount++;
111 deployPublicKey();
112 break;
113+ } else {
114+ m_errorCount = 0;
115 }
116 //ready to use
117 ProjectExplorer::DeviceManager::instance()->setDeviceState(m_dev->id(),ProjectExplorer::IDevice::DeviceReadyToUse);
118@@ -350,6 +365,8 @@
119 m_errorCount++;
120 detectDeviceWritableImage();
121 break;
122+ } else {
123+ m_errorCount = 0;
124 }
125
126 if (m_reply.trimmed() == QLatin1String(Constants::ZERO_STR)) {
127@@ -369,6 +386,8 @@
128 m_errorCount++;
129 detectDeveloperTools();
130 break;
131+ } else {
132+ m_errorCount = 0;
133 }
134
135 setProcessState(UbuntuDevice::Done);
136@@ -385,18 +404,22 @@
137 break;
138 }
139 case UbuntuDevice::EnableRWImage:
140+ m_errorCount = 0;
141 endAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_WRITABLE_ENABLED));
142 detectDeviceWritableImage();
143 break;
144 case UbuntuDevice::DisableRWImage:
145+ m_errorCount = 0;
146 endAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_WRITABLE_DISABLED));
147 detectDeviceWritableImage();
148 break;
149 case UbuntuDevice::InstallDevTools:
150+ m_errorCount = 0;
151 endAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_DEVELOPERTOOLS_WAS_INSTALLED));
152 detectDeveloperTools();
153 break;
154 case UbuntuDevice::RemoveDevTools:
155+ m_errorCount = 0;
156 endAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_DEVELOPERTOOLS_REMOVED));
157 detectDeveloperTools();
158 break;

Subscribers

People subscribed via source and target branches