diff --git a/0001-Fix-the-version-of-kylin-photo-viewer.patch b/0001-Fix-the-version-of-kylin-photo-viewer.patch new file mode 100644 index 0000000..16bd959 --- /dev/null +++ b/0001-Fix-the-version-of-kylin-photo-viewer.patch @@ -0,0 +1,40 @@ +From 9e00da4394cc3159edec55b95019e172772ecea0 Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Thu, 9 Jun 2022 11:34:59 +0800 +Subject: [PATCH] Fix the version of kylin-photo-viewer + +--- + src/view/menumodule.cpp | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/src/view/menumodule.cpp b/src/view/menumodule.cpp +index a974db7..28e7aaa 100644 +--- a/src/view/menumodule.cpp ++++ b/src/view/menumodule.cpp +@@ -207,6 +207,23 @@ QHBoxLayout* menuModule::initTitleBar(){ + + QVBoxLayout* menuModule::initBody(){ + m_appVersion = VERSION_NEM; ++ QProcess proc; ++ QStringList options; ++ options << "-qa" << "|" << "grep" << "kylin-photo-viewer"; ++ 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("kylin-photo-viewer")) { ++ QStringList lineInfoList = strInfoLine.split(QRegExp("-")); ++ if (lineInfoList.size() >= 3) { ++ m_appVersion = lineInfoList[3]; ++ } ++ break; ++ } ++ } + // QLabel* bodyIcon = new QLabel(); + QPushButton *bodyIcon = new QPushButton(); + bodyIcon->setFixedSize(MICON_SIZEB); +-- +2.33.0 + diff --git a/kylin-photo-viewer.spec b/kylin-photo-viewer.spec index 3581ea8..35a72f1 100644 --- a/kylin-photo-viewer.spec +++ b/kylin-photo-viewer.spec @@ -1,11 +1,12 @@ %define debug_package %{nil} Name: kylin-photo-viewer Version: 1.0.2 -Release: 2 +Release: 3 Summary: kylin-photo-viewer License: BSL-1.0 and Libpng and zlib and GPL-2.0-or-later URL: https://github.com/UbuntuKylin/kylin-photo-viewer Source0: %{name}-%{version}.tar.gz +Patch01: 0001-Fix-the-version-of-kylin-photo-viewer.patch BuildRequires: qt5-qtbase-devel BuildRequires: qtchooser @@ -29,6 +30,8 @@ Photo viewer, support to view, zoom and rotate images of various formats %prep %setup -q +%patch1 -p1 + %build export PATH=%{_qt5_bindir}:$PATH @@ -64,6 +67,9 @@ popd %{_datadir}/pixmaps/kyview_logo.png %changelog +* Thu Jun 9 2022 peijiankang - 1.0.2-3 +- Fix the version of kylin-photo-viewer + * Thu May 26 2022 peijiankang - 1.0.2-2 - remove {%if 0 and %endif}