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
13 changes: 9 additions & 4 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: ./build5/tools/dconfig2cpp/dconfig2cpp /usr/share/dsg/configs/org.deepin.dtk.preference.json
* Generation time: 2025-05-08T16:56:17
* Command line arguments: ./build/tools/dconfig2cpp/dconfig2cpp /usr/share/dsg/configs/org.deepin.dtk.preference.json
* Generation time: 2025-08-20T15:40:55
* JSON file version: 1.0
*
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
Expand Down Expand Up @@ -113,6 +113,7 @@ class dconfig_org_deepin_dtk_preference : public QObject {
~dconfig_org_deepin_dtk_preference() {
if (m_config.loadRelaxed()) {
m_config.loadRelaxed()->deleteLater();
m_config.storeRelaxed(nullptr);
}
}

Expand Down Expand Up @@ -565,6 +566,8 @@ class dconfig_org_deepin_dtk_preference : public QObject {
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);
Expand All @@ -573,6 +576,8 @@ class dconfig_org_deepin_dtk_preference : public QObject {
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")) {
Expand Down Expand Up @@ -738,8 +743,8 @@ class dconfig_org_deepin_dtk_preference : public QObject {
bool p_enableDtkAnimations { false };
bool p_featureUpdated { false };
bool p_keyboardsearchDisabled { false };
// Default value: ""
QString p_rules { QLatin1String("") };
// Default value: "*.debug=false"
QString p_rules { QStringLiteral(u"\u002a\u002e\u0064\u0065\u0062\u0075\u0067\u003d\u0066\u0061\u006c\u0073\u0065") };
qlonglong p_scrollBarPolicy { 0 };
qlonglong p_sizeMode { 0 };
qlonglong p_themeType { 0 };
Expand Down
5 changes: 5 additions & 0 deletions tools/dconfig2cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ int main(int argc, char *argv[]) {
headerStream << " ~" << className << R"(() {
if (m_config.loadRelaxed()) {
m_config.loadRelaxed()->deleteLater();
m_config.storeRelaxed(nullptr);
}
}

Expand Down Expand Up @@ -458,6 +459,8 @@ 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);
Expand All @@ -466,6 +469,8 @@ 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);
)";
Expand Down
Loading