From fdbeccb9eda720fd08f8b60d99d13cba4c3f1fa9 Mon Sep 17 00:00:00 2001 From: keke <243768648@qq.com> Date: Wed, 22 Jun 2022 13:33:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=B2=E5=AE=89=E8=A3=85=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原因:软件包状态包括“unknown”,“install”,“remove”,“purge”和“hold” --- appmanagerjob.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appmanagerjob.cpp b/appmanagerjob.cpp index c083e82..11a7d8b 100644 --- a/appmanagerjob.cpp +++ b/appmanagerjob.cpp @@ -534,7 +534,7 @@ bool AppManagerJob::getPkgInfoListFromFile(QList &pkgInfoList, const QS } if (lineText.startsWith("Status: ")) { - pkgInfo.isInstalled = lineText.split(": ").last().startsWith("install"); + pkgInfo.isInstalled = lineText.contains("installed"); continue; } @@ -560,7 +560,7 @@ bool AppManagerJob::getPkgInfoListFromFile(QList &pkgInfoList, const QS } if (lineText.startsWith("Status: ")) { - pkgInfo.isInstalled = lineText.split(": ").last().startsWith("install"); + pkgInfo.isInstalled = lineText.contains("installed"); continue; } @@ -664,7 +664,7 @@ bool AppManagerJob::getInstalledPkgInfo(PkgInfo &pkgInfo, const QString &pkgName } if (lineText.startsWith("Status: ")) { - pkgInfo.isInstalled = lineText.split(": ").last().startsWith("install"); + pkgInfo.isInstalled = lineText.contains("installed"); continue; } -- Gitee