Skip to content

Commit 6fac7fc

Browse files
committed
fixed updater to not tell "errors" if exit code is 1
exit code is now ignored, could help with issue #4
1 parent 0159cc5 commit 6fac7fc

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

src/autoupdatercore/updater_p.cpp

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,24 +162,18 @@ void UpdaterPrivate::updaterReady(int exitCode, QProcess::ExitStatus exitStatus)
162162
mainProcess->deleteLater();
163163
mainProcess = nullptr;
164164

165-
if(lastErrorCode != EXIT_SUCCESS) {
166-
running = false;
167-
emit q->runningChanged(false);
165+
running = false;
166+
emit q->runningChanged(false);
167+
try {
168+
updateInfos = parseResult(updateOut);
169+
if(!updateInfos.isEmpty())
170+
emit q->updateInfoChanged(updateInfos);
171+
emit q->checkUpdatesDone(!updateInfos.isEmpty(), false);
172+
} catch (NoUpdatesXmlException &) {
173+
emit q->checkUpdatesDone(false, false);
174+
} catch (InvalidXmlException &exc) {
175+
lastErrorLog = exc.what();
168176
emit q->checkUpdatesDone(false, true);
169-
} else {
170-
running = false;
171-
emit q->runningChanged(false);
172-
try {
173-
updateInfos = parseResult(updateOut);
174-
if(!updateInfos.isEmpty())
175-
emit q->updateInfoChanged(updateInfos);
176-
emit q->checkUpdatesDone(!updateInfos.isEmpty(), false);
177-
} catch (NoUpdatesXmlException &) {
178-
emit q->checkUpdatesDone(false, false);
179-
} catch (InvalidXmlException &exc) {
180-
lastErrorLog = exc.what();
181-
emit q->checkUpdatesDone(false, true);
182-
}
183177
}
184178
} else
185179
updaterError(QProcess::Crashed);

src/autoupdatergui/translations/QtAutoUpdaterController_de.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<context>
55
<name>AdminAuthorization</name>
66
<message>
7-
<location filename="../adminauthorization_x11.cpp" line="+189"/>
7+
<location filename="../adminauthorization_x11.cpp" line="+188"/>
88
<source>Enter Password</source>
99
<translation>Passwort Eingeben</translation>
1010
</message>

src/autoupdatergui/translations/QtAutoUpdaterController_template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<context>
55
<name>AdminAuthorization</name>
66
<message>
7-
<location filename="../adminauthorization_x11.cpp" line="+189"/>
7+
<location filename="../adminauthorization_x11.cpp" line="+188"/>
88
<source>Enter Password</source>
99
<translation type="unfinished"></translation>
1010
</message>

tests/auto/autoupdatercore/UpdaterTest/tst_updatertest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ void UpdaterTest::testUpdateCheck_data()
6666
QString homePath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
6767
QString path = homePath + "/QtAutoUpdaterTestInstaller";
6868
QTest::newRow("QtAutoUpdaterTestInstaller") << path + "/maintenancetool"
69-
<< true
70-
<< updates;
69+
<< true
70+
<< updates;
7171

7272
updates.clear();
7373

@@ -77,8 +77,8 @@ void UpdaterTest::testUpdateCheck_data()
7777
path = homePath + "/Qt";
7878
#endif
7979
QTest::newRow("Qt") << path + "/MaintenanceTool"
80-
<< false
81-
<< updates;
80+
<< false
81+
<< updates;
8282
}
8383

8484
void UpdaterTest::testUpdateCheck()
@@ -119,7 +119,7 @@ void UpdaterTest::testUpdateCheck()
119119
QVariantList varList = this->checkSpy->takeFirst();
120120
QVERIFY(this->updater->exitedNormally());
121121
QCOMPARE(this->updater->errorCode(), hasUpdates ? EXIT_SUCCESS : EXIT_FAILURE);
122-
QCOMPARE(varList[1].toBool(), !hasUpdates);
122+
QCOMPARE(varList[1].toBool(), false);//no errors please
123123

124124
//verifiy the "hasUpdates" and "updates" are as expected
125125
QCOMPARE(varList[0].toBool(), hasUpdates);

0 commit comments

Comments
 (0)