!19 update dtkcore to 5.6.8.2

From: @lliuzhi 
Reviewed-by: @ut-layne-yang 
Signed-off-by: @ut-layne-yang
This commit is contained in:
openeuler-ci-bot 2024-04-09 08:06:25 +00:00 committed by Gitee
commit 53165b3ac9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 116 additions and 110 deletions

View File

@ -0,0 +1,78 @@
From c2a3fb6efb854a9e10804f67fef0764042c2d6c5 Mon Sep 17 00:00:00 2001
From: liuzhilin <liuzhilin@uniontech.com>
Date: Fri, 22 Dec 2023 16:54:15 +0800
Subject: [PATCH] LSHW returns a multi-element array when querying memory size
---
src/dsysinfo.cpp | 36 +++++++++++++++++++++++++++++-------
1 file changed, 29 insertions(+), 7 deletions(-)
diff --git a/src/dsysinfo.cpp b/src/dsysinfo.cpp
index d3f137b..d8914cc 100644
--- a/src/dsysinfo.cpp
+++ b/src/dsysinfo.cpp
@@ -17,6 +17,7 @@
#include <QStandardPaths>
#include <QDateTime>
#include <QRegularExpression>
+#include <QLoggingCategory>
#include <qmath.h>
#ifdef Q_OS_LINUX
@@ -33,6 +34,12 @@
DCORE_BEGIN_NAMESPACE
+#ifdef QT_DEBUG
+Q_LOGGING_CATEGORY(logSysInfo, "dtk.dsysinfo")
+#else
+Q_LOGGING_CATEGORY(logSysInfo, "dtk.dsysinfo", QtInfoMsg)
+#endif
+
class Q_DECL_HIDDEN DSysInfoPrivate
{
public:
@@ -1087,18 +1094,33 @@ qint64 DSysInfo::memoryInstalledSize()
}
const QByteArray &lshwInfoJson = lshw.readAllStandardOutput();
- QJsonArray lshwResultArray = QJsonDocument::fromJson(lshwInfoJson).array();
- if (!lshwResultArray.isEmpty()) {
- QJsonValue memoryHwInfo = lshwResultArray.first();
- QString id = memoryHwInfo.toObject().value("id").toString();
- Q_ASSERT(id == "memory");
- siGlobal->memoryInstalledSize = memoryHwInfo.toObject().value("size").toDouble(); // TODO: check "units" is "bytes" ?
+ QJsonParseError error;
+ auto doc = QJsonDocument::fromJson(lshwInfoJson, &error);
+ if (error.error != QJsonParseError::NoError) {
+ qCWarning(logSysInfo(), "parse failed, expect json doc from lshw command");
+ return -1;
+ }
+
+ if (!doc.isArray()) {
+ qCWarning(logSysInfo(), "parse failed, expect array");
+ return -1;
+ }
+
+ QJsonArray lshwResultArray = doc.array();
+ for (const QJsonValue value : lshwResultArray) {
+ QJsonObject obj = value.toObject();
+ if (obj.contains("id") && obj.value("id").toString() == "memory") {
+ siGlobal->memoryInstalledSize = obj.value("size").toDouble(); // TODO: check "units" is "bytes" ?
+ break;
+ }
}
}
+ Q_ASSERT(siGlobal->memoryInstalledSize > 0);
return siGlobal->memoryInstalledSize;
-#endif
+#else
return -1;
+#endif
}
/*!
--
2.39.3

View File

@ -1,36 +0,0 @@
# dtkcore
#### Description
dtkcore
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -1,37 +0,0 @@
# dtkcore
#### 介绍
dtkcore
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

Binary file not shown.

BIN
dtkcore-5.6.8.2.tar.gz Normal file

Binary file not shown.

View File

@ -1,10 +1,12 @@
Name: dtkcore
Version: 5.5.35
Release: 1
Version: 5.6.8.2
Release: 2%{?dist}.01
Summary: Deepin tool kit core modules
License: LGPLv3+
URL: https://github.com/linuxdeepin/dtkcore
Source0: %{name}-%{version}.tar.gz
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch0001: 0001-LSHW-returns-a-multi-element-array-when-querying-mem.patch
BuildRequires: gcc-c++
#BuildRequires: annobin
@ -14,14 +16,18 @@ BuildRequires: gtest-devel
BuildRequires: qt5-qttools-devel
BuildRequires: dtkcommon-devel
BuildRequires: qt5-qtbase-private-devel
BuildRequires: make
BuildRequires: make cmake
BuildRequires: doxygen libicu-devel
BuildRequires: uchardet-devel
BuildRequires: cmake-rpm-macros
Requires: dtkcommon
# since f30
Obsoletes: deepin-tool-kit <= 0.3.3
Obsoletes: deepin-tool-kit-devel <= 0.3.3
Obsoletes: dtksettings <= 0.1.7
Obsoletes: dtksettings-devel <= 0.1.7
Obsoletes: dtkcore2
%description
Deepin tool kit core modules.
@ -36,16 +42,13 @@ Requires: qt5-qtbase-devel%{?_isa}
Header files and libraries for %{name}.
%prep
%autosetup -p1
%autosetup -n %{name}-%{version} -p1
%build
# help find (and prefer) qt5 utilities, e.g. qmake, lrelease
export PATH=%{_qt5_bindir}:$PATH
%qmake_qt5 PREFIX=%{_prefix} \
DTK_VERSION=%{version} \
LIB_INSTALL_DIR=%{_libdir} \
BIN_INSTALL_DIR=%{_libexecdir}/dtk5 \
TOOL_INSTALL_DIR=%{_libexecdir}/dtk5
%cmake
%make_build
%install
@ -55,41 +58,43 @@ export PATH=%{_qt5_bindir}:$PATH
%doc README.md
%license LICENSE
%{_libdir}/lib%{name}.so*
%dir %{_libexecdir}/dtk5/
%{_libexecdir}/dtk5/dtk-settings
%{_libexecdir}/dtk5/dtk-license.py
%{_libexecdir}/dtk5/dtk-translate.py
%{_libexecdir}/dtk5/deepin-os-release
%{_bindir}/qdbusxml2cpp-fix
%{_bindir}/*
%files devel
%doc doc/Specification.md
%{_includedir}/libdtk-*/
%doc docs/Specification.md
%{_qt5_archdatadir}/mkspecs/modules/*.pri
%{_libdir}/cmake/DtkCore/
%{_libdir}/cmake/DtkCMake/
%{_libdir}/cmake/DtkTools/
%{_libdir}/pkgconfig/dtkcore.pc
%{_libdir}/lib%{name}.so
%{_includedir}/dtk5/DCore/*
%{_usr}/lib/debug%{_libdir}/dtk5/DCore/bin/*.debug
%{_libdir}/cmake/DtkDConfig/DtkDConfigConfig.cmake
%{_libdir}/dtk5/DCore/bin/*
%{_libdir}/qt5/mkspecs/features/dtk_install_dconfig.prf
%{_datadir}/qt5/doc/dtkcore.qch
%changelog
* Mon Jul 24 2023 leeffo <liweiganga@uniontech.com> - 5.5.35-1
- update: upgrade to version 5.5.35
* Fri Dec 22 2023 liuzhilin <liuzhilin@uniontech.com> - 5.6.8.2-2.01
- fix: LSHW-returns-a-multi-element-array-when-querying-mem(bugid:228681)
* Wed Mar 22 2023 liweiganga <liweiganga@uniontech.com> - 5.5.19-1
- update: update to 5.5.19
* Tue Oct 10 2023 liweigang <liweiganga@uniontech.com> - 5.6.8.2-2
- spec: change Dcore path
* Thu Jul 28 2022 liweiganga <liweiganga@uniontech.com> - 5.4.11.2-2
- fix install conflict
* Mon Oct 09 2023 liweigang <liweiganga@uniontech.com> - 5.6.8.2-1
- update: update to verison 5.6.8.2
* Tue Jul 19 2022 konglidong <konglidong@uniontech.com> - 5.4.11.2-1
- Update to 5.4.11.2
* Sun Sep 03 2023 mahailiang <mahailiang@uniontech.com> - 5.6.8-2
- spec: change Dcore path
* Thu Jul 15 2021 weidong <weidong@uniontech.com> - 5.2.2.3-2
- Format specfile.
* Wed Aug 16 2023 liuzhilin <liuzhilin@uniontech.com> - 5.6.8-1
- update: update to 5.6.8
* Mon Jul 12 2021 weidong <weidong@uniontech.com> - 5.2.2.3-1
- Update 5.2.2.3
* Fri Dec 23 2022 liweiganga <liweiganga@uniontech.com> - 5.5.35-1
- update: update to 5.5.35
* Mon Jun 13 2022 uoser <uoser@uniontech.com> - 5.5.19-1.02
- update: update to 5.5.19-1.02
* Thu Jul 30 2020 openEuler Buildteam <buildteam@openeuler.org> - 5.2.1-1
- Package init

View File

@ -1,4 +0,0 @@
version_control: github
src_repo: linuxdeepin/dtkcore
tag_prefix: ^v
seperator: .