diff --git a/fix-gsetting-issue.patch b/fix-gsetting-issue.patch new file mode 100644 index 0000000..ca1156f --- /dev/null +++ b/fix-gsetting-issue.patch @@ -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 @@ + thisweather + current weather of this city + ++ ++ "auto" ++ "record theme mode" ++ record theme mode.there's three mode.auto,lightonly and darkonly ++ + + +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 Fri,8 Jan 2021 10:33:00 +0800 ++ ++indicator-china-weather (3.1.0-35) v101; urgency=medium ++ ++ * 菜单按钮功能上线。 ++ * 修复高危BUG#32077 按钮位置异常 ++ * 修复高优先BUG#30941 关于按钮无反应 ++ ++ -- shixiaoshuo 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 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 +@@ -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; diff --git a/indicator-china-weather.spec b/indicator-china-weather.spec index 31b63ec..9d1e794 100644 --- a/indicator-china-weather.spec +++ b/indicator-china-weather.spec @@ -1,7 +1,7 @@ %define debug_package %{nil} Name: indicator-china-weather Version: 3.1.0 -Release: 6 +Release: 7 Summary: The weather data are from the heweather API s6 version. License: GPL-3.0+ URL: https://github.com/UbuntuKylin/indicator-china-weather @@ -21,6 +21,10 @@ BuildRequires: GeoIP-devel # Requires: NetworkManager +#patch0: 0001-remove-about.patch +#patch1: 0001-fix-vnc-show-issue.patch +patch0: fix-gsetting-issue.patch + %description Indicator that displays China weather information Kylin Weather displays detail weather information for one place, @@ -29,6 +33,7 @@ BuildRequires: GeoIP-devel %prep %setup -q +%patch0 -p1 %build %{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 %changelog +* Wed Dec 8 2021 douyan - 3.1.0-7 +- update to upstream version 3.1.0-36 +- fix open failed caused by gsetting + * Tue Dec 7 2021 douyan - 3.1.0-6 - update to upstream version 3.1.0-34