From cc41a8099b9f39a503395efcc03327c07b7545d1 Mon Sep 17 00:00:00 2001 From: peijiankang Date: Mon, 22 Aug 2022 14:58:31 +0800 Subject: [PATCH] modify version is error (cherry picked from commit 166570f66abcdaad8294c4e2403b992ff5042f04) --- 0003-modify-version-is-error.patch | 48 ++++++++++++++++++++++++++++++ kylin-video.spec | 7 ++++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 0003-modify-version-is-error.patch diff --git a/0003-modify-version-is-error.patch b/0003-modify-version-is-error.patch new file mode 100644 index 0000000..058e6ad --- /dev/null +++ b/0003-modify-version-is-error.patch @@ -0,0 +1,48 @@ +From 749a7b4cb7fceba82b8a715bbabdac6fa104591a Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Mon, 22 Aug 2022 14:44:23 +0800 +Subject: [PATCH] modify version is error + +--- + src/aboutdialog.cpp | 24 +++++++++++++++++++++++- + 1 file changed, 23 insertions(+), 1 deletion(-) + +diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp +index 1df8335..e6b9f0f 100644 +--- a/src/aboutdialog.cpp ++++ b/src/aboutdialog.cpp +@@ -34,8 +34,30 @@ AboutDialog::AboutDialog(QWidget *parent) : + ui->label_2->setFont(f); + + connect(ui->btn_close, &QPushButton::clicked, [&](){close();}); ++ ++ QString appVersion; ++ FILE *pp = NULL; ++ char *line = NULL; ++ char *q = NULL; ++ size_t len = 0; ++ ++ pp = popen("rpm -q kylin-video", "r"); ++ if(pp) { while(getline(&line, &len, pp) != -1){ ++ q = strrchr(line, '\n'); ++ *q = '\0'; ++ QString content = line; ++ QStringList list = content.split("-"); ++ if (list.size() >= 3) ++ appVersion = list.at(2); ++ } ++ } ++ if(line){ ++ free(line); ++ line = NULL; ++ } ++ pclose(pp); + +- ui->label_3->setText(QString("

%0

").arg(tr("version: ").append("3.1.1"))); ++ ui->label_3->setText(QString("

%0

").arg(tr("version: ").append(appVersion))); + ui->label_4->setText(tr("service and support: ").append("support@kylinos.cn")); + connect(ui->label_4, SIGNAL(linkActivated(QString)), this, SLOT(slotOpenUrl(QString))); + initStyle(); +-- +2.33.0 + diff --git a/kylin-video.spec b/kylin-video.spec index f043539..7c8b9f0 100644 --- a/kylin-video.spec +++ b/kylin-video.spec @@ -2,13 +2,14 @@ Name: kylin-video Version: 3.1.3 -Release: 4 +Release: 5 Summary: A powerful video player License: GPL-2.0-or-later and LGPL-2.0-or-later and BSD URL: https://github.com/UbuntuKylin/kylin-video Source0: kylin-video-3.1.3.tar.gz Patch1: 0001-modify-compile-error-of-kylin-video.patch Patch2: 0002-Fix-the-problem-of-the-help-manual-button.patch +Patch3: 0003-modify-version-is-error.patch BuildRequires: qt5-devel BuildRequires: qtchooser @@ -41,6 +42,7 @@ It supports both x86 and ARM platform, and supports most of the audio and video %setup -q %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build @@ -66,6 +68,9 @@ popd %changelog +* Mon Aug 22 2022 peijiankang - 3.1.3-5 +- modify version is error + * Wed Aug 19 2022 peijiankang - 3.1.3-4 - add tinyxml2 requires