Skip to content

Commit f3fabf4

Browse files
committed
update qasecretservice handler functions
1 parent 78ceff0 commit f3fabf4

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

qasecretservice.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ QByteArray QuasarAppUtils::QASecretService::getByAlias(const QString &alias) {
1010

1111
proc.start();
1212

13-
proc.waitForFinished(2000);
13+
if (!proc.waitForFinished(2000)) {
14+
return "";
15+
}
1416

15-
if (proc.error() || proc.exitCode()) {
17+
if (proc.exitCode()) {
1618
return "";
1719
}
1820

@@ -30,13 +32,16 @@ QByteArray QuasarAppUtils::QASecretService::getByHash(const QByteArray &hash)
3032

3133
proc.start();
3234

33-
proc.waitForFinished(2000);
34-
QByteArray result = proc.readAllStandardOutput();
35+
if (!proc.waitForFinished(2000)) {
36+
return "";
37+
}
3538

36-
if (proc.error() || proc.exitCode()) {
39+
if (proc.exitCode()) {
3740
return "";
3841
}
3942

43+
QByteArray result = proc.readAllStandardOutput();
44+
4045
// drop \n
4146
return result.left(result.size() - 1);
4247
}

0 commit comments

Comments
 (0)