fix: 超时时间错误

This commit is contained in:
2022-12-12 16:44:02 +08:00
parent 63ca640c31
commit ebaeca359a
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -169,7 +169,7 @@ void downloadlist::install(int t)
QProcess isInstall; QProcess isInstall;
isInstall.start("dpkg -s " + pkgName); isInstall.start("dpkg -s " + pkgName);
isInstall.waitForFinished(180); // 默认超时 3 分钟 isInstall.waitForFinished(180*1000); // 默认超时 3 分钟
int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length(); int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
if(error == 0) if(error == 0)
{ {
+1 -1
View File
@@ -1200,7 +1200,7 @@ void Widget::on_pushButton_uninstall_clicked()
QProcess check; QProcess check;
check.start("dpkg", QStringList() << "-s" << pkgName.toLower()); check.start("dpkg", QStringList() << "-s" << pkgName.toLower());
check.waitForFinished(180); // 默认超时 3 分钟 check.waitForFinished(180*1000); // 默认超时 3 分钟
if (check.readAllStandardOutput().isEmpty()) if (check.readAllStandardOutput().isEmpty())
{ {
+3 -3
View File
@@ -92,7 +92,7 @@ void SpkAppInfoLoaderThread::run()
QProcess isInstall; QProcess isInstall;
packagename = json["Pkgname"].toString(); packagename = json["Pkgname"].toString();
isInstall.start("dpkg -s " + json["Pkgname"].toString()); isInstall.start("dpkg -s " + json["Pkgname"].toString());
isInstall.waitForFinished(180); // 默认超时 3 分钟 isInstall.waitForFinished(180*1000); // 默认超时 3 分钟
int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length(); int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
if(error == 0) if(error == 0)
{ {
@@ -100,12 +100,12 @@ void SpkAppInfoLoaderThread::run()
QProcess isUpdate; QProcess isUpdate;
isUpdate.start("dpkg-query --showformat='${Version}' --show " + json["Pkgname"].toString()); isUpdate.start("dpkg-query --showformat='${Version}' --show " + json["Pkgname"].toString());
isUpdate.waitForFinished(180); // 默认超时 3 分钟 isUpdate.waitForFinished(180*1000); // 默认超时 3 分钟
QString localVersion = isUpdate.readAllStandardOutput(); QString localVersion = isUpdate.readAllStandardOutput();
localVersion.replace("'", ""); localVersion.replace("'", "");
isUpdate.start("dpkg --compare-versions " + localVersion + " ge " + json["Version"].toString()); isUpdate.start("dpkg --compare-versions " + localVersion + " ge " + json["Version"].toString());
isUpdate.waitForFinished(180); // 默认超时 3 分钟 isUpdate.waitForFinished(180*1000); // 默认超时 3 分钟
if(!isUpdate.exitCode()) if(!isUpdate.exitCode())
{ {
isUpdated = true; isUpdated = true;