Compare commits
No commits in common. "53165b3ac9809387d233dcdf19e617fd10c7c4e0" and "e1517877ed0defb3bf6b01db3b28655f0b66e7b8" have entirely different histories.
53165b3ac9
...
e1517877ed
@ -1,78 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
36
README.en.md
Normal file
36
README.en.md
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# 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/)
|
||||||
37
README.md
Normal file
37
README.md
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# 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.
87
dtkcore.spec
87
dtkcore.spec
@ -1,29 +1,14 @@
|
|||||||
Name: dtkcore
|
Name: dtkcore
|
||||||
Version: 5.6.8.2
|
Version: 5.2.2.3+rpm
|
||||||
Release: 2%{?dist}.01
|
Release: 1
|
||||||
Summary: Deepin tool kit core modules
|
Summary: Deepin tool kit core modules
|
||||||
License: LGPLv3+
|
License: GPLv3
|
||||||
URL: https://github.com/linuxdeepin/dtkcore
|
URL: https://github.com/linuxdeepin/dtkcore
|
||||||
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
Source0: %{name}_%{version}.orig.tar.xz
|
||||||
|
|
||||||
Patch0001: 0001-LSHW-returns-a-multi-element-array-when-querying-mem.patch
|
|
||||||
|
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
#BuildRequires: annobin
|
BuildRequires: annobin
|
||||||
BuildRequires: pkgconfig(Qt5Core)
|
BuildRequires: pkgconfig(Qt5Core)
|
||||||
BuildRequires: pkgconfig(gsettings-qt)
|
BuildRequires: pkgconfig(gsettings-qt)
|
||||||
BuildRequires: gtest-devel
|
|
||||||
BuildRequires: qt5-qttools-devel
|
|
||||||
BuildRequires: dtkcommon-devel
|
|
||||||
BuildRequires: qt5-qtbase-private-devel
|
|
||||||
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 <= 0.3.3
|
||||||
Obsoletes: deepin-tool-kit-devel <= 0.3.3
|
Obsoletes: deepin-tool-kit-devel <= 0.3.3
|
||||||
Obsoletes: dtksettings <= 0.1.7
|
Obsoletes: dtksettings <= 0.1.7
|
||||||
@ -35,66 +20,54 @@ Deepin tool kit core modules.
|
|||||||
%package devel
|
%package devel
|
||||||
Summary: Development package for %{name}
|
Summary: Development package for %{name}
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
Requires: dtkcommon-devel
|
Requires: qt5-qtbase-devel
|
||||||
Requires: qt5-qtbase-devel%{?_isa}
|
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
Header files and libraries for %{name}.
|
Header files and libraries for %{name}.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{name}-%{version} -p1
|
%setup -q
|
||||||
|
|
||||||
|
sed -i 's|/lib|/libexec|' tools/settings/settings.pro
|
||||||
%build
|
%build
|
||||||
# help find (and prefer) qt5 utilities, e.g. qmake, lrelease
|
|
||||||
export PATH=%{_qt5_bindir}:$PATH
|
export PATH=%{_qt5_bindir}:$PATH
|
||||||
%cmake
|
%qmake_qt5 PREFIX=%{_prefix} \
|
||||||
|
DTK_VERSION=%{version} \
|
||||||
|
LIB_INSTALL_DIR=%{_libdir} \
|
||||||
|
BIN_INSTALL_DIR=%{_libexecdir}/dtk5 \
|
||||||
|
TOOL_INSTALL_DIR=%{_libexecdir}/dtk5
|
||||||
%make_build
|
%make_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install INSTALL_ROOT=%{buildroot}
|
%make_install INSTALL_ROOT=%{buildroot}
|
||||||
|
|
||||||
|
%ldconfig_scriptlets
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{_libdir}/lib%{name}.so*
|
%{_libdir}/libdtkcore.so.*
|
||||||
%{_bindir}/*
|
%{_libexecdir}/dtk5/dtk-settings
|
||||||
|
%{_libexecdir}/dtk5/dtk-license.py*
|
||||||
|
%{_libexecdir}/dtk5/dtk-translate.py*
|
||||||
|
%{_libexecdir}/dtk5/deepin-os-release
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%doc docs/Specification.md
|
%doc doc/Specification.md
|
||||||
|
%{_includedir}/libdtk-*/
|
||||||
|
%{_qt5_archdatadir}/mkspecs/features/*.prf
|
||||||
%{_qt5_archdatadir}/mkspecs/modules/*.pri
|
%{_qt5_archdatadir}/mkspecs/modules/*.pri
|
||||||
|
%{_libdir}/cmake/Dtk/
|
||||||
%{_libdir}/cmake/DtkCore/
|
%{_libdir}/cmake/DtkCore/
|
||||||
%{_libdir}/cmake/DtkCMake/
|
%{_libdir}/cmake/DtkCMake/
|
||||||
%{_libdir}/cmake/DtkTools/
|
%{_libdir}/cmake/DtkTools/
|
||||||
%{_libdir}/pkgconfig/dtkcore.pc
|
%{_libdir}/pkgconfig/dtkcore.pc
|
||||||
%{_libdir}/lib%{name}.so
|
%{_libdir}/libdtkcore.so
|
||||||
%{_includedir}/dtk5/DCore/*
|
/usr/share/glib-2.0/schemas/*
|
||||||
%{_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
|
%changelog
|
||||||
* Fri Dec 22 2023 liuzhilin <liuzhilin@uniontech.com> - 5.6.8.2-2.01
|
* Mon Jul 12 2021 weidong <weidong@uniontech.com> - 5.2.2.3-1
|
||||||
- fix: LSHW-returns-a-multi-element-array-when-querying-mem(bugid:228681)
|
- Update 5.2.2.3
|
||||||
|
|
||||||
* Tue Oct 10 2023 liweigang <liweiganga@uniontech.com> - 5.6.8.2-2
|
|
||||||
- spec: change Dcore path
|
|
||||||
|
|
||||||
* Mon Oct 09 2023 liweigang <liweiganga@uniontech.com> - 5.6.8.2-1
|
|
||||||
- update: update to verison 5.6.8.2
|
|
||||||
|
|
||||||
* Sun Sep 03 2023 mahailiang <mahailiang@uniontech.com> - 5.6.8-2
|
|
||||||
- spec: change Dcore path
|
|
||||||
|
|
||||||
* Wed Aug 16 2023 liuzhilin <liuzhilin@uniontech.com> - 5.6.8-1
|
|
||||||
- update: update to 5.6.8
|
|
||||||
|
|
||||||
* 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
|
||||||
|
|||||||
4
dtkcore.yaml
Normal file
4
dtkcore.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: github
|
||||||
|
src_repo: linuxdeepin/dtkcore
|
||||||
|
tag_prefix: ^v
|
||||||
|
seperator: .
|
||||||
BIN
dtkcore_5.2.2.3+rpm.orig.tar.xz
Normal file
BIN
dtkcore_5.2.2.3+rpm.orig.tar.xz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user