Compare commits

..

No commits in common. "83de08436289094b032c1a40806cfa54a8e971d3" and "38093ed5f4739ee13d2341f75db8d64705c0b7b0" have entirely different histories.

5 changed files with 3 additions and 154 deletions

View File

@ -1,28 +0,0 @@
From 009af8191dbed71fa5ea6a9a6db0b82bb20913ce Mon Sep 17 00:00:00 2001
From: hua_yadong <huayadong@kylinos.cn>
Date: Sat, 25 Nov 2023 15:50:47 +0800
Subject: [PATCH] fix coredump of kylin-weather
---
view/horscreen/perhour.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/view/horscreen/perhour.cpp b/view/horscreen/perhour.cpp
index f787ed5..396a174 100644
--- a/view/horscreen/perhour.cpp
+++ b/view/horscreen/perhour.cpp
@@ -56,7 +56,10 @@ perhour::perhour(QWidget *parent) : QWidget(parent)
// 逐小时信息
void perhour::setHourlyInfor(QList<Hourly> tmp_list , int m_isFullScreen)
-{
+{
+ if (tmp_list.isEmpty()) {
+ return;
+ }
tmpList = tmp_list;
if ( m_isFullScreen == 0 ) // 普通界面
{
--
2.41.0

View File

@ -1,29 +0,0 @@
From 3fcd75a2cb1b348e896ebf64034ce0e0eec0628e 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 14:16:18 +0800
Subject: [PATCH] fix wrong date on third day of weekly weather
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
---
view/horscreen/weekweather.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/view/horscreen/weekweather.cpp b/view/horscreen/weekweather.cpp
index 7124717..5e9f8a3 100644
--- a/view/horscreen/weekweather.cpp
+++ b/view/horscreen/weekweather.cpp
@@ -286,7 +286,7 @@ void weekweather::getForcastInfor(ForecastWeather m_forecastWeather, int m_isFul
m_onedayweatherthree->m_dayOfWeek->setText("N/A");
} else {
QString monthThree = timeThird.toString("MM");
- QString dateThree = timeThird.toString("MM");
+ QString dateThree = timeThird.toString("dd");
if ("0" == monthThree.mid(0, 1)) {
monthThree = monthThree.mid(1, 1);
}
--
2.43.0

View File

@ -1,41 +0,0 @@
From 8a2239a0376826739d4fa1066d483a531d5c407a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= <houhongxun@kylinos.cn>
Date: Mon, 6 May 2024 14:10:34 +0800
Subject: [PATCH] use QRandomGenerator, and fix code error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
---
model/dataparser.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/model/dataparser.cpp b/model/dataparser.cpp
index 3719334..a733b29 100644
--- a/model/dataparser.cpp
+++ b/model/dataparser.cpp
@@ -1,5 +1,5 @@
#include "dataparser.h"
-
+#include <QRandomGenerator>
DataParser::DataParser() {}
//处理返回的网络数据
@@ -309,10 +309,11 @@ void DataParser::hourlyWeather(QJsonObject hourlyObj, QList<Hourly> hourlist)
void DataParser::tmphourlyWeather(QJsonObject hourlyObj, QList<Hourly> hourlist)
{
QTime current_time = QTime::currentTime();
+ QRandomGenerator rnd(current_time.msecsSinceStartOfDay());
int hour = current_time.hour() + 1; //当前的小时
for (int i = 0; i < 24; i++) {
- int num_code = qrand() % (1, 60);
- int num_tmp = qrand() % (-10, 30);
+ int num_code = rnd.bounded(0, 61);
+ int num_tmp = rnd.bounded(-10, 31);
QString tmpText = QString::number(num_tmp) + "°C";
Hourly tmp_hour;
QString hour_tmp = QString::number(hour + i) + ":00";
--
2.43.0

View File

@ -1,29 +0,0 @@
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,15 +1,11 @@
Name: kylin-weather Name: kylin-weather
Version: 3.1.2 Version: 3.1.2
Release: 6 Release: 1
Summary: Indicator that displays China weather information Summary: Indicator that displays China weather information
License: GPL-3.0+ License: GPL-3.0+
URL: https://gitee.com/openkylin/kylin-weather URL: https://gitee.com/openkylin/kylin-weather
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
Patch01: 0001-fix-compile-error-of-kylin-weather.patch 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
Patch05: 0001-fix-wrong-date-on-third-day-of-weekly-weather.patch
BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qtbase-devel
BuildRequires: qtchooser BuildRequires: qtchooser
@ -31,11 +27,7 @@ change it.
%prep %prep
%setup -q %setup -q
%patch 1 -p1 %patch01 -p1
%patch 2 -p1
%patch 3 -p1
%patch 4 -p1
%patch 5 -p1
%build %build
mkdir build && pushd build mkdir build && pushd build
@ -54,7 +46,7 @@ popd
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%post %post
glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/null ||: glib-compile-schemas /usr/share/glib-2.0/schemas
indicatorPath="/etc/xdg/autostart/indicator-china-weather.desktop" indicatorPath="/etc/xdg/autostart/indicator-china-weather.desktop"
if [ ! -d "$indicatorPath" ]; then if [ ! -d "$indicatorPath" ]; then
rm -f "$indicatorPath" rm -f "$indicatorPath"
@ -70,22 +62,6 @@ fi
%{_datadir}/kylin-user-guide/* %{_datadir}/kylin-user-guide/*
%changelog %changelog
* Wed May 08 2024 houhongxun <houhongxun@kylinos.cn> - 3.1.2-6
- fix wrong date on third day of weekly weather
* 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
* Sat Nov 25 2023 hua_yadong <huayadong@kylinos.cn> - 3.1.2-3
- add 0001-fix-coredump-of-kylin-weather.patch
* Tue May 30 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.2-2
- fix install warining
* Mon Jan 30 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.2-1 * Mon Jan 30 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.2-1
- Init Package for openEuler - Init Package for openEuler