Skip to content

Commit d2b1e93

Browse files
deepin-ci-robot18202781743
authored andcommitted
sync: from linuxdeepin/dtkcore
Synchronize source files from linuxdeepin/dtkcore. Source-pull-request: linuxdeepin/dtkcore#454
1 parent 69effb9 commit d2b1e93

11 files changed

+1364
-37
lines changed

.reuse/dep5

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,8 @@ License: MIT
8383
Files: docs/references/*
8484
Copyright: UnionTech Software Technology Co., Ltd.
8585
License: CC-BY-4.0
86+
87+
88+
Files: toolGenerate/**/*
89+
Copyright: None
90+
License: CC0-1.0

cmake/DtkTools/DtkDConfigMacros.cmake

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function(dtk_add_config_to_cpp OUTPUT_VAR JSON_FILE)
1313
cmake_parse_arguments(
1414
"arg"
1515
""
16-
"OUTPUT_FILE_NAME;CLASS_NAME;USE_QPROPERTY;GET_IS_DEFAULT_VALUE"
16+
"OUTPUT_FILE_NAME;CLASS_NAME;USE_QPROPERTY"
1717
""
1818
${ARGN}
1919
)
@@ -45,16 +45,10 @@ function(dtk_add_config_to_cpp OUTPUT_VAR JSON_FILE)
4545
set(USE_QPROPERTY_ARG "")
4646
endif()
4747

48-
if (arg_GET_IS_DEFAULT_VALUE)
49-
set(GET_IS_DEFAULT_VALUE_ARG "--get-is-default-value")
50-
else()
51-
set(GET_IS_DEFAULT_VALUE_ARG "")
52-
endif()
53-
5448
# Add a custom command to run dconfig2cpp
5549
add_custom_command(
5650
OUTPUT ${OUTPUT_HEADER}
57-
COMMAND ${DTK_DCONFIG2CPP} -o ${OUTPUT_HEADER} ${CLASS_NAME_ARG} ${USE_QPROPERTY_ARG} ${GET_IS_DEFAULT_VALUE_ARG} ${JSON_FILE}
51+
COMMAND ${DTK_DCONFIG2CPP} -o ${OUTPUT_HEADER} ${CLASS_NAME_ARG} ${USE_QPROPERTY_ARG} ${JSON_FILE}
5852
DEPENDS ${JSON_FILE} ${DTK_XML2CPP}
5953
COMMENT "Generating ${OUTPUT_HEADER} from ${JSON_FILE}"
6054
VERBATIM

src/log/dconfig_org_deepin_dtk_preference.hpp

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* This file is generated by dconfig2cpp.
3-
* Command line arguments: /home/zccrs/projects/dtkcore/build/unknown-Debug/tools/dconfig2cpp/dconfig2cpp --get-is-default-value /home/zccrs/projects/dtkcommon/configs/org.deepin.dtk.preference.json
4-
* Generation time: 2025-02-20T19:16:13
3+
* Command line arguments: /home/zccrs/projects/dtkcore/build/unknown-Debug/tools/dconfig2cpp/dconfig2cpp /home/zccrs/projects/dtkcommon/configs/org.deepin.dtk.preference.json
4+
* Generation time: 2025-02-21T13:49:21
55
* JSON file version: 1.0
66
*
77
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
@@ -28,6 +28,10 @@ class dconfig_org_deepin_dtk_preference : public QObject {
2828
Q_PROPERTY(qlonglong themeType READ themeType WRITE setThemeType NOTIFY themeTypeChanged RESET resetThemeType)
2929
Q_PROPERTY(qlonglong titlebarHeight READ titlebarHeight WRITE setTitlebarHeight NOTIFY titlebarHeightChanged RESET resetTitlebarHeight)
3030
Q_PROPERTY(bool underlineShortcut READ underlineShortcut WRITE setUnderlineShortcut NOTIFY underlineShortcutChanged RESET resetUnderlineShortcut)
31+
Q_CLASSINFO("DConfigKeyList", "autoDisplayFeature;featureUpdated;keyboardsearchDisabled;rules;themeType;titlebarHeight;underlineShortcut")
32+
Q_CLASSINFO("DConfigFileName", "org.deepin.dtk.preference")
33+
Q_CLASSINFO("DConfigFileVersion", "1.0")
34+
3135
public:
3236
explicit dconfig_org_deepin_dtk_preference(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &name, const QString &appId, const QString &subpath, QObject *parent)
3337
: QObject(parent) {
@@ -76,22 +80,50 @@ class dconfig_org_deepin_dtk_preference : public QObject {
7680
}
7781
}
7882

79-
DTK_CORE_NAMESPACE::DConfig *config() const {
83+
Q_INVOKABLE DTK_CORE_NAMESPACE::DConfig *config() const {
8084
return m_config.loadRelaxed();
8185
}
8286

83-
bool isInitializeSucceed() const {
87+
Q_INVOKABLE bool isInitializeSucceed() const {
8488
return m_status.loadRelaxed() == static_cast<int>(Status::Succeed);
8589
}
8690

87-
bool isInitializeFailed() const {
91+
Q_INVOKABLE bool isInitializeFailed() const {
8892
return m_status.loadRelaxed() == static_cast<int>(Status::Failed);
8993
}
9094

91-
bool isInitializing() const {
95+
Q_INVOKABLE bool isInitializing() const {
9296
return m_status.loadRelaxed() == static_cast<int>(Status::Invalid);
9397
}
9498

99+
Q_INVOKABLE QStringList keyList() const {
100+
return { QStringLiteral(u"\u0061\u0075\u0074\u006f\u0044\u0069\u0073\u0070\u006c\u0061\u0079\u0046\u0065\u0061\u0074\u0075\u0072\u0065"),
101+
QStringLiteral(u"\u0066\u0065\u0061\u0074\u0075\u0072\u0065\u0055\u0070\u0064\u0061\u0074\u0065\u0064"),
102+
QStringLiteral(u"\u006b\u0065\u0079\u0062\u006f\u0061\u0072\u0064\u0073\u0065\u0061\u0072\u0063\u0068\u0044\u0069\u0073\u0061\u0062\u006c\u0065\u0064"),
103+
QStringLiteral(u"\u0072\u0075\u006c\u0065\u0073"),
104+
QStringLiteral(u"\u0074\u0068\u0065\u006d\u0065\u0054\u0079\u0070\u0065"),
105+
QStringLiteral(u"\u0074\u0069\u0074\u006c\u0065\u0062\u0061\u0072\u0048\u0065\u0069\u0067\u0068\u0074"),
106+
QStringLiteral(u"\u0075\u006e\u0064\u0065\u0072\u006c\u0069\u006e\u0065\u0053\u0068\u006f\u0072\u0074\u0063\u0075\u0074")};
107+
}
108+
109+
Q_INVOKABLE bool isDefaultValue(const QString &key) const {
110+
if (key == QStringLiteral(u"\u0061\u0075\u0074\u006f\u0044\u0069\u0073\u0070\u006c\u0061\u0079\u0046\u0065\u0061\u0074\u0075\u0072\u0065"))
111+
return autoDisplayFeatureIsDefaultValue();
112+
if (key == QStringLiteral(u"\u0066\u0065\u0061\u0074\u0075\u0072\u0065\u0055\u0070\u0064\u0061\u0074\u0065\u0064"))
113+
return featureUpdatedIsDefaultValue();
114+
if (key == QStringLiteral(u"\u006b\u0065\u0079\u0062\u006f\u0061\u0072\u0064\u0073\u0065\u0061\u0072\u0063\u0068\u0044\u0069\u0073\u0061\u0062\u006c\u0065\u0064"))
115+
return keyboardsearchDisabledIsDefaultValue();
116+
if (key == QStringLiteral(u"\u0072\u0075\u006c\u0065\u0073"))
117+
return rulesIsDefaultValue();
118+
if (key == QStringLiteral(u"\u0074\u0068\u0065\u006d\u0065\u0054\u0079\u0070\u0065"))
119+
return themeTypeIsDefaultValue();
120+
if (key == QStringLiteral(u"\u0074\u0069\u0074\u006c\u0065\u0062\u0061\u0072\u0048\u0065\u0069\u0067\u0068\u0074"))
121+
return titlebarHeightIsDefaultValue();
122+
if (key == QStringLiteral(u"\u0075\u006e\u0064\u0065\u0072\u006c\u0069\u006e\u0065\u0053\u0068\u006f\u0072\u0074\u0063\u0075\u0074"))
123+
return underlineShortcutIsDefaultValue();
124+
return false;
125+
}
126+
95127
bool autoDisplayFeature() const {
96128
return p_autoDisplayFeature;
97129
}
@@ -116,7 +148,7 @@ class dconfig_org_deepin_dtk_preference : public QObject {
116148
});
117149
}
118150
}
119-
bool autoDisplayFeatureIsDefaultValue() const {
151+
Q_INVOKABLE bool autoDisplayFeatureIsDefaultValue() const {
120152
return !testPropertySet(0);
121153
}
122154
bool featureUpdated() const {
@@ -143,7 +175,7 @@ class dconfig_org_deepin_dtk_preference : public QObject {
143175
});
144176
}
145177
}
146-
bool featureUpdatedIsDefaultValue() const {
178+
Q_INVOKABLE bool featureUpdatedIsDefaultValue() const {
147179
return !testPropertySet(1);
148180
}
149181
bool keyboardsearchDisabled() const {
@@ -170,7 +202,7 @@ class dconfig_org_deepin_dtk_preference : public QObject {
170202
});
171203
}
172204
}
173-
bool keyboardsearchDisabledIsDefaultValue() const {
205+
Q_INVOKABLE bool keyboardsearchDisabledIsDefaultValue() const {
174206
return !testPropertySet(2);
175207
}
176208
QString rules() const {
@@ -197,7 +229,7 @@ class dconfig_org_deepin_dtk_preference : public QObject {
197229
});
198230
}
199231
}
200-
bool rulesIsDefaultValue() const {
232+
Q_INVOKABLE bool rulesIsDefaultValue() const {
201233
return !testPropertySet(3);
202234
}
203235
qlonglong themeType() const {
@@ -224,7 +256,7 @@ class dconfig_org_deepin_dtk_preference : public QObject {
224256
});
225257
}
226258
}
227-
bool themeTypeIsDefaultValue() const {
259+
Q_INVOKABLE bool themeTypeIsDefaultValue() const {
228260
return !testPropertySet(4);
229261
}
230262
qlonglong titlebarHeight() const {
@@ -251,7 +283,7 @@ class dconfig_org_deepin_dtk_preference : public QObject {
251283
});
252284
}
253285
}
254-
bool titlebarHeightIsDefaultValue() const {
286+
Q_INVOKABLE bool titlebarHeightIsDefaultValue() const {
255287
return !testPropertySet(5);
256288
}
257289
bool underlineShortcut() const {
@@ -278,7 +310,7 @@ class dconfig_org_deepin_dtk_preference : public QObject {
278310
});
279311
}
280312
}
281-
bool underlineShortcutIsDefaultValue() const {
313+
Q_INVOKABLE bool underlineShortcutIsDefaultValue() const {
282314
return !testPropertySet(6);
283315
}
284316
Q_SIGNALS:

0 commit comments

Comments
 (0)