36 lines
1.3 KiB
Diff
36 lines
1.3 KiB
Diff
From a755f802c3b65ac7b88c129ca64b112a7225b8b7 Mon Sep 17 00:00:00 2001
|
|
From: peijiankang <peijiankang@kylinos.cn>
|
|
Date: Mon, 30 May 2022 10:57:43 +0800
|
|
Subject: [PATCH] modify version of youker-assistant is null
|
|
|
|
---
|
|
commonfunc/utils.cpp | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/commonfunc/utils.cpp b/commonfunc/utils.cpp
|
|
index 911f56b..21061a4 100644
|
|
--- a/commonfunc/utils.cpp
|
|
+++ b/commonfunc/utils.cpp
|
|
@@ -64,15 +64,15 @@ QString getKAVersion()
|
|
QString versionText;
|
|
QProcess proc;
|
|
QStringList options;
|
|
- options << "-l" << "|" << "grep" << "youker-assistant";
|
|
- proc.start("dpkg", options);
|
|
+ options << "-qa" << "|" << "grep" << "youker-assistant";
|
|
+ proc.start("rpm", options);
|
|
proc.waitForFinished();
|
|
QString dpkgInfo = proc.readAll();
|
|
QStringList infoList = dpkgInfo.split("\n");
|
|
for (int n = 0; n < infoList.size(); n++) {
|
|
QString strInfoLine = infoList[n];
|
|
if (strInfoLine.contains("youker-assistant")) {
|
|
- QStringList lineInfoList = strInfoLine.split(QRegExp("[\\s]+"));
|
|
+ QStringList lineInfoList = strInfoLine.split(QRegExp("-"));
|
|
if (lineInfoList.size() >= 3) {
|
|
versionText = lineInfoList[2];
|
|
}
|
|
--
|
|
2.33.0
|
|
|