update new version 3.3.0

This commit is contained in:
peijiankang 2023-05-23 09:59:25 +08:00
parent 67ab1c28ed
commit c0ba945f6f
5 changed files with 144 additions and 21 deletions

View File

@ -0,0 +1,90 @@
From 9b05757e476316786e21a902982ed3befb9de443 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Tue, 17 Jan 2023 13:42:01 +0800
Subject: [PATCH] fix get Weather error
---
src/gsettingmanager.cpp | 17 ++++++++++++++---
src/gsettingmanager.h | 3 +++
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/gsettingmanager.cpp b/src/gsettingmanager.cpp
index fad7961..ff8630d 100644
--- a/src/gsettingmanager.cpp
+++ b/src/gsettingmanager.cpp
@@ -677,7 +677,7 @@ Q_GLOBAL_STATIC(WeatherGsetting, weatherGsetting)
WeatherGsetting::WeatherGsetting()
{
//获取系统
- if (PLATFORM::Intel.compare(PLATFORM::g_platformType,Qt::CaseInsensitive) == 0) {
+ if (isFileExist(WEATHER_DESKTOP_FILE)) {
const QByteArray id(WEATHER_GSETTING_OLD);
if (QGSettings::isSchemaInstalled(id)) {
m_pWeatherSetting = new QGSettings(id);
@@ -712,7 +712,7 @@ WeatherGsetting *WeatherGsetting::getInstance()
QString WeatherGsetting::getWeather()
{
//获取系统
- if (PLATFORM::Intel.compare(PLATFORM::g_platformType,Qt::CaseInsensitive) == 0) {
+ if (isFileExist(WEATHER_DESKTOP_FILE)) {
const QByteArray id(WEATHER_GSETTING_OLD);
if (QGSettings::isSchemaInstalled(id) && m_pWeatherSetting != nullptr \
&& m_pWeatherSetting->keys().contains(WEATHER_GSETTING_KEY)) {
@@ -740,7 +740,7 @@ QString WeatherGsetting::getWeather()
QString WeatherGsetting::getIcon()
{
//获取系统
- if (PLATFORM::Intel.compare(PLATFORM::g_platformType,Qt::CaseInsensitive) == 0) {
+ if (isFileExist(WEATHER_DESKTOP_FILE)) {
const QByteArray id(WEATHER_GSETTING_OLD);
if (QGSettings::isSchemaInstalled(id) && m_pWeatherSetting != nullptr \
&& m_pWeatherSetting->keys().contains(WEATHER_GSETTING_KEY)) {
@@ -765,6 +765,17 @@ QString WeatherGsetting::getIcon()
}
}
+bool WeatherGsetting::isFileExist(QString FullFileName)
+{
+ QFileInfo fileInfo(FullFileName);
+ if(fileInfo.isFile())
+ {
+ return true;
+ }
+ return false;
+}
+
+
//! 护眼中心
Q_GLOBAL_STATIC(EyeprotectionGsetting, eyeprotectionGsetting)
diff --git a/src/gsettingmanager.h b/src/gsettingmanager.h
index 7319a27..9440598 100644
--- a/src/gsettingmanager.h
+++ b/src/gsettingmanager.h
@@ -5,6 +5,7 @@
#include <QGSettings>
#include <QGuiApplication>
#include <QDebug>
+#include <QFileInfo>
#include "../platforminfo.h"
//! 控制中心-个性化部分
@@ -293,6 +294,7 @@ private:
#define WEATHER_GSETTING_OLD "org.china-weather-data.settings"
#define WEATHER_GSETTING_NEW "org.kylin-weather.settings"
#define WEATHER_GSETTING_KEY "weather"
+#define WEATHER_DESKTOP_FILE "/etc/xdg/autostart/indicator-china-weather.desktop"
class WeatherGsetting : public QObject
{
@@ -305,6 +307,7 @@ public:
QString getWeather();
QString getIcon();
+ bool isFileExist(QString FullFileName);
private:
QGSettings *m_pWeatherSetting = nullptr;
--
2.33.0

Binary file not shown.

BIN
ukui-sidebar-3.3.0.tar.gz Normal file

Binary file not shown.

View File

@ -1,11 +1,11 @@
%define debug_package %{nil}
Name: ukui-sidebar
Version: 3.1.0
Release: 1
Version: 3.3.0
Release: 3
Summary: parallels toolbox for UKUI
License: GPL-3+
URL: http://www.ukui.org
Source0: %{name}-%{version}.tar.gz
Patch01: 0001-fix-get-Weather-error.patch
BuildRequires: glib2-devel
BuildRequires: qt5-qtbase-devel
@ -16,16 +16,10 @@ BuildRequires: gsettings-qt-devel
BuildRequires: dconf-devel
BuildRequires: libX11-devel
BuildRequires: kf5-kwindowsystem-devel
BuildRequires: libXtst-devel
BuildRequires: libqtxdg-devel
BuildRequires: ukui-interface
Requires: glib2-devel
Requires: qt5-qtbase-devel
Requires: qt5-qtsvg-devel
Requires: qt5-qttools-devel
Requires: gsettings-qt-devel
Requires: dconf-devel
Recommends: ukui-notebook ukylin-feedback-client ukui-clock
%description
The ukui-sidebar is mainly used in the desktop operating system.
@ -35,16 +29,17 @@ Requires: dconf-devel
%prep
%setup -q
%patch01 -p1
%build
mkdir build && cd build
qmake-qt5 ..
make -j32
%{qmake_qt5} ..
%{make_build}
%install
rm -rf $RPM_BUILD_ROOT
cd %{_builddir}/%{name}-%{version}/build
make INSTALL_ROOT=%{buildroot} install
%{make_install} INSTALL_ROOT=%{buildroot}
%clean
rm -rf $RPM_BUILD_ROOT
@ -75,16 +70,50 @@ done
%{_bindir}/*
%{_libdir}/ukui-sidebar
%{_datadir}/ukui-sidebar*
%{_datadir}/glib-2.0/schemas/org.ukui.log4qt.ukui-sidebar.gschema.xml
%{_datadir}/glib-2.0/schemas/org.ukui.sidebar.gschema.xml
%{_datadir}/glib-2.0/schemas/
%changelog
* Tue Feb 22 2022 huayadong <huayadong@kylinos.cn> - 3.1.0-1
- update to upstream version 3.1.0-1
* Fri Feb 10 2023 peijiankang <peijiankang@kylinos.cn> - 3.3.0-3
- add build debuginfo and debugsource
* Thu Feb 10 2022 tanyulong <tanyulong@kylinos.cn> - 3.0.1-2
- add header file and fix build error
* Thu Jan 12 2023 peijiankang <peijiankang@kylinos.cn> - 3.3.0-2
- fix get Weather error
* Mon Oct 31 2022 peijiankang <peijiankang@kylinos.cn> - 3.3.0-1
- update version to 3.3.0
* Wed Aug 8 2022 huayadong <huayadong@kylinos.cn> - 3.0.1-11
- Fix alarm clock modify the alarm time to one
* Wed Aug 8 2022 huayadong <huayadong@kylinos.cn> - 3.0.1-11
- fix alarm clock in all drop down boxes the highlig
* Mon May 09 2022 pei-jiankang <peijiankang@kylinos.cn> - 3.0.1-10
- add qt5-qtx11extras-devel Requires
* Wed Apr 06 2022 huayadong <huayadong@kylinos.cn> - 3.0.1-9
- Optimize new and close logic
* Wed Apr 06 2022 tanyulong <tanyulong@kylinos.cn> - 3.0.1-8
- add yaml file
* Thu Dec 09 2021 huayadong <huayadong@kylinos.cn> - 3.0.1-7
- Add patch: ukui-sidebar-repair-clock-stopwatch-when-not-started-reset-button.patch
* Tue Dec 07 2021 huayadong <huayadong@kylinos.cn> - 3.0.1-6
- update to upstream version 3.0.0-1+1107
* Fri Dec 03 2021 tanyulong <tanyulong@kylinos.cn> - 3.0.1-5
- modify and update changelog
* Wed Nov 10 2021 tanyulong <tanyulong@kylinos.cn> - 3.0.1-4
- remove junk files
* Mon Nov 08 2021 tanyulong <tanyulong@kylinos.cn> - 3.0.1-3
- modify conflict
* Tue Nov 02 2021 tanyulong <tanyulong@kylinos.cn> - 3.0.1-2
- add changlog
* Mon Oct 26 2020 douyan <douyan@kylinos.cn> - 3.0.1-1
- update to upstream version 3.0.0-1+1103

4
ukui-sidebar.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: UKUI/ukui-sidebar
tag_prefix: "^v"
separator: "."