From 23617df00f6dd80c891bdffc20e83ea7d5f21f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= Date: Wed, 8 May 2024 11:05:59 +0800 Subject: [PATCH] use reference when appropriate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 侯红勋 --- 0001-use-reference-when-appropriate.patch | 29 +++++++++++++++++++++++ kylin-weather.spec | 13 ++++++---- 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 0001-use-reference-when-appropriate.patch diff --git a/0001-use-reference-when-appropriate.patch b/0001-use-reference-when-appropriate.patch new file mode 100644 index 0000000..bf1a2cc --- /dev/null +++ b/0001-use-reference-when-appropriate.patch @@ -0,0 +1,29 @@ +From f3f3e27350ae9011caa260a3e6833ee7cb9abfe1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= +Date: Wed, 8 May 2024 10:58:27 +0800 +Subject: [PATCH] use reference when appropriate +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: 侯红勋 +--- + model/searchmarch.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/model/searchmarch.cpp b/model/searchmarch.cpp +index 445bc98..6a6920f 100644 +--- a/model/searchmarch.cpp ++++ b/model/searchmarch.cpp +@@ -76,7 +76,7 @@ QList SearchMarch::exactMatchCity(const QString &inputText) const + { + QList searchedList; + //搜索匹配-遍历m_locatonList +- for (const LocationData line : m_locatonList) { ++ for (const LocationData &line : m_locatonList) { + if (line.shorthand == inputText || line.id == inputText || //拼音和ID + line.province == inputText ||line.province_en == inputText || //省 + line.city.contains(inputText) || line.city_en.contains(inputText) //县 +-- +2.43.0 + diff --git a/kylin-weather.spec b/kylin-weather.spec index 838d112..fe9ef3f 100644 --- a/kylin-weather.spec +++ b/kylin-weather.spec @@ -1,6 +1,6 @@ Name: kylin-weather Version: 3.1.2 -Release: 4 +Release: 5 Summary: Indicator that displays China weather information License: GPL-3.0+ URL: https://gitee.com/openkylin/kylin-weather @@ -8,6 +8,7 @@ Source0: %{name}-%{version}.tar.gz Patch01: 0001-fix-compile-error-of-kylin-weather.patch Patch02: 0001-fix-coredump-of-kylin-weather.patch Patch03: 0001-use-QRandomGenerator-and-fix-code-error.patch +Patch04: 0001-use-reference-when-appropriate.patch BuildRequires: qt5-qtbase-devel BuildRequires: qtchooser @@ -29,9 +30,10 @@ change it. %prep %setup -q -%patch -p1 1 -%patch -p1 2 -%patch -p1 3 +%patch 1 -p1 +%patch 2 -p1 +%patch 3 -p1 +%patch 4 -p1 %build mkdir build && pushd build @@ -66,6 +68,9 @@ fi %{_datadir}/kylin-user-guide/* %changelog +* Wed May 08 2024 houhongxun - 3.1.2-5 +- use reference when appropriate + * Mon May 06 2024 houhongxun - 3.1.2-4 - use QRandomGenerator to generate random numbers - fix some code errors -- Gitee