Skip to content

Commit c5c7323

Browse files
re2zerodeepin-bot[bot]
authored andcommitted
chore: more logs
Add more logs for functions and switch cases. Log: more logs.
1 parent 8f49e35 commit c5c7323

38 files changed

Lines changed: 3420 additions & 312 deletions

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,40 @@ third/
1616

1717
#linglong building dir
1818
linglong
19+
20+
# Added by Task Master AI
21+
# Logs
22+
logs
23+
*.log
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
dev-debug.log
28+
# Dependency directories
29+
node_modules/
30+
# Environment variables
31+
.env
32+
.env.example
33+
# Editor directories and files
34+
.idea
35+
.vscode
36+
*.suo
37+
*.ntvs*
38+
*.njsproj
39+
*.sln
40+
*.sw?
41+
# OS specific
42+
.DS_Store
43+
# Task files
44+
tasks.json
45+
tasks/
46+
.taskmaster/
47+
48+
# AI config
49+
.cursor/
50+
.cursorindexingignore
51+
.windsurfrules
52+
.roo/
53+
.roomodes
54+
.specstory/
55+
.windsurf/

src/common/config.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Config::Config(QObject *parent)
7171
#ifdef DTKCORE_CLASS_DConfigFile
7272
dconfig = DConfig::create("org.deepin.editor", "org.deepin.editor");
7373
if (dconfig->isValid()) {
74+
qDebug() << "DConfig is valid";
7475
// 默认提高GB18030识别率
7576
improveGB18030 = !dconfig->value(g_keyDisableImproveGB18030).toBool();
7677
qInfo() << qPrintable("DConfig::ImproveGB18030:") << improveGB18030;
@@ -82,15 +83,19 @@ Config::Config(QObject *parent)
8283
qInfo() << qPrintable("DConfig::defaultEncoding") << encoding;
8384

8485
connect(dconfig, &DConfig::valueChanged, this, [this](const QString &key) {
86+
qDebug() << "Config value changed for key:" << key;
8587
if (key == g_keyDisableImproveGB18030) {
8688
this->improveGB18030 = !this->dconfig->value(g_keyDisableImproveGB18030).toBool();
8789
qInfo() << qPrintable("DConfig::ImproveGB18030 changed:") << improveGB18030;
90+
qDebug() << "improveGB18030 changed to" << this->improveGB18030;
8891
} else if (key == g_keyEnablePatchedIconv) {
8992
this->patchedIconv = dconfig->value(g_keyEnablePatchedIconv).toBool();
9093
qInfo() << qPrintable("DConfig::enablePatchedIconv changed:") << patchedIconv;
94+
qDebug() << "patchedIconv changed to" << this->patchedIconv;
9195
} else if (key == g_keyDefaultEncoding) {
9296
this->encoding = dconfig->value(g_keyDefaultEncoding).toByteArray().toUpper();
9397
qInfo() << qPrintable("DConfig::defaultEncoding changed:") << encoding;
98+
qDebug() << "encoding changed to" << this->encoding;
9499
}
95100
});
96101

@@ -103,22 +108,26 @@ Config::Config(QObject *parent)
103108

104109
// 检测当前iconv使用的GB18030编码是否为2005标准(2005标准强制使用上层补丁版本)
105110
iocnvUse2005Standard = detectIconvUse2005Standard();
111+
qDebug() << "Leaving Config::Config";
106112
}
107113

108114
Config::~Config()
109115
{
110116
qDebug() << "Destroying Config instance";
111117
#ifdef DTKCORE_CLASS_DConfigFile
112118
if (dconfig) {
119+
qDebug() << "Deleting dconfig";
113120
delete dconfig;
114121
}
115122
#endif
123+
qDebug() << "Leaving Config::~Config";
116124
}
117125

118126
Config *Config::instance()
119127
{
120128
qDebug() << "Getting Config singleton instance";
121129
static Config config;
130+
qDebug() << "Leaving Config::instance";
122131
return &config;
123132
}
124133

@@ -127,6 +136,7 @@ Config *Config::instance()
127136
*/
128137
bool Config::enableImproveGB18030() const
129138
{
139+
qDebug() << "Entering Config::enableImproveGB18030, returning" << improveGB18030;
130140
return improveGB18030;
131141
}
132142

@@ -136,6 +146,7 @@ bool Config::enableImproveGB18030() const
136146
*/
137147
bool Config::enablePatchedIconv() const
138148
{
149+
qDebug() << "Entering Config::enablePatchedIconv, returning" << (patchedIconv || iocnvUse2005Standard);
139150
return patchedIconv || iocnvUse2005Standard;
140151
}
141152

@@ -144,5 +155,11 @@ bool Config::enablePatchedIconv() const
144155
*/
145156
QByteArray Config::defaultEncoding() const
146157
{
147-
return encoding.isEmpty() ? QByteArray("UTF-8") : encoding;
158+
qDebug() << "Entering Config::defaultEncoding";
159+
if (encoding.isEmpty()) {
160+
qDebug() << "Encoding is empty, returning UTF-8";
161+
return QByteArray("UTF-8");
162+
}
163+
qDebug() << "Returning configured encoding:" << encoding;
164+
return encoding;
148165
}

0 commit comments

Comments
 (0)