Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions src/log/dconfig_org_deepin_dtk_preference.hpp
Original file line number Diff line number Diff line change
@@ -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 -o ./src/log/dconfig_org_deepin_dtk_preference.hpp
* Generation time: 2026-01-20T14:15:13
* Generation time: 2026-01-21T14:01:24
* JSON file version: 1.0
*
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
Expand Down Expand Up @@ -119,22 +119,23 @@ class dconfig_org_deepin_dtk_preference : public QObject {
// Initialize through Data class
safeData->initializeInConfigThread(config);

// Try to transition from Initializing to Succeeded
if (safeData->m_status.testAndSetOrdered(static_cast<int>(Data::Status::Initializing),
static_cast<int>(Data::Status::Succeeded))) {
// CAS succeeded: connect config destroyed signal to cleanup Data, then emit success signal to main thread
QObject::connect(config, &QObject::destroyed, safeData, &QObject::deleteLater);
QMetaObject::invokeMethod(safeData, [safeData, config]() {
QMetaObject::invokeMethod(safeData, [safeData, config]() {
// Try to transition from Initializing to Succeeded
if (safeData->m_status.testAndSetOrdered(static_cast<int>(Data::Status::Initializing),
static_cast<int>(Data::Status::Succeeded))) {
// CAS succeeded: connect config destroyed signal to cleanup Data, then emit success signal to main thread
QObject::connect(config, &QObject::destroyed, safeData, &QObject::deleteLater);
if (safeData->m_userConfig) {
Q_EMIT safeData->m_userConfig->configInitializeSucceed(config);
}
}, Qt::QueuedConnection);
} else {
// CAS failed - state changed (e.g., set to Destroyed)
// We must clean up the config we just created
config->deleteLater();
safeData->deleteLater();
}
} else {
// CAS failed - state changed (e.g., set to Destroyed)
// We must clean up the config we just created
config->deleteLater();
safeData->deleteLater();
}
}, Qt::QueuedConnection);

});
}
static dconfig_org_deepin_dtk_preference* create(const QString &appId = {}, const QString &subpath = {}, QObject *parent = nullptr, QThread *thread = DTK_CORE_NAMESPACE::DConfig::globalThread())
Expand Down
29 changes: 15 additions & 14 deletions toolGenerate/dconfig2cpp/dconf-example_meta.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* This file is generated by dconfig2cpp.
* Command line arguments: ./build/tools/dconfig2cpp/dconfig2cpp ./tests/data/dconf-example.meta.json -o ./toolGenerate/dconfig2cpp/dconf-example_meta.hpp
* Generation time: 2026-01-20T14:15:13
* Generation time: 2026-01-21T14:02:08
* JSON file version: 1.0
*
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
Expand Down Expand Up @@ -121,22 +121,23 @@ class dconfig_dconf-example_meta : public QObject {
// Initialize through Data class
safeData->initializeInConfigThread(config);

// Try to transition from Initializing to Succeeded
if (safeData->m_status.testAndSetOrdered(static_cast<int>(Data::Status::Initializing),
static_cast<int>(Data::Status::Succeeded))) {
// CAS succeeded: connect config destroyed signal to cleanup Data, then emit success signal to main thread
QObject::connect(config, &QObject::destroyed, safeData, &QObject::deleteLater);
QMetaObject::invokeMethod(safeData, [safeData, config]() {
QMetaObject::invokeMethod(safeData, [safeData, config]() {
// Try to transition from Initializing to Succeeded
if (safeData->m_status.testAndSetOrdered(static_cast<int>(Data::Status::Initializing),
static_cast<int>(Data::Status::Succeeded))) {
// CAS succeeded: connect config destroyed signal to cleanup Data, then emit success signal to main thread
QObject::connect(config, &QObject::destroyed, safeData, &QObject::deleteLater);
if (safeData->m_userConfig) {
Q_EMIT safeData->m_userConfig->configInitializeSucceed(config);
}
}, Qt::QueuedConnection);
} else {
// CAS failed - state changed (e.g., set to Destroyed)
// We must clean up the config we just created
config->deleteLater();
safeData->deleteLater();
}
} else {
// CAS failed - state changed (e.g., set to Destroyed)
// We must clean up the config we just created
config->deleteLater();
safeData->deleteLater();
}
}, Qt::QueuedConnection);

});
}
static dconfig_dconf-example_meta* create(const QString &appId = {}, const QString &subpath = {}, QObject *parent = nullptr, QThread *thread = DTK_CORE_NAMESPACE::DConfig::globalThread())
Expand Down
29 changes: 15 additions & 14 deletions toolGenerate/dconfig2cpp/dconf-example_other_app_configure_meta.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* This file is generated by dconfig2cpp.
* Command line arguments: ./build/tools/dconfig2cpp/dconfig2cpp ./tests/data/dconf-example_other_app_configure.meta.json -o ./toolGenerate/dconfig2cpp/dconf-example_other_app_configure_meta.hpp
* Generation time: 2026-01-20T14:15:13
* Generation time: 2026-01-21T14:02:20
* JSON file version: 1.0
*
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
Expand Down Expand Up @@ -109,22 +109,23 @@ class dconfig_dconf-example_other_app_configure_meta : public QObject {
// Initialize through Data class
safeData->initializeInConfigThread(config);

// Try to transition from Initializing to Succeeded
if (safeData->m_status.testAndSetOrdered(static_cast<int>(Data::Status::Initializing),
static_cast<int>(Data::Status::Succeeded))) {
// CAS succeeded: connect config destroyed signal to cleanup Data, then emit success signal to main thread
QObject::connect(config, &QObject::destroyed, safeData, &QObject::deleteLater);
QMetaObject::invokeMethod(safeData, [safeData, config]() {
QMetaObject::invokeMethod(safeData, [safeData, config]() {
// Try to transition from Initializing to Succeeded
if (safeData->m_status.testAndSetOrdered(static_cast<int>(Data::Status::Initializing),
static_cast<int>(Data::Status::Succeeded))) {
// CAS succeeded: connect config destroyed signal to cleanup Data, then emit success signal to main thread
QObject::connect(config, &QObject::destroyed, safeData, &QObject::deleteLater);
if (safeData->m_userConfig) {
Q_EMIT safeData->m_userConfig->configInitializeSucceed(config);
}
}, Qt::QueuedConnection);
} else {
// CAS failed - state changed (e.g., set to Destroyed)
// We must clean up the config we just created
config->deleteLater();
safeData->deleteLater();
}
} else {
// CAS failed - state changed (e.g., set to Destroyed)
// We must clean up the config we just created
config->deleteLater();
safeData->deleteLater();
}
}, Qt::QueuedConnection);

});
}
static dconfig_dconf-example_other_app_configure_meta* create(const QString &appId = {}, const QString &subpath = {}, QObject *parent = nullptr, QThread *thread = DTK_CORE_NAMESPACE::DConfig::globalThread())
Expand Down
29 changes: 15 additions & 14 deletions toolGenerate/dconfig2cpp/dconf-global_meta.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* This file is generated by dconfig2cpp.
* Command line arguments: ./build/tools/dconfig2cpp/dconfig2cpp ./tests/data/dconf-global.meta.json -o ./toolGenerate/dconfig2cpp/dconf-global_meta.hpp
* Generation time: 2026-01-20T14:15:13
* Generation time: 2026-01-21T14:02:35
* JSON file version: 1.0
*
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
Expand Down Expand Up @@ -108,22 +108,23 @@ class dconfig_dconf-global_meta : public QObject {
// Initialize through Data class
safeData->initializeInConfigThread(config);

// Try to transition from Initializing to Succeeded
if (safeData->m_status.testAndSetOrdered(static_cast<int>(Data::Status::Initializing),
static_cast<int>(Data::Status::Succeeded))) {
// CAS succeeded: connect config destroyed signal to cleanup Data, then emit success signal to main thread
QObject::connect(config, &QObject::destroyed, safeData, &QObject::deleteLater);
QMetaObject::invokeMethod(safeData, [safeData, config]() {
QMetaObject::invokeMethod(safeData, [safeData, config]() {
// Try to transition from Initializing to Succeeded
if (safeData->m_status.testAndSetOrdered(static_cast<int>(Data::Status::Initializing),
static_cast<int>(Data::Status::Succeeded))) {
// CAS succeeded: connect config destroyed signal to cleanup Data, then emit success signal to main thread
QObject::connect(config, &QObject::destroyed, safeData, &QObject::deleteLater);
if (safeData->m_userConfig) {
Q_EMIT safeData->m_userConfig->configInitializeSucceed(config);
}
}, Qt::QueuedConnection);
} else {
// CAS failed - state changed (e.g., set to Destroyed)
// We must clean up the config we just created
config->deleteLater();
safeData->deleteLater();
}
} else {
// CAS failed - state changed (e.g., set to Destroyed)
// We must clean up the config we just created
config->deleteLater();
safeData->deleteLater();
}
}, Qt::QueuedConnection);

});
}
static dconfig_dconf-global_meta* create(const QString &appId = {}, const QString &subpath = {}, QObject *parent = nullptr, QThread *thread = DTK_CORE_NAMESPACE::DConfig::globalThread())
Expand Down
27 changes: 14 additions & 13 deletions tools/dconfig2cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,22 +355,23 @@ int main(int argc, char *argv[]) {
// Initialize through Data class
safeData->initializeInConfigThread(config);

// Try to transition from Initializing to Succeeded
if (safeData->m_status.testAndSetOrdered(static_cast<int>(Data::Status::Initializing),
static_cast<int>(Data::Status::Succeeded))) {
// CAS succeeded: connect config destroyed signal to cleanup Data, then emit success signal to main thread
QObject::connect(config, &QObject::destroyed, safeData, &QObject::deleteLater);
QMetaObject::invokeMethod(safeData, [safeData, config]() {
// Queue state transition to main thread, to ensure config values are fully initialized.
QMetaObject::invokeMethod(safeData, [safeData, config]() {
// Try to transition from Initializing to Succeeded
if (safeData->m_status.testAndSetOrdered(static_cast<int>(Data::Status::Initializing),
static_cast<int>(Data::Status::Succeeded))) {
// CAS succeeded: connect config destroyed signal to cleanup Data, then emit success signal to main thread
QObject::connect(config, &QObject::destroyed, safeData, &QObject::deleteLater);
if (safeData->m_userConfig) {
Q_EMIT safeData->m_userConfig->configInitializeSucceed(config);
}
}, Qt::QueuedConnection);
} else {
// CAS failed - state changed (e.g., set to Destroyed)
// We must clean up the config we just created
config->deleteLater();
safeData->deleteLater();
}
} else {
// CAS failed - state changed (e.g., set to Destroyed)
// We must clean up the config we just created
config->deleteLater();
safeData->deleteLater();
}
}, Qt::QueuedConnection);
});
}
)";
Expand Down