Compare commits

..

1 Commits

Author SHA1 Message Date
github-actions[bot] 8ab6bc00e8 chore: New release 5.7.20
Log:
2025-07-31 20:00:27 +08:00
28 changed files with 54 additions and 272 deletions

View File

@ -5,49 +5,6 @@ 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

View File

@ -1 +1 @@
5.7.25
5.7.20

View File

@ -1,6 +1,6 @@
# Maintainer: justforlxz <justforlxz@gmail.com>
pkgname=dtkcore-git
pkgver=5.7.25
pkgver=5.7.20
pkgrel=1
sourcename=dtkcore
sourcetars=("$sourcename"_"$pkgver".tar.xz)

30
debian/changelog vendored
View File

@ -1,33 +1,3 @@
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

View File

@ -79,7 +79,6 @@ public:
UosMilitaryS, // for Server
UosDeviceEdition,
UosEducation,
UosDefense,
UosEditionCount // must at last
};

View File

@ -35,11 +35,9 @@
#if defined(DTK_STATIC_LIB)
# define LIBDTKCORESHARED_EXPORT
# define D_IGNORE_DEPRECATIONS
#else
#if defined(LIBDTKCORE_LIBRARY)
# define LIBDTKCORESHARED_EXPORT Q_DECL_EXPORT
# define D_IGNORE_DEPRECATIONS
#else
# define LIBDTKCORESHARED_EXPORT Q_DECL_IMPORT
#endif
@ -49,10 +47,6 @@
#define D_DECL_DEPRECATED_X(text) Q_DECL_HIDDEN
#define D_DECL_DEPRECATED Q_DECL_HIDDEN
#else
#if defined(D_IGNORE_DEPRECATIONS)
#define D_DECL_DEPRECATED
#define D_DECL_DEPRECATED_X(text)
#else
#ifdef __GNUC__
#if __GNUC__ < 13
#define D_DECL_DEPRECATED __attribute__((__deprecated__))
@ -66,7 +60,6 @@
#define D_DECL_DEPRECATED_X Q_DECL_DEPRECATED_X
#endif
#endif
#endif
#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)

View File

@ -26,7 +26,6 @@ QStringList LIBDTKCORESHARED_EXPORT pinyin(const QString& words, ToneStyle ts =
// support polyphonic
QStringList LIBDTKCORESHARED_EXPORT firstLetters(const QString& words);
QStringList LIBDTKCORESHARED_EXPORT firstLetters(const QString& words, ToneStyle ts);
DCORE_END_NAMESPACE

View File

@ -1,5 +1,5 @@
Name: dtkcore
Version: 5.7.25
Version: 5.7.20
Release: 1%{?dist}
Summary: Deepin tool kit core modules
License: LGPLv3+

View File

@ -12,16 +12,10 @@ find_package(DBus1 REQUIRED)
if(LINUX)
find_package(PkgConfig REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS DBus)
if(${QT_VERSION_MAJOR} EQUAL 5)
if("${QT_VERSION_MAJOR}" STREQUAL "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()
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Xml)
find_package(DtkBuildHelper REQUIRED)

View File

@ -621,20 +621,10 @@ bool DDciFileEngine::supportsExtension(QAbstractFileEngine::Extension extension)
return extension == AtEndExtension;
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
DDciFileEngine::TriStateResult DDciFileEngine::cloneTo(QAbstractFileEngine *target)
#else
bool DDciFileEngine::cloneTo(QAbstractFileEngine *target)
#endif
{
const QByteArray &data = file->dataRef(subfilePath);
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
return target->write(data.constData(), data.size()) == data.size();
}
bool DDciFileEngine::forceSave(bool writeFile) const

View File

@ -129,11 +129,7 @@ public:
ExtensionReturn *output = 0) 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;
#endif
private:
bool forceSave(bool writeFile = false) const;

View File

@ -326,16 +326,15 @@ public:
DSGConfig dsg_config(DSG_CONFIG, "/", QDBusConnection::systemBus());
QDBusPendingReply<QDBusObjectPath> dbus_reply = dsg_config.acquireManager(owner->appId, owner->name, owner->subpath);
const QDBusObjectPath dbus_path = dbus_reply.value();
const auto path = dbus_path.path(); // 显式拷贝避免其它线程共用systemBus连接而修改dbus数据
if (dbus_reply.isError() || path.isEmpty()) {
if (dbus_reply.isError() || dbus_path.path().isEmpty()) {
qCWarning(cfLog, "Can't acquire config manager. error:\"%s\"", qPrintable(dbus_reply.error().message()));
return false;
} else {
qCDebug(cfLog, "dbus path=\"%s\"", qPrintable(path));
config.reset(new DSGConfigManager(DSG_CONFIG_MANAGER, path,
qCDebug(cfLog(), "dbus path=\"%s\"", qPrintable(dbus_path.path()));
config.reset(new DSGConfigManager(DSG_CONFIG_MANAGER, dbus_path.path(),
QDBusConnection::systemBus(), owner->q_func()));
if (!config->isValid()) {
qCWarning(cfLog, "Can't acquire config path=\"%s\"", qPrintable(path));
qCWarning(cfLog(), "Can't acquire config path=\"%s\"", qPrintable(dbus_path.path()));
config.reset();
return false;
} else {

View File

@ -39,7 +39,7 @@ static void dbusMessageDeleter(DBusMessage *msg) {
}
// D-Bus utility functions using libdbus-1
static bool checkDBusServiceActivatable(const QByteArray &service)
static bool checkDBusServiceActivatable(const QString &service)
{
auto error = std::unique_ptr<DBusError, void(*)(DBusError*)>(new DBusError, dbusErrorDeleter);
dbus_error_init(error.get());
@ -70,12 +70,10 @@ static bool checkDBusServiceActivatable(const QByteArray &service)
}
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;
}
const char *serviceName = service.toUtf8().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
@ -142,7 +140,7 @@ static bool checkDBusServiceActivatable(const QByteArray &service)
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) {
if (service == QString::fromUtf8(name)) {
found = true;
break;
}
@ -152,8 +150,7 @@ static bool checkDBusServiceActivatable(const QByteArray &service)
return found;
}
static QByteArray callDBusIdentifyMethod(const QByteArray &serviceName, const QByteArray &path,
const QByteArray &interface, int pidfd)
static QByteArray callDBusIdentifyMethod(const QString &service, const QString &path, const QString &interface, int pidfd)
{
auto error = std::unique_ptr<DBusError, void(*)(DBusError*)>(new DBusError, dbusErrorDeleter);
dbus_error_init(error.get());
@ -170,11 +167,11 @@ static QByteArray callDBusIdentifyMethod(const QByteArray &serviceName, const QB
}
auto connGuard = std::unique_ptr<DBusConnection, void(*)(DBusConnection*)>(connection, dbusConnectionDeleter);
// Create method call - string data is now managed by caller
// Create method call
DBusMessage *msg = dbus_message_new_method_call(
serviceName.constData(),
path.constData(),
interface.constData(),
service.toUtf8().constData(),
path.toUtf8().constData(),
interface.toUtf8().constData(),
"Identify"
);
@ -225,7 +222,7 @@ static inline QByteArray getSelfAppId() {
return DSGApplication::getId(QCoreApplication::applicationPid());
}
static bool isServiceActivatable(const QByteArray &service)
static bool isServiceActivatable(const QString &service)
{
return checkDBusServiceActivatable(service);
}
@ -276,9 +273,9 @@ QByteArray DSGApplication::id()
* 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
* 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

View File

@ -93,14 +93,7 @@ public:
struct OSBuild {
OSBuild():A(0), B(0), C(0), D(0), xyz(100){
}
/* ABCDE.xyz模式
A B C D E x yz
线 线
1 1 1 1 1 1 2
------------------------- 09A~Z --------------------------- 1 00~99AA~ZZ
*/
uint A, B, C, D, E, xyz;
uint A, B, C, D, E, xyz; // ABCDE.xyz
};
MinVersion minVersion;
@ -146,12 +139,9 @@ bool DSysInfoPrivate::splitA_BC_DMode()
minVersion.D = minv % 10;
} else if (minorVersion.length() > 0) {
const QString D = minorVersion.right(1);
const QChar ch = D.at(0);
if (ch.isDigit()) {
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');
if (D.contains(QRegularExpression("[0-9A-Z]"))) {
// 0-9...A-Z
minVersion.D = 10 + static_cast<uint>(D.data()->toLatin1() - 'A');
} else {
qWarning() << "invalid minorVersion";
minVersion.D = 0;
@ -276,24 +266,19 @@ bool DSysInfoPrivate::ensureOsVersion()
D_ASSET_EXIT(left.size() == 5, "OsBuild version(ls) invalid!");
int idx = 0;
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);
osBuild.A = left.value(idx++, "0").toUInt(&ok);
D_ASSET_EXIT(ok, "OsBuild version(A) invalid!");
osBuild.B = parseDigitOrAZ(left.value(idx++, "0"), &ok);
osBuild.B = left.value(idx++, "0").toUInt(&ok);
D_ASSET_EXIT(ok, "OsBuild version(B) invalid!");
osBuild.C = parseDigitOrAZ(left.value(idx++, "0"), &ok);
D_ASSET_EXIT(ok, "OsBuild version(C) invalid!");
osBuild.D = parseDigitOrAZ(left.value(idx++, "0"), &ok);
osBuild.C = left.value(idx++, "0").toUInt(&ok);
if (!ok) {
auto c = left.value(idx-1, "0").toLatin1();
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!");
osBuild.E = parseDigitOrAZ(left.value(idx++, "0"), &ok);
osBuild.E = left.value(idx++, "0").toUInt(&ok);
D_ASSET_EXIT(ok, "OsBuild version(E) invalid!");
// xyz
@ -697,13 +682,10 @@ DSysInfo::UosEdition DSysInfo::uosEditionType()
case 3:
return UosEuler;
case 4:
case 9:
return UosMilitaryS;
case 5:
return UosDeviceEdition;
case 9:
return UosEducation; // 服务器 教育版(UT-3-PP-PR-001_操作系统标识与产品版本号规范_20250905)
case 'A':
return UosDefense; // 服务器 国防版
default:
break;
}

View File

@ -195,21 +195,12 @@ QAbstractFileEngine::FileFlags DCapFSFileEngine::fileFlags(QAbstractFileEngine::
return ret;
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
DCapFSFileEngine::TriStateResult DCapFSFileEngine::cloneTo(QAbstractFileEngine *target)
#else
bool DCapFSFileEngine::cloneTo(QAbstractFileEngine *target)
#endif
{
D_DC(DCapFSFileEngine);
const QString targetPath = target->fileName(DCapFSFileEngine::AbsolutePathName);
if (!d->canReadWrite(targetPath)) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
return DCapFSFileEngine::TriStateResult::Failed;
#else
if (!d->canReadWrite(targetPath))
return false;
#endif
}
return QFSFileEngine::cloneTo(target);
}

View File

@ -123,7 +123,7 @@ static bool renameFile(const QFileInfo &fileInfo, const QString &target, QString
}
}
if (!QDir().rename(fileInfo.filePath(), target)) {
if (!QDir().rmdir(fileInfo.filePath())) {
if (errorString) {
*errorString = QString("Cannot remove the %1 dir").arg(fileInfo.filePath());
}
@ -183,13 +183,11 @@ bool DTrashManager::moveToTrash(const QString &filePath, bool followSymlink)
}
QDir trashDir(TRASH_FILES_PATH);
if (followSymlink && fileInfo.isSymLink()) {
QStorageInfo storageInfo(fileInfo.filePath());
QStorageInfo trashStorageInfo(trashDir);
QStorageInfo storageInfo(fileInfo.filePath());
QStorageInfo trashStorageInfo(trashDir);
if (storageInfo != trashStorageInfo) {
return false;
}
if (storageInfo != trashStorageInfo) {
return false;
}
if (!trashDir.mkpath(TRASH_INFO_PATH)) {

View File

@ -48,13 +48,7 @@ public:
#endif
bool rmdir(const QString &dirName, bool recurseParentDirectories) 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;
#endif
bool setSize(qint64 size) override;
QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const override;
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 1)

View File

@ -1,7 +1,7 @@
/**
* This file is generated by dconfig2cpp.
* Command line arguments: ./build/tools/dconfig2cpp/dconfig2cpp /usr/share/dsg/configs/org.deepin.dtk.preference.json
* Generation time: 2025-08-20T15:40:55
* Command line arguments: ./build5/tools/dconfig2cpp/dconfig2cpp /usr/share/dsg/configs/org.deepin.dtk.preference.json
* Generation time: 2025-05-08T16:56:17
* JSON file version: 1.0
*
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
@ -113,7 +113,6 @@ public:
~dconfig_org_deepin_dtk_preference() {
if (m_config.loadRelaxed()) {
m_config.loadRelaxed()->deleteLater();
m_config.storeRelaxed(nullptr);
}
}
@ -566,8 +565,6 @@ private:
updateValue(QStringLiteral("underlineShortcut"), QVariant::fromValue(p_underlineShortcut));
}
if (!m_config.loadRelaxed())
return;
connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
updateValue(key);
}, Qt::DirectConnection);
@ -576,8 +573,6 @@ private:
Q_EMIT configInitializeSucceed(config);
}
void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
if (!m_config.loadRelaxed())
return;
Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
if (key == QStringLiteral("autoDisplayFeature")) {
@ -743,8 +738,8 @@ private:
bool p_enableDtkAnimations { false };
bool p_featureUpdated { false };
bool p_keyboardsearchDisabled { false };
// Default value: "*.debug=false"
QString p_rules { QStringLiteral(u"\u002a\u002e\u0064\u0065\u0062\u0075\u0067\u003d\u0066\u0061\u006c\u0073\u0065") };
// Default value: ""
QString p_rules { QLatin1String("") };
qlonglong p_scrollBarPolicy { 0 };
qlonglong p_sizeMode { 0 };
qlonglong p_themeType { 0 };

View File

@ -43,13 +43,6 @@ static QVariant demarshall(const QMetaProperty &metaProperty, const QVariant &va
if (value.userType() == qMetaTypeId<QDBusArgument>()) {
QDBusArgument dbusArg = value.value<QDBusArgument>();
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;

View File

@ -211,23 +211,11 @@ QStringList pinyin(const QString &words, ToneStyle ts, bool *ok)
\return pinyin first letters list of the 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;
bool ok = false;
for (const QChar &w : words) {
QStringList pys = pinyin(w, ts, &ok);
QStringList pys = pinyin(w, TS_Tone, &ok);
if (!ok) {
result << QStringList(w);
continue;

View File

@ -229,21 +229,7 @@ bool DVtableHook::hasVtable(const void *obj)
{
quintptr **_obj = (quintptr**)(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;
return objToGhostVfptr.contains(_obj);
}
void DVtableHook::resetVtable(const void *obj)

View File

@ -20,12 +20,6 @@ if(LINUX)
find_package(PkgConfig REQUIRED)
if("${QT_VERSION_MAJOR}" STREQUAL "5")
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()
@ -34,8 +28,6 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Concurrent)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test)
find_package(GTest REQUIRED)
include(GoogleTest)
# for test.so
set(TEST_SO_NAME vtabletest${DTK_VERSION_MAJOR})
add_subdirectory(./testso)
@ -118,4 +110,4 @@ target_include_directories( ${BIN_NAME} PUBLIC
./testso/
)
gtest_discover_tests(${BIN_NAME})
add_test(NAME ${BIN_NAME} COMMAND ${BIN_NAME})

View File

@ -68,11 +68,5 @@ TEST_F(ut_DPinyin, firstLetters)
bool isPermutation = std::is_permutation(ls.begin() , ls.end(), letters.begin());
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());
}

View File

@ -3,13 +3,6 @@ set(BIN_NAME ${TARGET_NAME}${DTK_VERSION_MAJOR})
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
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)
# start dci
include(../../src/dci/dci.cmake)

View File

@ -354,7 +354,6 @@ int main(int argc, char *argv[]) {
headerStream << " ~" << className << R"(() {
if (m_config.loadRelaxed()) {
m_config.loadRelaxed()->deleteLater();
m_config.storeRelaxed(nullptr);
}
}
@ -459,8 +458,6 @@ int main(int argc, char *argv[]) {
headerStream << " }\n";
}
headerStream << R"(
if (!m_config.loadRelaxed())
return;
connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
updateValue(key);
}, Qt::DirectConnection);
@ -469,8 +466,6 @@ int main(int argc, char *argv[]) {
Q_EMIT configInitializeSucceed(config);
}
void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
if (!m_config.loadRelaxed())
return;
Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
)";

View File

@ -4,12 +4,6 @@ set(BIN_NAME ${TARGET_NAME}${DTK_VERSION_MAJOR})
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_AUTOMOC ON)
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)
# start dci
set(dci_SRCS

View File

@ -5,12 +5,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
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}
qdbusxml2cpp.cpp
)

View File

@ -598,7 +598,7 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
<< endl;
}
QStringList annotations;
QSet<QString> annotations;
for (const QDBusIntrospection::Interface *interface : interfaces) {
for (const auto &method : interface->methods) {
for (int i(0); i != method.outputArgs.size(); ++i) {
@ -638,7 +638,6 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
}
}
annotations.removeDuplicates();
if (!skipIncludeAnnotations) {
for (const QString &annotation : annotations) {
if (annotation.indexOf('<') == -1) {