fix coredump of kylin-weather

(cherry picked from commit 5e9d9cd83ecda309d6f62f0425b8086d62944802)
This commit is contained in:
hua_yadong 2023-11-25 15:38:18 +08:00 committed by openeuler-sync-bot
parent 9897a9b767
commit 0a34a15837
2 changed files with 34 additions and 1 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

@ -1,11 +1,12 @@
Name: kylin-weather
Version: 3.1.2
Release: 2
Release: 3
Summary: Indicator that displays China weather information
License: GPL-3.0+
URL: https://gitee.com/openkylin/kylin-weather
Source0: %{name}-%{version}.tar.gz
Patch01: 0001-fix-compile-error-of-kylin-weather.patch
Patch02: 0001-fix-coredump-of-kylin-weather.patch
BuildRequires: qt5-qtbase-devel
BuildRequires: qtchooser
@ -28,6 +29,7 @@ change it.
%prep
%setup -q
%patch01 -p1
%patch02 -p1
%build
mkdir build && pushd build
@ -62,6 +64,9 @@ fi
%{_datadir}/kylin-user-guide/*
%changelog
* 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