From d51c00082f11415e1a9e240a911daa5c617b0dc9 Mon Sep 17 00:00:00 2001 From: DuanRay Date: Thu, 28 Sep 2023 18:03:43 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=A7=A3=E5=86=B3=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 0001-fix-display-version-error.patch | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 0001-fix-display-version-error.patch diff --git a/0001-fix-display-version-error.patch b/0001-fix-display-version-error.patch new file mode 100644 index 0000000..6941989 --- /dev/null +++ b/0001-fix-display-version-error.patch @@ -0,0 +1,27 @@ +diff --git a/nfs-logtools-1.0.0/logtools.cpp b/nfs-logtools-1.0.0/logtools.cpp +index 8e0d196..8407394 100644 +--- a/nfs-logtools-1.0.0/logtools.cpp ++++ b/nfs-logtools-1.0.0/logtools.cpp +@@ -50,13 +50,17 @@ void Logtools::logtoolsAboutLogtools() + QFont fontName("Noto Sans CJK SC", 12); + fontName.setBold(true); + softName->setFont(fontName); +- +- QLabel *softVersion = new QLabel(tr("1.0.0"), dialogAbout); ++ ++ QProcess process; ++ QStringList params; ++ process.start("bash", QStringList() << "-c" << "dpkg -l | grep nfs-logtools"); ++ process.waitForFinished(); ++ QString appVersion = process.readAllStandardOutput(); ++ ParserLog::formatString(appVersion); ++ QLabel *softVersion = new QLabel(appVersion.split(" ")[2],dialogAbout); + softVersion->move(36, 66); +- QFont font("Noto Sans CJK SC", 9); +- softVersion->setFont(font); + +- QLabel *softIcon = new QLabel(tr("1.0.0"), dialogAbout); ++ QLabel *softIcon = new QLabel(dialogAbout); + softIcon->move(406, 36); + softIcon->setPixmap(QPixmap(":/icon/nfs-logtools.png")); + -- Gitee