!9 fix open failed caused by gsetting

From: @dou33
Reviewed-by: @tanyulong2021
Signed-off-by: @tanyulong2021
This commit is contained in:
openeuler-ci-bot 2021-12-08 09:06:31 +00:00 committed by Gitee
commit bf446d4de4
2 changed files with 107 additions and 1 deletions

97
fix-gsetting-issue.patch Normal file
View File

@ -0,0 +1,97 @@
diff -Naur indicator-china-weather-3.1.0/data/org.china-weather-data.gschema.xml indicator-china-weather-3.1.0~/data/org.china-weather-data.gschema.xml
--- indicator-china-weather-3.1.0/data/org.china-weather-data.gschema.xml 2021-11-27 03:59:19.000000000 +0800
+++ indicator-china-weather-3.1.0~/data/org.china-weather-data.gschema.xml 2021-12-07 16:56:56.281416120 +0800
@@ -10,5 +10,10 @@
<summary>thisweather</summary>
<description>current weather of this city</description>
</key>
+ <key name="thememode" type="s">
+ <default>"auto"</default>
+ <summary>"record theme mode"</summary>
+ <description>record theme mode.there's three mode.auto,lightonly and darkonly</description>
+ </key>
</schema>
</schemalist>
diff -Naur indicator-china-weather-3.1.0/debian/changelog indicator-china-weather-3.1.0~/debian/changelog
--- indicator-china-weather-3.1.0/debian/changelog 2021-11-27 03:59:18.000000000 +0800
+++ indicator-china-weather-3.1.0~/debian/changelog 2021-12-07 16:56:54.918395675 +0800
@@ -1,3 +1,17 @@
+indicator-china-weather (3.1.0-36) v101; urgency=medium
+
+ * 修复了一处因为gsetting文件初始化问题引起的严重BUG
+
+ -- shixiaoshuo <shixiaoshuo@kylinos.cn> Fri,8 Jan 2021 10:33:00 +0800
+
+indicator-china-weather (3.1.0-35) v101; urgency=medium
+
+ * 菜单按钮功能上线。
+ * 修复高危BUG#32077 按钮位置异常
+ * 修复高优先BUG#30941 关于按钮无反应
+
+ -- shixiaoshuo <shixiaoshuo@kylinos.cn> Thu,7 Jan 2021 10:33:00 +0800
+
indicator-china-weather (3.1.0-34) v101; urgency=medium
* 菜单按钮因可能导致功能缺失因此补充上线
diff -Naur indicator-china-weather-3.1.0/src/menumodule.cpp indicator-china-weather-3.1.0~/src/menumodule.cpp
--- indicator-china-weather-3.1.0/src/menumodule.cpp 2021-11-27 03:59:19.000000000 +0800
+++ indicator-china-weather-3.1.0~/src/menumodule.cpp 2021-12-07 16:56:56.406417995 +0800
@@ -58,9 +58,9 @@
void menuModule::setThemeFromLocalThemeSetting(QList<QAction* > themeActions)
{
#if DEBUG_MENUMODULE
- confPath = "org.kylin-usb-creator-data.settings";
+// confPath = "org.kylin-usb-creator-data.settings";
#endif
- m_pGsettingThemeStatus = new QGSettings(confPath.toLocal8Bit());
+ m_pGsettingThemeStatus = new QGSettings(APPDATA);
QString appConf = m_pGsettingThemeStatus->get("thememode").toString();
if("lightonly" == appConf){
themeStatus = themeLightOnly;
@@ -111,7 +111,7 @@
void menuModule::triggerThemeMenu(QAction *act){
if(!m_pGsettingThemeStatus)
{
- m_pGsettingThemeStatus = new QGSettings(confPath.toLocal8Bit()); //m_pGsettingThemeStatus指针重复使用避免占用栈空间
+ m_pGsettingThemeStatus = new QGSettings(APPDATA); //m_pGsettingThemeStatus指针重复使用避免占用栈空间
}
QString str = act->text();
if("Light" == str){
@@ -214,7 +214,7 @@
#if DEBUG_MENUMODULE
appVersion = "2020.12.12-test";
#endif
- appVersion = "3.1.0-33kord";
+ appVersion = "3.1.0-33";
QLabel* bodyIcon = new QLabel();
bodyIcon->setFixedSize(96,96);
bodyIcon->setPixmap(QPixmap::fromImage(QImage(iconPath)));
diff -Naur indicator-china-weather-3.1.0/src/menumodule.h indicator-china-weather-3.1.0~/src/menumodule.h
--- indicator-china-weather-3.1.0/src/menumodule.h 2021-11-27 03:59:19.000000000 +0800
+++ indicator-china-weather-3.1.0~/src/menumodule.h 2021-12-07 16:56:56.431418370 +0800
@@ -1,7 +1,8 @@
#ifndef MENUMODULE_H
#define MENUMODULE_H
-#define DEBUG_MENUMODULE 1 //DEBUG模式开关代码上线之前务必关掉
+#define DEBUG_MENUMODULE 0 //DEBUG模式开关代码上线之前务必关掉
#define FITTHEMEWINDOW "org.ukui.style"
+#define APPDATA "org.china-weather-data.settings"
#include <QObject>
@@ -41,13 +42,13 @@
QString appVersion = "appVersion字段未填充!";
QString appDesc = "appDesc字段未填充!";
QString iconPath = "iconPath字段未填充!";
- QString confPath = "gsetting文件路径未配置";
+ QString confPath = "org.china-weather-data.settings";
private:
QMenu *m_menu = nullptr;
QMenu *themeMenu = nullptr;
QSize iconSize;
- QString appPath = "tools/kylin-usb-creator"; //拉起帮助菜单时使用appName字段
+// QString appPath = "tools/kylin-usb-creator"; //拉起帮助菜单时使用appName字段
QWidget *aboutWindow = nullptr;
QGSettings *m_pGsettingThemeData = nullptr;
QGSettings *m_pGsettingThemeStatus = nullptr;

View File

@ -1,7 +1,7 @@
%define debug_package %{nil} %define debug_package %{nil}
Name: indicator-china-weather Name: indicator-china-weather
Version: 3.1.0 Version: 3.1.0
Release: 6 Release: 7
Summary: The weather data are from the heweather API s6 version. Summary: The weather data are from the heweather API s6 version.
License: GPL-3.0+ License: GPL-3.0+
URL: https://github.com/UbuntuKylin/indicator-china-weather URL: https://github.com/UbuntuKylin/indicator-china-weather
@ -21,6 +21,10 @@ BuildRequires: GeoIP-devel
# Requires: NetworkManager # Requires: NetworkManager
#patch0: 0001-remove-about.patch
#patch1: 0001-fix-vnc-show-issue.patch
patch0: fix-gsetting-issue.patch
%description %description
Indicator that displays China weather information Indicator that displays China weather information
Kylin Weather displays detail weather information for one place, Kylin Weather displays detail weather information for one place,
@ -29,6 +33,7 @@ BuildRequires: GeoIP-devel
%prep %prep
%setup -q %setup -q
%patch0 -p1
%build %build
%{qmake_qt5} %{_qt5_qmake_flags} CONFIG+=enable-by-default indicator-china-weather.pro %{qmake_qt5} %{_qt5_qmake_flags} CONFIG+=enable-by-default indicator-china-weather.pro
@ -60,6 +65,10 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/man/man1/indicator-china-weather.1.gz %{_datadir}/man/man1/indicator-china-weather.1.gz
%changelog %changelog
* Wed Dec 8 2021 douyan <douyan@kylinos.cn> - 3.1.0-7
- update to upstream version 3.1.0-36
- fix open failed caused by gsetting
* Tue Dec 7 2021 douyan <douyan@kylinos.cn> - 3.1.0-6 * Tue Dec 7 2021 douyan <douyan@kylinos.cn> - 3.1.0-6
- update to upstream version 3.1.0-34 - update to upstream version 3.1.0-34