Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
83de084362
!14 fix wrong date on third day of weekly weather
From: @hou-hongxun 
Reviewed-by: @peijiankang 
Signed-off-by: @peijiankang
2024-05-08 08:38:45 +00:00
侯红勋
d39b0b7191 fix wrong date on third day of weekly weather
fixes #I9MP2P

Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
2024-05-08 14:33:52 +08:00
openeuler-ci-bot
cef9f86e2d
!12 use reference when appropriate
From: @hou-hongxun 
Reviewed-by: @peijiankang 
Signed-off-by: @peijiankang
2024-05-08 06:25:47 +00:00
侯红勋
23617df00f use reference when appropriate
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
2024-05-08 11:05:59 +08:00
openeuler-ci-bot
58f2d7e820
!10 use QRandomGenerator and fix some code error
From: @hou-hongxun 
Reviewed-by: @dou33 
Signed-off-by: @dou33
2024-05-07 08:12:40 +00:00
侯红勋
b87517aeb2 use QRandomGenerator and fix some code error
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
2024-05-06 14:20:48 +08:00
openeuler-ci-bot
539e05c740
!5 fix coredump of kylin-weather
From: @hua_yadong 
Reviewed-by: @peijiankang 
Signed-off-by: @peijiankang
2023-11-25 08:02:48 +00:00
hua_yadong
233c3f913b fix coredump of kylin-weather 2023-11-25 15:52:05 +08:00
openeuler-ci-bot
d2b5eb7b70
!3 [sync] PR-2: fix install warning
From: @openeuler-sync-bot 
Reviewed-by: @peijiankang 
Signed-off-by: @peijiankang
2023-05-30 02:59:38 +00:00
peijiankang
77c1dd3086 fix install warning
(cherry picked from commit 1a9fd661c3b7b650c1841b615aa485ace014e3f3)
2023-05-30 10:48:28 +08:00
5 changed files with 154 additions and 3 deletions

View File

@ -0,0 +1,28 @@
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

@ -0,0 +1,29 @@
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

@ -0,0 +1,41 @@
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

@ -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,11 +1,15 @@
Name: kylin-weather Name: kylin-weather
Version: 3.1.2 Version: 3.1.2
Release: 1 Release: 6
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
@ -27,7 +31,11 @@ change it.
%prep %prep
%setup -q %setup -q
%patch01 -p1 %patch 1 -p1
%patch 2 -p1
%patch 3 -p1
%patch 4 -p1
%patch 5 -p1
%build %build
mkdir build && pushd build mkdir build && pushd build
@ -46,7 +54,7 @@ popd
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%post %post
glib-compile-schemas /usr/share/glib-2.0/schemas glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/null ||:
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"
@ -62,6 +70,22 @@ 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