From bc027c4e8282a07db893c71f0b5ea72701e99bc3 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Mon, 31 Oct 2022 11:30:15 +0800
Subject: [PATCH] modify version is pull

---
 src/util.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/util.cpp b/src/util.cpp
index c79d6db..6e88b86 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -501,17 +501,17 @@ QString getUsmVersion()
     QString versionText;
     QProcess proc;
     QStringList options;
-    options << "-l" << "|" << "grep" << "ukui-system-monitor";
-    proc.start("dpkg", options);
+    options << "-qa" << "|" << "grep" << "ukui-system-monitor";
+    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("ukui-system-monitor")) {
-            QStringList lineInfoList = strInfoLine.split(QRegExp("[\\s]+"));
+            QStringList lineInfoList = strInfoLine.split(QRegExp("-"));
             if (lineInfoList.size() >= 3) {
-                versionText = lineInfoList[2];
+                versionText = lineInfoList[3];
             }
             break;
         }
-- 
2.36.1

