use reference when appropriate

Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
(cherry picked from commit 23617df00f6dd80c891bdffc20e83ea7d5f21f15)
This commit is contained in:
侯红勋 2024-05-08 11:05:59 +08:00 committed by openeuler-sync-bot
parent f5a53aa016
commit 6f8951499e
2 changed files with 38 additions and 4 deletions

View File

@ -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?= <houhongxun@kylinos.cn>
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: 侯红勋 <houhongxun@kylinos.cn>
---
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<LocationData> SearchMarch::exactMatchCity(const QString &inputText) const
{
QList<LocationData> 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

View File

@ -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 <houhongxun@kylinos.cn> - 3.1.2-5
- use reference when appropriate
* Mon May 06 2024 houhongxun <houhongxun@kylinos.cn> - 3.1.2-4
- use QRandomGenerator to generate random numbers
- fix some code errors