Compare commits
29 Commits
release-5.
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
46e6d5e8e5 | |
|
|
84b0b917b9 | |
|
|
840b931148 | |
|
|
8e85a7cd54 | |
|
|
14c291e1ef | |
|
|
dbf42d7701 | |
|
|
b7f1f8afef | |
|
|
c5be272ad8 | |
|
|
d2d91a87a3 | |
|
|
440fca2efd | |
|
|
bcd59cb836 | |
|
|
c9a2ad0b37 | |
|
|
efb8be8218 | |
|
|
fe1e9715a2 | |
|
|
39b91e4b79 | |
|
|
2ffc340446 | |
|
|
2cbf1b55d0 | |
|
|
befdd9f0d2 | |
|
|
e900940de3 | |
|
|
97e66aaaf4 | |
|
|
80a5f3edce | |
|
|
df43a12293 | |
|
|
5042e3af39 | |
|
|
72c74eec4b | |
|
|
303f32e5c7 | |
|
|
374dca6299 | |
|
|
7bf69bc64d | |
|
|
3446cbed57 | |
|
|
629c6ebe01 |
|
|
@ -5,7 +5,7 @@ on:
|
||||||
version:
|
version:
|
||||||
description: 'Release version (e.g., 1.0.0)'
|
description: 'Release version (e.g., 1.0.0)'
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: false
|
||||||
name:
|
name:
|
||||||
description: 'The name of the person to release the version'
|
description: 'The name of the person to release the version'
|
||||||
type: string
|
type: string
|
||||||
|
|
|
||||||
95
CHANGELOG.md
95
CHANGELOG.md
|
|
@ -1,3 +1,98 @@
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [5.7.25] - 2025-10-30
|
||||||
|
|
||||||
|
## [5.7.24] - 2025-10-16
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Support Qt 6.10
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Replace rmdir with rename for directory operations
|
||||||
|
- Prevent thread-safety issue in D-Bus config manager
|
||||||
|
- Sync with qt5platform-plugins
|
||||||
|
|
||||||
|
## [5.7.23] - 2025-09-25
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Add fallback type conversion in demarshall function
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Feat: DPinyin::firstLetters support set ToneStyle
|
||||||
|
- 增加服务器教育版和国防版
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix trash validation for symlinks
|
||||||
|
- Fix heap-use-after-free issue
|
||||||
|
- Fix dconfig static variable release issue
|
||||||
|
|
||||||
|
## [5.7.22] - 2025-09-04
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Resolve non-reproducible DBUS code generation issue
|
||||||
|
|
||||||
|
## [5.7.21] - 2025-08-14
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Add deprecation ignore support for DTK
|
||||||
|
|
||||||
|
## [5.7.20] - 2025-07-31
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Improve D-Bus resource management with RAII
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Use QCoreApplication for application name
|
||||||
|
- Resolve compilation warnings and Qt6 compatibility issues
|
||||||
|
|
||||||
|
## [5.7.19] - 2025-07-03
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Add security hardening flags to build configuration
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Replace QtDBus with libdbus-1 in dsgapplication
|
||||||
|
|
||||||
|
## [5.7.18] - 2025-06-27
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Improve logging rules environment variable handling
|
||||||
|
- Copy cachePrefix in DConfigFile copy constructor
|
||||||
|
- Make version parameter optional in release workflow
|
||||||
|
|
||||||
|
## [5.7.17] - 2025-06-18
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Feat(ci): add auto release
|
||||||
|
- Add license for VERSION.in
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Support VERSION file
|
||||||
|
- Update .syncexclude
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- .deepin@main -> .deepin@master
|
||||||
|
|
||||||
<a name="5.7.14"></a>
|
<a name="5.7.14"></a>
|
||||||
## 5.7.14 (2025-04-12)
|
## 5.7.14 (2025-04-12)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Maintainer: justforlxz <justforlxz@gmail.com>
|
# Maintainer: justforlxz <justforlxz@gmail.com>
|
||||||
pkgname=dtkcore-git
|
pkgname=dtkcore-git
|
||||||
pkgver=5.7.15
|
pkgver=5.7.25
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
sourcename=dtkcore
|
sourcename=dtkcore
|
||||||
sourcetars=("$sourcename"_"$pkgver".tar.xz)
|
sourcetars=("$sourcename"_"$pkgver".tar.xz)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,57 @@
|
||||||
|
dtkcore (5.7.25) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Release 5.7.25
|
||||||
|
|
||||||
|
-- yeshanshan <yeshanshan@uniontech.com> Thu, 30 Oct 2025 21:47:32 +0800
|
||||||
|
|
||||||
|
dtkcore (5.7.24) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Release 5.7.24
|
||||||
|
|
||||||
|
-- yeshanshan <yeshanshan@uniontech.com> Thu, 16 Oct 2025 19:45:57 +0800
|
||||||
|
|
||||||
|
dtkcore (5.7.23) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Release 5.7.23
|
||||||
|
|
||||||
|
-- yeshanshan <packages@deepin.org> Thu, 25 Sep 2025 16:49:58 +0800
|
||||||
|
|
||||||
|
dtkcore (5.7.22) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Release 5.7.22
|
||||||
|
|
||||||
|
-- yeshanshan <yeshanshan@uniontech.com> Thu, 04 Sep 2025 19:27:28 +0800
|
||||||
|
|
||||||
|
dtkcore (5.7.21) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Release 5.7.21
|
||||||
|
|
||||||
|
-- yeshanshan <packages@deepin.org> Thu, 14 Aug 2025 19:47:41 +0800
|
||||||
|
|
||||||
|
dtkcore (5.7.20) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Release 5.7.20
|
||||||
|
|
||||||
|
-- yeshanshan <yeshanshan@uniontech.com> Thu, 31 Jul 2025 20:00:27 +0800
|
||||||
|
|
||||||
|
dtkcore (5.7.19) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Release 5.7.19
|
||||||
|
|
||||||
|
-- yeshanshan <yeshanshan@uniontech.com> Thu, 03 Jul 2025 21:11:07 +0800
|
||||||
|
|
||||||
|
dtkcore (5.7.18) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Release 5.7.18
|
||||||
|
|
||||||
|
-- yeshanshan <yeshanshan@uniontech.com> Fri, 27 Jun 2025 17:07:16 +0800
|
||||||
|
|
||||||
|
dtkcore (5.7.17) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Release 5.7.17
|
||||||
|
|
||||||
|
-- asterwyx <wangyixue@uniontech.com> Wed, 18 Jun 2025 18:01:08 +0800
|
||||||
|
|
||||||
dtkcore (5.7.16) unstable; urgency=medium
|
dtkcore (5.7.16) unstable; urgency=medium
|
||||||
|
|
||||||
* fix: add missing UosMilitary edition type cases
|
* fix: add missing UosMilitary edition type cases
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ Maintainer: Deepin Packages Builder <packages@deepin.com>
|
||||||
Build-Depends: debhelper-compat ( =12), pkg-config,
|
Build-Depends: debhelper-compat ( =12), pkg-config,
|
||||||
qttools5-dev-tools, qttools5-dev, qtbase5-private-dev, doxygen,
|
qttools5-dev-tools, qttools5-dev, qtbase5-private-dev, doxygen,
|
||||||
libgsettings-qt-dev, libgtest-dev, libdtkcommon-dev, cmake,
|
libgsettings-qt-dev, libgtest-dev, libdtkcommon-dev, cmake,
|
||||||
libuchardet-dev, libicu-dev, libdtklog-dev
|
libuchardet-dev, libicu-dev, libdtklog-dev, libdbus-1-dev
|
||||||
Standards-Version: 3.9.8
|
Standards-Version: 3.9.8
|
||||||
|
|
||||||
Package: libdtkcore5
|
Package: libdtkcore5
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,12 @@ include /usr/share/dpkg/default.mk
|
||||||
export QT_SELECT = qt5
|
export QT_SELECT = qt5
|
||||||
export DEB_CXXFLAGS_MAINT_APPEND = -Ofast
|
export DEB_CXXFLAGS_MAINT_APPEND = -Ofast
|
||||||
|
|
||||||
|
# 安全编译参数
|
||||||
|
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||||
|
export DEB_CFLAGS_MAINT_APPEND = -Wall
|
||||||
|
export DEB_CXXFLAGS_MAINT_APPEND = -Wall
|
||||||
|
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-E
|
||||||
|
|
||||||
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||||
|
|
||||||
VERSION = $(DEB_VERSION_UPSTREAM)
|
VERSION = $(DEB_VERSION_UPSTREAM)
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ public:
|
||||||
UosMilitaryS, // for Server
|
UosMilitaryS, // for Server
|
||||||
UosDeviceEdition,
|
UosDeviceEdition,
|
||||||
UosEducation,
|
UosEducation,
|
||||||
|
UosDefense,
|
||||||
|
|
||||||
UosEditionCount // must at last
|
UosEditionCount // must at last
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,11 @@
|
||||||
|
|
||||||
#if defined(DTK_STATIC_LIB)
|
#if defined(DTK_STATIC_LIB)
|
||||||
# define LIBDTKCORESHARED_EXPORT
|
# define LIBDTKCORESHARED_EXPORT
|
||||||
|
# define D_IGNORE_DEPRECATIONS
|
||||||
#else
|
#else
|
||||||
#if defined(LIBDTKCORE_LIBRARY)
|
#if defined(LIBDTKCORE_LIBRARY)
|
||||||
# define LIBDTKCORESHARED_EXPORT Q_DECL_EXPORT
|
# define LIBDTKCORESHARED_EXPORT Q_DECL_EXPORT
|
||||||
|
# define D_IGNORE_DEPRECATIONS
|
||||||
#else
|
#else
|
||||||
# define LIBDTKCORESHARED_EXPORT Q_DECL_IMPORT
|
# define LIBDTKCORESHARED_EXPORT Q_DECL_IMPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -47,6 +49,10 @@
|
||||||
#define D_DECL_DEPRECATED_X(text) Q_DECL_HIDDEN
|
#define D_DECL_DEPRECATED_X(text) Q_DECL_HIDDEN
|
||||||
#define D_DECL_DEPRECATED Q_DECL_HIDDEN
|
#define D_DECL_DEPRECATED Q_DECL_HIDDEN
|
||||||
#else
|
#else
|
||||||
|
#if defined(D_IGNORE_DEPRECATIONS)
|
||||||
|
#define D_DECL_DEPRECATED
|
||||||
|
#define D_DECL_DEPRECATED_X(text)
|
||||||
|
#else
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#if __GNUC__ < 13
|
#if __GNUC__ < 13
|
||||||
#define D_DECL_DEPRECATED __attribute__((__deprecated__))
|
#define D_DECL_DEPRECATED __attribute__((__deprecated__))
|
||||||
|
|
@ -60,6 +66,7 @@
|
||||||
#define D_DECL_DEPRECATED_X Q_DECL_DEPRECATED_X
|
#define D_DECL_DEPRECATED_X Q_DECL_DEPRECATED_X
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DTK_VERSION_CHECK(major, minor, patch, build) ((major<<24)|(minor<<16)|(patch<<8)|build)
|
#define DTK_VERSION_CHECK(major, minor, patch, build) ((major<<24)|(minor<<16)|(patch<<8)|build)
|
||||||
#define DTK_VERSION DTK_VERSION_CHECK(DTK_VERSION_MAJOR, DTK_VERSION_MINOR, DTK_VERSION_PATCH, DTK_VERSION_BUILD)
|
#define DTK_VERSION DTK_VERSION_CHECK(DTK_VERSION_MAJOR, DTK_VERSION_MINOR, DTK_VERSION_PATCH, DTK_VERSION_BUILD)
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ QStringList LIBDTKCORESHARED_EXPORT pinyin(const QString& words, ToneStyle ts =
|
||||||
|
|
||||||
// support polyphonic
|
// support polyphonic
|
||||||
QStringList LIBDTKCORESHARED_EXPORT firstLetters(const QString& words);
|
QStringList LIBDTKCORESHARED_EXPORT firstLetters(const QString& words);
|
||||||
|
QStringList LIBDTKCORESHARED_EXPORT firstLetters(const QString& words, ToneStyle ts);
|
||||||
|
|
||||||
DCORE_END_NAMESPACE
|
DCORE_END_NAMESPACE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
Name: dtkcore
|
Name: dtkcore
|
||||||
Version: 5.5.18
|
Version: 5.7.25
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: Deepin tool kit core modules
|
Summary: Deepin tool kit core modules
|
||||||
License: LGPLv3+
|
License: LGPLv3+
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,20 @@ set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||||
find_package(Dtk${DTK_VERSION_MAJOR}Log REQUIRED)
|
find_package(Dtk${DTK_VERSION_MAJOR}Log REQUIRED)
|
||||||
|
find_package(DBus1 REQUIRED)
|
||||||
if(LINUX)
|
if(LINUX)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS DBus)
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS DBus)
|
||||||
if("${QT_VERSION_MAJOR}" STREQUAL "5")
|
|
||||||
pkg_check_modules(QGSettings REQUIRED IMPORTED_TARGET gsettings-qt) #Dtk6 removed.
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
if(${QT_VERSION_MAJOR} EQUAL 5)
|
||||||
|
pkg_check_modules(QGSettings REQUIRED IMPORTED_TARGET gsettings-qt) #Dtk6 removed.
|
||||||
|
elseif(${QT_VERSION_MAJOR} EQUAL 6)
|
||||||
|
if(${Qt6Core_VERSION} VERSION_GREATER_EQUAL 6.10.0)
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS CorePrivate)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Unsupported Qt version: ${QT_VERSION_MAJOR}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Xml)
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Xml)
|
||||||
find_package(DtkBuildHelper REQUIRED)
|
find_package(DtkBuildHelper REQUIRED)
|
||||||
|
|
@ -24,6 +31,12 @@ find_package(ICU REQUIRED COMPONENTS uc)
|
||||||
pkg_check_modules(uchardet REQUIRED uchardet)
|
pkg_check_modules(uchardet REQUIRED uchardet)
|
||||||
# end text encoding
|
# end text encoding
|
||||||
|
|
||||||
|
# 为不包含实际QObject类的头文件跳过AutoMOC处理
|
||||||
|
set_property(SOURCE ../include/base/dsingleton.h PROPERTY SKIP_AUTOMOC ON)
|
||||||
|
if("${DTK_VERSION_MAJOR}" STREQUAL "6")
|
||||||
|
set_property(SOURCE ../include/util/dthreadutils.h PROPERTY SKIP_AUTOMOC ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
# start base
|
# start base
|
||||||
include(base/base.cmake)
|
include(base/base.cmake)
|
||||||
# end base
|
# end base
|
||||||
|
|
@ -114,6 +127,9 @@ target_compile_definitions(${LIB_NAME} PRIVATE
|
||||||
LIBDTKCORE_LIBRARY
|
LIBDTKCORE_LIBRARY
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(${LIB_NAME} PRIVATE
|
||||||
|
dbus-1
|
||||||
|
)
|
||||||
target_include_directories(${LIB_NAME} PRIVATE
|
target_include_directories(${LIB_NAME} PRIVATE
|
||||||
${uchardet_INCLUDE_DIRS}
|
${uchardet_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -621,10 +621,20 @@ bool DDciFileEngine::supportsExtension(QAbstractFileEngine::Extension extension)
|
||||||
return extension == AtEndExtension;
|
return extension == AtEndExtension;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
|
||||||
|
DDciFileEngine::TriStateResult DDciFileEngine::cloneTo(QAbstractFileEngine *target)
|
||||||
|
#else
|
||||||
bool DDciFileEngine::cloneTo(QAbstractFileEngine *target)
|
bool DDciFileEngine::cloneTo(QAbstractFileEngine *target)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
const QByteArray &data = file->dataRef(subfilePath);
|
const QByteArray &data = file->dataRef(subfilePath);
|
||||||
return target->write(data.constData(), data.size()) == data.size();
|
auto ret = target->write(data.constData(), data.size()) == data.size();
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
|
||||||
|
return ret ? DDciFileEngine::TriStateResult::Success : DDciFileEngine::TriStateResult::Failed;
|
||||||
|
#else
|
||||||
|
return ret;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DDciFileEngine::forceSave(bool writeFile) const
|
bool DDciFileEngine::forceSave(bool writeFile) const
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,11 @@ public:
|
||||||
ExtensionReturn *output = 0) override;
|
ExtensionReturn *output = 0) override;
|
||||||
bool supportsExtension(Extension extension) const override;
|
bool supportsExtension(Extension extension) const override;
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
|
||||||
|
TriStateResult cloneTo(QAbstractFileEngine *target) override;
|
||||||
|
#else
|
||||||
bool cloneTo(QAbstractFileEngine *target) override;
|
bool cloneTo(QAbstractFileEngine *target) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool forceSave(bool writeFile = false) const;
|
bool forceSave(bool writeFile = false) const;
|
||||||
|
|
|
||||||
|
|
@ -173,13 +173,13 @@ public:
|
||||||
if (owner->appId == NoAppId)
|
if (owner->appId == NoAppId)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
QScopedPointer<DConfigFile> file(new DConfigFile(NoAppId, owner->name, owner->subpath));
|
std::unique_ptr<DConfigFile> file(new DConfigFile(NoAppId, owner->name, owner->subpath));
|
||||||
const bool canFallbackToGeneric = !file->meta()->metaPath(prefix).isEmpty();
|
const bool canFallbackToGeneric = !file->meta()->metaPath(prefix).isEmpty();
|
||||||
if (canFallbackToGeneric) {
|
if (canFallbackToGeneric) {
|
||||||
QScopedPointer<DConfigCache> cache(file->createUserCache(getuid()));
|
std::unique_ptr<DConfigCache> cache(file->createUserCache(getuid()));
|
||||||
if (file->load(prefix) && cache->load(prefix)) {
|
if (file->load(prefix) && cache->load(prefix)) {
|
||||||
genericConfigFile.reset(file.take());
|
genericConfigFile.reset(file.release());
|
||||||
genericConfigCache.reset(cache.take());
|
genericConfigCache.reset(cache.release());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -326,15 +326,16 @@ public:
|
||||||
DSGConfig dsg_config(DSG_CONFIG, "/", QDBusConnection::systemBus());
|
DSGConfig dsg_config(DSG_CONFIG, "/", QDBusConnection::systemBus());
|
||||||
QDBusPendingReply<QDBusObjectPath> dbus_reply = dsg_config.acquireManager(owner->appId, owner->name, owner->subpath);
|
QDBusPendingReply<QDBusObjectPath> dbus_reply = dsg_config.acquireManager(owner->appId, owner->name, owner->subpath);
|
||||||
const QDBusObjectPath dbus_path = dbus_reply.value();
|
const QDBusObjectPath dbus_path = dbus_reply.value();
|
||||||
if (dbus_reply.isError() || dbus_path.path().isEmpty()) {
|
const auto path = dbus_path.path(); // 显式拷贝,避免其它线程共用systemBus连接而修改dbus数据
|
||||||
|
if (dbus_reply.isError() || path.isEmpty()) {
|
||||||
qCWarning(cfLog, "Can't acquire config manager. error:\"%s\"", qPrintable(dbus_reply.error().message()));
|
qCWarning(cfLog, "Can't acquire config manager. error:\"%s\"", qPrintable(dbus_reply.error().message()));
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
qCDebug(cfLog(), "dbus path=\"%s\"", qPrintable(dbus_path.path()));
|
qCDebug(cfLog, "dbus path=\"%s\"", qPrintable(path));
|
||||||
config.reset(new DSGConfigManager(DSG_CONFIG_MANAGER, dbus_path.path(),
|
config.reset(new DSGConfigManager(DSG_CONFIG_MANAGER, path,
|
||||||
QDBusConnection::systemBus(), owner->q_func()));
|
QDBusConnection::systemBus(), owner->q_func()));
|
||||||
if (!config->isValid()) {
|
if (!config->isValid()) {
|
||||||
qCWarning(cfLog(), "Can't acquire config path=\"%s\"", qPrintable(dbus_path.path()));
|
qCWarning(cfLog, "Can't acquire config path=\"%s\"", qPrintable(path));
|
||||||
config.reset();
|
config.reset();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -370,7 +371,7 @@ public:
|
||||||
complexType >> list;
|
complexType >> list;
|
||||||
QVariantList res;
|
QVariantList res;
|
||||||
res.reserve(list.size());
|
res.reserve(list.size());
|
||||||
for (const auto &item : qAsConst(list)) {
|
for (const auto &item : std::as_const(list)) {
|
||||||
res << decodeQDBusArgument(item);
|
res << decodeQDBusArgument(item);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
|
|
@ -1407,6 +1407,7 @@ DConfigFile::DConfigFile(const DConfigFile &other)
|
||||||
D_D(DConfigFile);
|
D_D(DConfigFile);
|
||||||
auto cache = new DConfigCacheImpl(d->configKey, InvalidUID, true);
|
auto cache = new DConfigCacheImpl(d->configKey, InvalidUID, true);
|
||||||
cache->values = other.d_func()->globalCache->values;
|
cache->values = other.d_func()->globalCache->values;
|
||||||
|
cache->cachePrefix = other.d_func()->globalCache->cachePrefix;
|
||||||
d->globalCache = cache;
|
d->globalCache = cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,10 @@
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDBusUnixFileDescriptor>
|
|
||||||
#include <QDBusReply>
|
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QDBusConnectionInterface>
|
|
||||||
|
|
||||||
#include <DDBusInterface>
|
#include <dbus/dbus.h>
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
Q_LOGGING_CATEGORY(dsgApp, "dtk.core.dsg")
|
Q_LOGGING_CATEGORY(dsgApp, "dtk.core.dsg")
|
||||||
|
|
@ -28,6 +25,198 @@ Q_LOGGING_CATEGORY(dsgApp, "dtk.core.dsg", QtInfoMsg)
|
||||||
|
|
||||||
DCORE_BEGIN_NAMESPACE
|
DCORE_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
// D-Bus resource deleters for RAII management
|
||||||
|
static void dbusErrorDeleter(DBusError *error) {
|
||||||
|
if (error) { dbus_error_free(error); delete error; }
|
||||||
|
}
|
||||||
|
|
||||||
|
static void dbusConnectionDeleter(DBusConnection *conn) {
|
||||||
|
if (conn) dbus_connection_unref(conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void dbusMessageDeleter(DBusMessage *msg) {
|
||||||
|
if (msg) dbus_message_unref(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// D-Bus utility functions using libdbus-1
|
||||||
|
static bool checkDBusServiceActivatable(const QByteArray &service)
|
||||||
|
{
|
||||||
|
auto error = std::unique_ptr<DBusError, void(*)(DBusError*)>(new DBusError, dbusErrorDeleter);
|
||||||
|
dbus_error_init(error.get());
|
||||||
|
|
||||||
|
DBusConnection *connection = dbus_bus_get(DBUS_BUS_SESSION, error.get());
|
||||||
|
if (dbus_error_is_set(error.get())) {
|
||||||
|
qCWarning(dsgApp) << "Failed to connect to session bus:" << error->message;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!connection) {
|
||||||
|
qCWarning(dsgApp) << "Failed to get session bus connection";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
auto connGuard = std::unique_ptr<DBusConnection, void(*)(DBusConnection*)>(connection, dbusConnectionDeleter);
|
||||||
|
|
||||||
|
// Create method call to check if service is registered
|
||||||
|
DBusMessage *msg = dbus_message_new_method_call(
|
||||||
|
"org.freedesktop.DBus",
|
||||||
|
"/org/freedesktop/DBus",
|
||||||
|
"org.freedesktop.DBus",
|
||||||
|
"NameHasOwner"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!msg) {
|
||||||
|
qCWarning(dsgApp) << "Failed to create D-Bus message";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
auto msgGuard = std::unique_ptr<DBusMessage, void(*)(DBusMessage*)>(msg, dbusMessageDeleter);
|
||||||
|
|
||||||
|
{
|
||||||
|
const char *serviceName = service.constData();
|
||||||
|
if (!dbus_message_append_args(msg, DBUS_TYPE_STRING, &serviceName, DBUS_TYPE_INVALID)) {
|
||||||
|
qCWarning(dsgApp) << "Failed to append arguments to D-Bus message";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send message and get reply
|
||||||
|
DBusMessage *reply = dbus_connection_send_with_reply_and_block(connection, msg, 1000, error.get());
|
||||||
|
msgGuard.reset(); // msg is consumed by the call
|
||||||
|
|
||||||
|
if (dbus_error_is_set(error.get())) {
|
||||||
|
qCWarning(dsgApp) << "D-Bus call failed:" << error->message;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!reply) {
|
||||||
|
qCWarning(dsgApp) << "No reply received from D-Bus";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
auto replyGuard = std::unique_ptr<DBusMessage, void(*)(DBusMessage*)>(reply, dbusMessageDeleter);
|
||||||
|
|
||||||
|
dbus_bool_t hasOwner = FALSE;
|
||||||
|
if (!dbus_message_get_args(reply, error.get(), DBUS_TYPE_BOOLEAN, &hasOwner, DBUS_TYPE_INVALID)) {
|
||||||
|
qCWarning(dsgApp) << "Failed to parse D-Bus reply:" << error->message;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasOwner) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if service is activatable
|
||||||
|
DBusMessage *msg2 = dbus_message_new_method_call(
|
||||||
|
"org.freedesktop.DBus",
|
||||||
|
"/org/freedesktop/DBus",
|
||||||
|
"org.freedesktop.DBus",
|
||||||
|
"ListActivatableNames"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!msg2) {
|
||||||
|
qCWarning(dsgApp) << "Failed to create ListActivatableNames message";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
auto msg2Guard = std::unique_ptr<DBusMessage, void(*)(DBusMessage*)>(msg2, dbusMessageDeleter);
|
||||||
|
|
||||||
|
DBusMessage *reply2 = dbus_connection_send_with_reply_and_block(connection, msg2, 1000, error.get());
|
||||||
|
|
||||||
|
if (dbus_error_is_set(error.get())) {
|
||||||
|
qCWarning(dsgApp) << "ListActivatableNames call failed:" << error->message;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!reply2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
auto reply2Guard = std::unique_ptr<DBusMessage, void(*)(DBusMessage*)>(reply2, dbusMessageDeleter);
|
||||||
|
|
||||||
|
DBusMessageIter iter, array_iter;
|
||||||
|
dbus_message_iter_init(reply2, &iter);
|
||||||
|
|
||||||
|
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
dbus_message_iter_recurse(&iter, &array_iter);
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
|
while (dbus_message_iter_get_arg_type(&array_iter) == DBUS_TYPE_STRING) {
|
||||||
|
const char *name;
|
||||||
|
dbus_message_iter_get_basic(&array_iter, &name);
|
||||||
|
if (service == name) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
dbus_message_iter_next(&array_iter);
|
||||||
|
}
|
||||||
|
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
static QByteArray callDBusIdentifyMethod(const QByteArray &serviceName, const QByteArray &path,
|
||||||
|
const QByteArray &interface, int pidfd)
|
||||||
|
{
|
||||||
|
auto error = std::unique_ptr<DBusError, void(*)(DBusError*)>(new DBusError, dbusErrorDeleter);
|
||||||
|
dbus_error_init(error.get());
|
||||||
|
|
||||||
|
DBusConnection *connection = dbus_bus_get(DBUS_BUS_SESSION, error.get());
|
||||||
|
if (dbus_error_is_set(error.get())) {
|
||||||
|
qCWarning(dsgApp) << "Failed to connect to session bus:" << error->message;
|
||||||
|
return QByteArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!connection) {
|
||||||
|
qCWarning(dsgApp) << "Failed to get session bus connection";
|
||||||
|
return QByteArray();
|
||||||
|
}
|
||||||
|
auto connGuard = std::unique_ptr<DBusConnection, void(*)(DBusConnection*)>(connection, dbusConnectionDeleter);
|
||||||
|
|
||||||
|
// Create method call - string data is now managed by caller
|
||||||
|
DBusMessage *msg = dbus_message_new_method_call(
|
||||||
|
serviceName.constData(),
|
||||||
|
path.constData(),
|
||||||
|
interface.constData(),
|
||||||
|
"Identify"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!msg) {
|
||||||
|
qCWarning(dsgApp) << "Failed to create D-Bus message";
|
||||||
|
return QByteArray();
|
||||||
|
}
|
||||||
|
auto msgGuard = std::unique_ptr<DBusMessage, void(*)(DBusMessage*)>(msg, dbusMessageDeleter);
|
||||||
|
|
||||||
|
// Append Unix file descriptor
|
||||||
|
if (!dbus_message_append_args(msg, DBUS_TYPE_UNIX_FD, &pidfd, DBUS_TYPE_INVALID)) {
|
||||||
|
qCWarning(dsgApp) << "Failed to append Unix FD to D-Bus message";
|
||||||
|
return QByteArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send message and get reply
|
||||||
|
DBusMessage *reply = dbus_connection_send_with_reply_and_block(connection, msg, 5000, error.get());
|
||||||
|
msgGuard.reset(); // msg is consumed by the call
|
||||||
|
|
||||||
|
if (dbus_error_is_set(error.get())) {
|
||||||
|
qCWarning(dsgApp) << "Identify from AM failed:" << error->message;
|
||||||
|
return QByteArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!reply) {
|
||||||
|
qCWarning(dsgApp) << "No reply received from Identify method";
|
||||||
|
return QByteArray();
|
||||||
|
}
|
||||||
|
auto replyGuard = std::unique_ptr<DBusMessage, void(*)(DBusMessage*)>(reply, dbusMessageDeleter);
|
||||||
|
|
||||||
|
const char *result;
|
||||||
|
if (!dbus_message_get_args(reply, error.get(), DBUS_TYPE_STRING, &result, DBUS_TYPE_INVALID)) {
|
||||||
|
qCWarning(dsgApp) << "Failed to parse Identify reply:" << error->message;
|
||||||
|
return QByteArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
QByteArray appId = QByteArray(result);
|
||||||
|
qCInfo(dsgApp) << "AppId is fetched from AM, and value is " << appId;
|
||||||
|
|
||||||
|
return appId;
|
||||||
|
}
|
||||||
|
|
||||||
static inline QByteArray getSelfAppId() {
|
static inline QByteArray getSelfAppId() {
|
||||||
// The env is set by the application starter(eg, org.desktopspec.ApplicationManager service)
|
// The env is set by the application starter(eg, org.desktopspec.ApplicationManager service)
|
||||||
QByteArray selfId = qgetenv("DSG_APP_ID");
|
QByteArray selfId = qgetenv("DSG_APP_ID");
|
||||||
|
|
@ -36,17 +225,9 @@ static inline QByteArray getSelfAppId() {
|
||||||
return DSGApplication::getId(QCoreApplication::applicationPid());
|
return DSGApplication::getId(QCoreApplication::applicationPid());
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isServiceActivatable(const QString &service)
|
static bool isServiceActivatable(const QByteArray &service)
|
||||||
{
|
{
|
||||||
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(service))
|
return checkDBusServiceActivatable(service);
|
||||||
return false;
|
|
||||||
|
|
||||||
const QDBusReply<QStringList> activatableNames = QDBusConnection::sessionBus().interface()->
|
|
||||||
callWithArgumentList(QDBus::AutoDetect,
|
|
||||||
QLatin1String("ListActivatableNames"),
|
|
||||||
QList<QVariant>());
|
|
||||||
|
|
||||||
return activatableNames.value().contains(service);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format appId to valid.
|
// Format appId to valid.
|
||||||
|
|
@ -91,6 +272,18 @@ QByteArray DSGApplication::id()
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get application ID for a given process ID
|
||||||
|
*
|
||||||
|
* This function has been updated to use libdbus-1 instead of Qt D-Bus to fix
|
||||||
|
* the bug(pms:BUG-278055) where calling this function before QCoreApplication
|
||||||
|
* initialization would fail. This is particularly important when the service
|
||||||
|
* is being started by D-Bus activation and DSGApplication::id() is called
|
||||||
|
* during early startup.
|
||||||
|
*
|
||||||
|
* @param pid Process ID to get the application ID for
|
||||||
|
* @return Application ID as QByteArray, or empty array on failure
|
||||||
|
*/
|
||||||
QByteArray DSGApplication::getId(qint64 pid)
|
QByteArray DSGApplication::getId(qint64 pid)
|
||||||
{
|
{
|
||||||
if (!isServiceActivatable("org.desktopspec.ApplicationManager1")) {
|
if (!isServiceActivatable("org.desktopspec.ApplicationManager1")) {
|
||||||
|
|
@ -104,21 +297,13 @@ QByteArray DSGApplication::getId(qint64 pid)
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
DDBusInterface infc("org.desktopspec.ApplicationManager1",
|
QByteArray appId = callDBusIdentifyMethod("org.desktopspec.ApplicationManager1",
|
||||||
"/org/desktopspec/ApplicationManager1",
|
"/org/desktopspec/ApplicationManager1",
|
||||||
"org.desktopspec.ApplicationManager1");
|
"org.desktopspec.ApplicationManager1",
|
||||||
|
pidfd);
|
||||||
QDBusReply<QString> reply = infc.call("Identify", QVariant::fromValue(QDBusUnixFileDescriptor(pidfd)));
|
|
||||||
// see QDBusUnixFileDescriptor: The original file descriptor is not touched and must be closed by the user.
|
// see QDBusUnixFileDescriptor: The original file descriptor is not touched and must be closed by the user.
|
||||||
close(pidfd);
|
close(pidfd);
|
||||||
|
|
||||||
if (!reply.isValid()) {
|
|
||||||
qCWarning(dsgApp) << "Identify from AM failed." << reply.error().message();
|
|
||||||
return QByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QByteArray appId = reply.value().toLatin1();
|
|
||||||
qCInfo(dsgApp) << "AppId is fetched from AM, and value is " << appId;
|
|
||||||
return appId;
|
return appId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,14 @@ public:
|
||||||
struct OSBuild {
|
struct OSBuild {
|
||||||
OSBuild():A(0), B(0), C(0), D(0), xyz(100){
|
OSBuild():A(0), B(0), C(0), D(0), xyz(100){
|
||||||
}
|
}
|
||||||
uint A, B, C, D, E, xyz; // ABCDE.xyz
|
|
||||||
|
/* ABCDE.xyz模式
|
||||||
|
系统构建号 A B C D E x yz
|
||||||
|
值含义 操作系统产品的大版本代号 产品线类型 功能小版本 产品线版本 处理器架构 固定值 补丁小版本
|
||||||
|
值位数 1 1 1 1 1 1 2
|
||||||
|
值范围 ------------------------- 0~9、A~Z --------------------------- 1 00~99,AA~ZZ
|
||||||
|
*/
|
||||||
|
uint A, B, C, D, E, xyz;
|
||||||
};
|
};
|
||||||
|
|
||||||
MinVersion minVersion;
|
MinVersion minVersion;
|
||||||
|
|
@ -139,9 +146,12 @@ bool DSysInfoPrivate::splitA_BC_DMode()
|
||||||
minVersion.D = minv % 10;
|
minVersion.D = minv % 10;
|
||||||
} else if (minorVersion.length() > 0) {
|
} else if (minorVersion.length() > 0) {
|
||||||
const QString D = minorVersion.right(1);
|
const QString D = minorVersion.right(1);
|
||||||
if (D.contains(QRegularExpression("[0-9A-Z]"))) {
|
const QChar ch = D.at(0);
|
||||||
// 0-9...A-Z
|
if (ch.isDigit()) {
|
||||||
minVersion.D = 10 + static_cast<uint>(D.data()->toLatin1() - 'A');
|
minVersion.D = static_cast<uint>(ch.unicode() - '0');
|
||||||
|
} else if (ch >= 'A' && ch <= 'Z') {
|
||||||
|
// 0-9...A-Z -> 10..35
|
||||||
|
minVersion.D = 10 + static_cast<uint>(ch.unicode() - 'A');
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "invalid minorVersion";
|
qWarning() << "invalid minorVersion";
|
||||||
minVersion.D = 0;
|
minVersion.D = 0;
|
||||||
|
|
@ -266,19 +276,24 @@ bool DSysInfoPrivate::ensureOsVersion()
|
||||||
D_ASSET_EXIT(left.size() == 5, "OsBuild version(ls) invalid!");
|
D_ASSET_EXIT(left.size() == 5, "OsBuild version(ls) invalid!");
|
||||||
|
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
osBuild.A = left.value(idx++, "0").toUInt(&ok);
|
auto parseDigitOrAZ = [&](const QString &s, bool *outOk) -> uint {
|
||||||
|
if (s.isEmpty()) { if (outOk) *outOk = false; return 0u; }
|
||||||
|
const QChar ch = s.at(0);
|
||||||
|
if (ch.isDigit()) { if (outOk) *outOk = true; return static_cast<uint>(ch.unicode() - '0'); }
|
||||||
|
if (ch >= 'A' && ch <= 'Z') { if (outOk) *outOk = true; return static_cast<uint>(ch.toLatin1()); }
|
||||||
|
if (outOk) *outOk = false;
|
||||||
|
return 0u;
|
||||||
|
};
|
||||||
|
|
||||||
|
osBuild.A = parseDigitOrAZ(left.value(idx++, "0"), &ok);
|
||||||
D_ASSET_EXIT(ok, "OsBuild version(A) invalid!");
|
D_ASSET_EXIT(ok, "OsBuild version(A) invalid!");
|
||||||
osBuild.B = left.value(idx++, "0").toUInt(&ok);
|
osBuild.B = parseDigitOrAZ(left.value(idx++, "0"), &ok);
|
||||||
D_ASSET_EXIT(ok, "OsBuild version(B) invalid!");
|
D_ASSET_EXIT(ok, "OsBuild version(B) invalid!");
|
||||||
osBuild.C = left.value(idx++, "0").toUInt(&ok);
|
osBuild.C = parseDigitOrAZ(left.value(idx++, "0"), &ok);
|
||||||
if (!ok) {
|
D_ASSET_EXIT(ok, "OsBuild version(C) invalid!");
|
||||||
auto c = left.value(idx-1, "0").toLatin1();
|
osBuild.D = parseDigitOrAZ(left.value(idx++, "0"), &ok);
|
||||||
D_ASSET_EXIT(c.size()>0, "OsBuild version(C) invalid!");
|
|
||||||
osBuild.C = uint(c.at(0));
|
|
||||||
}
|
|
||||||
osBuild.D = left.value(idx++, "0").toUInt(&ok);
|
|
||||||
D_ASSET_EXIT(ok, "OsBuild version(D) invalid!");
|
D_ASSET_EXIT(ok, "OsBuild version(D) invalid!");
|
||||||
osBuild.E = left.value(idx++, "0").toUInt(&ok);
|
osBuild.E = parseDigitOrAZ(left.value(idx++, "0"), &ok);
|
||||||
D_ASSET_EXIT(ok, "OsBuild version(E) invalid!");
|
D_ASSET_EXIT(ok, "OsBuild version(E) invalid!");
|
||||||
|
|
||||||
// xyz
|
// xyz
|
||||||
|
|
@ -682,10 +697,13 @@ DSysInfo::UosEdition DSysInfo::uosEditionType()
|
||||||
case 3:
|
case 3:
|
||||||
return UosEuler;
|
return UosEuler;
|
||||||
case 4:
|
case 4:
|
||||||
case 9:
|
|
||||||
return UosMilitaryS;
|
return UosMilitaryS;
|
||||||
case 5:
|
case 5:
|
||||||
return UosDeviceEdition;
|
return UosDeviceEdition;
|
||||||
|
case 9:
|
||||||
|
return UosEducation; // 服务器 教育版(UT-3-PP-PR-001_操作系统标识与产品版本号规范_20250905)
|
||||||
|
case 'A':
|
||||||
|
return UosDefense; // 服务器 国防版
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -195,12 +195,21 @@ QAbstractFileEngine::FileFlags DCapFSFileEngine::fileFlags(QAbstractFileEngine::
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
|
||||||
|
DCapFSFileEngine::TriStateResult DCapFSFileEngine::cloneTo(QAbstractFileEngine *target)
|
||||||
|
#else
|
||||||
bool DCapFSFileEngine::cloneTo(QAbstractFileEngine *target)
|
bool DCapFSFileEngine::cloneTo(QAbstractFileEngine *target)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
D_DC(DCapFSFileEngine);
|
D_DC(DCapFSFileEngine);
|
||||||
const QString targetPath = target->fileName(DCapFSFileEngine::AbsolutePathName);
|
const QString targetPath = target->fileName(DCapFSFileEngine::AbsolutePathName);
|
||||||
if (!d->canReadWrite(targetPath))
|
if (!d->canReadWrite(targetPath)) {
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
|
||||||
|
return DCapFSFileEngine::TriStateResult::Failed;
|
||||||
|
#else
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
return QFSFileEngine::cloneTo(target);
|
return QFSFileEngine::cloneTo(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ static bool renameFile(const QFileInfo &fileInfo, const QString &target, QString
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!QDir().rmdir(fileInfo.filePath())) {
|
if (!QDir().rename(fileInfo.filePath(), target)) {
|
||||||
if (errorString) {
|
if (errorString) {
|
||||||
*errorString = QString("Cannot remove the %1 dir").arg(fileInfo.filePath());
|
*errorString = QString("Cannot remove the %1 dir").arg(fileInfo.filePath());
|
||||||
}
|
}
|
||||||
|
|
@ -183,11 +183,13 @@ bool DTrashManager::moveToTrash(const QString &filePath, bool followSymlink)
|
||||||
}
|
}
|
||||||
|
|
||||||
QDir trashDir(TRASH_FILES_PATH);
|
QDir trashDir(TRASH_FILES_PATH);
|
||||||
QStorageInfo storageInfo(fileInfo.filePath());
|
if (followSymlink && fileInfo.isSymLink()) {
|
||||||
QStorageInfo trashStorageInfo(trashDir);
|
QStorageInfo storageInfo(fileInfo.filePath());
|
||||||
|
QStorageInfo trashStorageInfo(trashDir);
|
||||||
|
|
||||||
if (storageInfo != trashStorageInfo) {
|
if (storageInfo != trashStorageInfo) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!trashDir.mkpath(TRASH_INFO_PATH)) {
|
if (!trashDir.mkpath(TRASH_INFO_PATH)) {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,13 @@ public:
|
||||||
#endif
|
#endif
|
||||||
bool rmdir(const QString &dirName, bool recurseParentDirectories) const override;
|
bool rmdir(const QString &dirName, bool recurseParentDirectories) const override;
|
||||||
FileFlags fileFlags(FileFlags type) const override;
|
FileFlags fileFlags(FileFlags type) const override;
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
|
||||||
|
TriStateResult cloneTo(QAbstractFileEngine *target) override;
|
||||||
|
#else
|
||||||
bool cloneTo(QAbstractFileEngine *target) override;
|
bool cloneTo(QAbstractFileEngine *target) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool setSize(qint64 size) override;
|
bool setSize(qint64 size) override;
|
||||||
QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const override;
|
QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const override;
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 1)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 1)
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ dconfig_org_deepin_dtk_preference *DLogManagerPrivate::createDConfig(const QStri
|
||||||
|
|
||||||
void DLogManagerPrivate::initLoggingRules()
|
void DLogManagerPrivate::initLoggingRules()
|
||||||
{
|
{
|
||||||
if (qEnvironmentVariableIsSet("DTK_DISABLED_LOGGING_RULES"))
|
if (qEnvironmentVariableIsSet("DTK_DISABLED_LOGGING_RULES") || qEnvironmentVariableIsSet("QT_LOGGING_RULES"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// 1. 未指定 fallbackId 时,以 dsgAppId 为准
|
// 1. 未指定 fallbackId 时,以 dsgAppId 为准
|
||||||
|
|
@ -213,7 +213,7 @@ QString DLogManager::getlogFilePath()
|
||||||
if (!QDir(cachePath).exists()) {
|
if (!QDir(cachePath).exists()) {
|
||||||
QDir(cachePath).mkpath(cachePath);
|
QDir(cachePath).mkpath(cachePath);
|
||||||
}
|
}
|
||||||
instance()->d_func()->m_logPath = instance()->joinPath(cachePath, QString("%1.log").arg(qApp->applicationName()));
|
instance()->d_func()->m_logPath = instance()->joinPath(cachePath, QString("%1.log").arg(QCoreApplication::applicationName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return QDir::toNativeSeparators(DLogManager::instance()->d_func()->m_logPath);
|
return QDir::toNativeSeparators(DLogManager::instance()->d_func()->m_logPath);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* This file is generated by dconfig2cpp.
|
* This file is generated by dconfig2cpp.
|
||||||
* Command line arguments: ./build5/tools/dconfig2cpp/dconfig2cpp /usr/share/dsg/configs/org.deepin.dtk.preference.json
|
* Command line arguments: ./build/tools/dconfig2cpp/dconfig2cpp /usr/share/dsg/configs/org.deepin.dtk.preference.json
|
||||||
* Generation time: 2025-05-08T16:56:17
|
* Generation time: 2025-08-20T15:40:55
|
||||||
* JSON file version: 1.0
|
* JSON file version: 1.0
|
||||||
*
|
*
|
||||||
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
|
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
|
||||||
|
|
@ -113,6 +113,7 @@ public:
|
||||||
~dconfig_org_deepin_dtk_preference() {
|
~dconfig_org_deepin_dtk_preference() {
|
||||||
if (m_config.loadRelaxed()) {
|
if (m_config.loadRelaxed()) {
|
||||||
m_config.loadRelaxed()->deleteLater();
|
m_config.loadRelaxed()->deleteLater();
|
||||||
|
m_config.storeRelaxed(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -565,6 +566,8 @@ private:
|
||||||
updateValue(QStringLiteral("underlineShortcut"), QVariant::fromValue(p_underlineShortcut));
|
updateValue(QStringLiteral("underlineShortcut"), QVariant::fromValue(p_underlineShortcut));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_config.loadRelaxed())
|
||||||
|
return;
|
||||||
connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
|
connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
|
||||||
updateValue(key);
|
updateValue(key);
|
||||||
}, Qt::DirectConnection);
|
}, Qt::DirectConnection);
|
||||||
|
|
@ -573,6 +576,8 @@ private:
|
||||||
Q_EMIT configInitializeSucceed(config);
|
Q_EMIT configInitializeSucceed(config);
|
||||||
}
|
}
|
||||||
void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
|
void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
|
||||||
|
if (!m_config.loadRelaxed())
|
||||||
|
return;
|
||||||
Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
|
Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
|
||||||
const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
|
const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
|
||||||
if (key == QStringLiteral("autoDisplayFeature")) {
|
if (key == QStringLiteral("autoDisplayFeature")) {
|
||||||
|
|
@ -738,8 +743,8 @@ private:
|
||||||
bool p_enableDtkAnimations { false };
|
bool p_enableDtkAnimations { false };
|
||||||
bool p_featureUpdated { false };
|
bool p_featureUpdated { false };
|
||||||
bool p_keyboardsearchDisabled { false };
|
bool p_keyboardsearchDisabled { false };
|
||||||
// Default value: ""
|
// Default value: "*.debug=false"
|
||||||
QString p_rules { QLatin1String("") };
|
QString p_rules { QStringLiteral(u"\u002a\u002e\u0064\u0065\u0062\u0075\u0067\u003d\u0066\u0061\u006c\u0073\u0065") };
|
||||||
qlonglong p_scrollBarPolicy { 0 };
|
qlonglong p_scrollBarPolicy { 0 };
|
||||||
qlonglong p_sizeMode { 0 };
|
qlonglong p_sizeMode { 0 };
|
||||||
qlonglong p_themeType { 0 };
|
qlonglong p_themeType { 0 };
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,13 @@ static QVariant demarshall(const QMetaProperty &metaProperty, const QVariant &va
|
||||||
if (value.userType() == qMetaTypeId<QDBusArgument>()) {
|
if (value.userType() == qMetaTypeId<QDBusArgument>()) {
|
||||||
QDBusArgument dbusArg = value.value<QDBusArgument>();
|
QDBusArgument dbusArg = value.value<QDBusArgument>();
|
||||||
QDBusMetaType::demarshall(dbusArg, PropType(metaProperty), result.data());
|
QDBusMetaType::demarshall(dbusArg, PropType(metaProperty), result.data());
|
||||||
|
} else {
|
||||||
|
auto copy = value;
|
||||||
|
if (copy.convert(PropType(metaProperty))) {
|
||||||
|
result = copy;
|
||||||
|
} else {
|
||||||
|
qDebug() << "Failed to convert value type" << value.typeName() << "to property type" << metaProperty.typeName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
|
|
@ -211,11 +211,23 @@ QStringList pinyin(const QString &words, ToneStyle ts, bool *ok)
|
||||||
\return pinyin first letters list of the words
|
\return pinyin first letters list of the words
|
||||||
*/
|
*/
|
||||||
QStringList firstLetters(const QString &words)
|
QStringList firstLetters(const QString &words)
|
||||||
|
{
|
||||||
|
return firstLetters(words, TS_Tone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn QStringList Dtk::Core::firstLetters(const QString &words)
|
||||||
|
\brief Convert Chinese characters to Pinyin firstLetters list
|
||||||
|
\brief with controllable tone style.
|
||||||
|
|
||||||
|
\return pinyin first letters list of the words
|
||||||
|
*/
|
||||||
|
QStringList firstLetters(const QString &words, ToneStyle ts)
|
||||||
{
|
{
|
||||||
QList<QStringList> result;
|
QList<QStringList> result;
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
for (const QChar &w : words) {
|
for (const QChar &w : words) {
|
||||||
QStringList pys = pinyin(w, TS_Tone, &ok);
|
QStringList pys = pinyin(w, ts, &ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
result << QStringList(w);
|
result << QStringList(w);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||||
#include <QStringConverter>
|
#include <QStringConverter>
|
||||||
|
#include <QTimeZone>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DCORE_BEGIN_NAMESPACE
|
DCORE_BEGIN_NAMESPACE
|
||||||
|
|
@ -67,7 +68,11 @@ bool DRecentManager::addItem(const QString &uri, DRecentData &data)
|
||||||
QFile file(RECENT_PATH);
|
QFile file(RECENT_PATH);
|
||||||
file.open(QIODevice::ReadWrite | QIODevice::Text);
|
file.open(QIODevice::ReadWrite | QIODevice::Text);
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||||
|
QString dateTime = QDateTime::currentDateTime().toTimeZone(QTimeZone::UTC).toString(Qt::ISODate);
|
||||||
|
#else
|
||||||
QString dateTime = QDateTime::currentDateTime().toTimeSpec(Qt::OffsetFromUTC).toString(Qt::ISODate);
|
QString dateTime = QDateTime::currentDateTime().toTimeSpec(Qt::OffsetFromUTC).toString(Qt::ISODate);
|
||||||
|
#endif
|
||||||
QDomDocument doc;
|
QDomDocument doc;
|
||||||
|
|
||||||
if (!doc.setContent(&file)) {
|
if (!doc.setContent(&file)) {
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,21 @@ bool DVtableHook::hasVtable(const void *obj)
|
||||||
{
|
{
|
||||||
quintptr **_obj = (quintptr**)(obj);
|
quintptr **_obj = (quintptr**)(obj);
|
||||||
|
|
||||||
return objToGhostVfptr.contains(_obj);
|
// 验证 vtable 是否匹配
|
||||||
|
quintptr *ghost_vtable = objToGhostVfptr.value(obj);
|
||||||
|
if (!ghost_vtable) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查当前对象的 vtable 指针是否指向我们记录的 ghost vtable
|
||||||
|
if (*_obj != adjustToEntry(ghost_vtable)) {
|
||||||
|
// vtable 不匹配,说明地址被重用了
|
||||||
|
qCDebug(vtableHook) << "hasVtable: vtable mismatch! Address reused by different object."
|
||||||
|
<< "obj:" << QString("0x%1").arg((quintptr)obj, 0, 16);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVtableHook::resetVtable(const void *obj)
|
void DVtableHook::resetVtable(const void *obj)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,12 @@ if(LINUX)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
if("${QT_VERSION_MAJOR}" STREQUAL "5")
|
if("${QT_VERSION_MAJOR}" STREQUAL "5")
|
||||||
pkg_check_modules(QGSettings REQUIRED IMPORTED_TARGET gsettings-qt)
|
pkg_check_modules(QGSettings REQUIRED IMPORTED_TARGET gsettings-qt)
|
||||||
|
elseif(${QT_VERSION_MAJOR} EQUAL 6)
|
||||||
|
if(${Qt6Core_VERSION} VERSION_GREATER_EQUAL 6.10.0)
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS CorePrivate)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Unsupported Qt version: ${QT_VERSION_MAJOR}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
@ -28,6 +34,8 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Concurrent)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test)
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test)
|
||||||
find_package(GTest REQUIRED)
|
find_package(GTest REQUIRED)
|
||||||
|
|
||||||
|
include(GoogleTest)
|
||||||
|
|
||||||
# for test.so
|
# for test.so
|
||||||
set(TEST_SO_NAME vtabletest${DTK_VERSION_MAJOR})
|
set(TEST_SO_NAME vtabletest${DTK_VERSION_MAJOR})
|
||||||
add_subdirectory(./testso)
|
add_subdirectory(./testso)
|
||||||
|
|
@ -110,4 +118,4 @@ target_include_directories( ${BIN_NAME} PUBLIC
|
||||||
./testso/
|
./testso/
|
||||||
)
|
)
|
||||||
|
|
||||||
add_test(NAME ${BIN_NAME} COMMAND ${BIN_NAME})
|
gtest_discover_tests(${BIN_NAME})
|
||||||
|
|
|
||||||
|
|
@ -68,5 +68,11 @@ TEST_F(ut_DPinyin, firstLetters)
|
||||||
|
|
||||||
bool isPermutation = std::is_permutation(ls.begin() , ls.end(), letters.begin());
|
bool isPermutation = std::is_permutation(ls.begin() , ls.end(), letters.begin());
|
||||||
ASSERT_TRUE(isPermutation);
|
ASSERT_TRUE(isPermutation);
|
||||||
|
|
||||||
|
QString words2("安全中心");
|
||||||
|
QStringList && result = firstLetters(words2, TS_NoneTone);
|
||||||
|
ASSERT_TRUE(result.count() == 1);
|
||||||
|
ASSERT_TRUE(result.constFirst() == "aqzx");
|
||||||
|
ASSERT_TRUE(result.constFirst() != firstLetters(words2).constFirst());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,13 @@ set(BIN_NAME ${TARGET_NAME}${DTK_VERSION_MAJOR})
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||||
|
|
||||||
|
if(${QT_VERSION_MAJOR} EQUAL 6)
|
||||||
|
if(${Qt6Core_VERSION} VERSION_GREATER_EQUAL 6.10.0)
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS CorePrivate)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_definitions(-DDTK_NO_PROJECT)
|
add_definitions(-DDTK_NO_PROJECT)
|
||||||
# start dci
|
# start dci
|
||||||
include(../../src/dci/dci.cmake)
|
include(../../src/dci/dci.cmake)
|
||||||
|
|
|
||||||
|
|
@ -354,6 +354,7 @@ int main(int argc, char *argv[]) {
|
||||||
headerStream << " ~" << className << R"(() {
|
headerStream << " ~" << className << R"(() {
|
||||||
if (m_config.loadRelaxed()) {
|
if (m_config.loadRelaxed()) {
|
||||||
m_config.loadRelaxed()->deleteLater();
|
m_config.loadRelaxed()->deleteLater();
|
||||||
|
m_config.storeRelaxed(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -458,6 +459,8 @@ int main(int argc, char *argv[]) {
|
||||||
headerStream << " }\n";
|
headerStream << " }\n";
|
||||||
}
|
}
|
||||||
headerStream << R"(
|
headerStream << R"(
|
||||||
|
if (!m_config.loadRelaxed())
|
||||||
|
return;
|
||||||
connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
|
connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
|
||||||
updateValue(key);
|
updateValue(key);
|
||||||
}, Qt::DirectConnection);
|
}, Qt::DirectConnection);
|
||||||
|
|
@ -466,6 +469,8 @@ int main(int argc, char *argv[]) {
|
||||||
Q_EMIT configInitializeSucceed(config);
|
Q_EMIT configInitializeSucceed(config);
|
||||||
}
|
}
|
||||||
void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
|
void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
|
||||||
|
if (!m_config.loadRelaxed())
|
||||||
|
return;
|
||||||
Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
|
Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
|
||||||
const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
|
const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
|
||||||
)";
|
)";
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,12 @@ set(BIN_NAME ${TARGET_NAME}${DTK_VERSION_MAJOR})
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||||
|
if(${QT_VERSION_MAJOR} EQUAL 6)
|
||||||
|
if(${Qt6Core_VERSION} VERSION_GREATER_EQUAL 6.10.0)
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS CorePrivate)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_definitions(-DDTK_NO_PROJECT)
|
add_definitions(-DDTK_NO_PROJECT)
|
||||||
# start dci
|
# start dci
|
||||||
set(dci_SRCS
|
set(dci_SRCS
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,12 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS DBus)
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS DBus)
|
||||||
|
|
||||||
|
if(${QT_VERSION_MAJOR} EQUAL 6)
|
||||||
|
if (${Qt6DBus_VERSION} VERSION_GREATER_EQUAL 6.10.0)
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS DBusPrivate)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(${BIN_NAME}
|
add_executable(${BIN_NAME}
|
||||||
qdbusxml2cpp.cpp
|
qdbusxml2cpp.cpp
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -598,7 +598,7 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> annotations;
|
QStringList annotations;
|
||||||
for (const QDBusIntrospection::Interface *interface : interfaces) {
|
for (const QDBusIntrospection::Interface *interface : interfaces) {
|
||||||
for (const auto &method : interface->methods) {
|
for (const auto &method : interface->methods) {
|
||||||
for (int i(0); i != method.outputArgs.size(); ++i) {
|
for (int i(0); i != method.outputArgs.size(); ++i) {
|
||||||
|
|
@ -638,6 +638,7 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
annotations.removeDuplicates();
|
||||||
if (!skipIncludeAnnotations) {
|
if (!skipIncludeAnnotations) {
|
||||||
for (const QString &annotation : annotations) {
|
for (const QString &annotation : annotations) {
|
||||||
if (annotation.indexOf('<') == -1) {
|
if (annotation.indexOf('<') == -1) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue