From bef7aa5a0a915eecec5b52a63926d8d53e063bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= Date: Thu, 13 Jun 2024 15:03:48 +0800 Subject: [PATCH] Fix the wrong version number on about dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 侯红勋 --- ...ersion-number-showed-on-about-dialog.patch | 83 +++++++++++++++++++ peony.spec | 6 +- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-version-number-showed-on-about-dialog.patch diff --git a/0001-Fix-version-number-showed-on-about-dialog.patch b/0001-Fix-version-number-showed-on-about-dialog.patch new file mode 100644 index 0000000..6f299e5 --- /dev/null +++ b/0001-Fix-version-number-showed-on-about-dialog.patch @@ -0,0 +1,83 @@ +From 22e6c4eef2bc14587e9ce623e54938e317b10a1f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= +Date: Tue, 4 Jun 2024 15:50:19 +0800 +Subject: [PATCH] Fix version number showed on about dialog +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: 侯红勋 +--- + src/windows/about-dialog.cpp | 37 +++++++++++------------------------- + src/windows/about-dialog.h | 2 ++ + 2 files changed, 13 insertions(+), 26 deletions(-) + +diff --git a/src/windows/about-dialog.cpp b/src/windows/about-dialog.cpp +index dfb12f1..8b18a2c 100644 +--- a/src/windows/about-dialog.cpp ++++ b/src/windows/about-dialog.cpp +@@ -184,37 +184,22 @@ QString AboutDialog::convertRGB16HexStr(const QColor &color) + + QString AboutDialog::getCurrentVersion() + { +- //use self define main version +- //return VERSION; +- +- FILE *pp = NULL; +- char *line = NULL; +- size_t len = 0; +- ssize_t read; +- char *q = NULL; + QString version = VERSION; ++ QProcess v_p; ++ v_p.start("rpm", QStringList() << "-q" << "peony"); + +- //fix bug#125289, use dpkg query version instead of self define version +- pp = popen("dpkg -l peony", "r"); +- if(NULL == pp) +- return version; +- +- while((read = getline(&line, &len, pp)) != -1){ +- q = strrchr(line, '\n'); +- *q = '\0'; ++ if (!v_p.waitForFinished()) ++ return version; + +- QString content = line; +- QStringList list = content.split(" "); ++ QByteArray ba = v_p.readAllStandardOutput(); + +- list.removeAll(""); ++ QRegularExpression qe("-([^-]+)-[^-]+\n$"); + +- if (list.size() >= 3) +- version = list.at(2); +- } +- +- free(line); +- pclose(pp); +- return version; ++ QRegularExpressionMatch qem = qe.match(ba); ++ if (qem.hasMatch()) { ++ return qem.captured(1); ++ } ++ return version; + } + + void AboutDialog::on_closeBtn_clicked() +diff --git a/src/windows/about-dialog.h b/src/windows/about-dialog.h +index 27df028..92f1249 100644 +--- a/src/windows/about-dialog.h ++++ b/src/windows/about-dialog.h +@@ -28,6 +28,8 @@ + #include + #include + #include ++#include ++#include + + #ifdef KY_SDK_QT_WIDGETS + #include +-- +2.33.0 + diff --git a/peony.spec b/peony.spec index d13a0bf..92ae7ac 100644 --- a/peony.spec +++ b/peony.spec @@ -1,11 +1,12 @@ Name: peony Version: 4.0.0.0 -Release: 2 +Release: 3 Summary: file Manager for the UKUI desktop License: GPL-3.0-or-later and Expat and LGPL-3+ URL: http://www.ukui.org Source0: %{name}-%{version}.tar.gz Patch01: 0001-fix-compilation-errors.patch +Patch02: 0001-Fix-version-number-showed-on-about-dialog.patch BuildRequires: libcanberra-devel BuildRequires: dconf-devel @@ -141,6 +142,9 @@ glib-compile-schemas /usr/share/glib-2.0/schemas/ &> /dev/null ||: %{_prefix}/%{_lib}/*.so %changelog +* Thu Jun 13 2024 houhongxun - 4.0.0.0-3 +- Fix the version number on about dialog + * Wed Jun 05 2024 peijiankang - 4.0.0.0-2 - update package info -- Gitee