Commit Graph

531 Commits

Author SHA1 Message Date
Ye ShanShan e43ebd081c fix: DConfig can't find resource
dde-config-daemon loads resouce from `$$PREFIX/share/dsg` when default
action, and `PREFIX`'s value is empty.
set default value for PREFIX from QT_INSTALL_PREFIX(/usr).

Log: 
Influence: 开发dtkcore,但没有指定PREFIX值,导致配置策略加载失败
Change-Id: I97573c283365aa581d5e93eb75d27259134f10af
2022-04-29 08:12:09 +00:00
Ye ShanShan 9c9c027209 fix: application crash when dconfig is invalid
Add invalid check for all DConfig's method(avoid null pointer dereference).
fallback to FileBackend when DBusBackend can't be created.

set correct environment value in unit test.

Log:
Influence: all application crash when dconfig is invalid but still
call other method expect isValid.

Change-Id: I7395f44518989cb14a09306fcfd4db380608a24e
2022-04-29 08:03:57 +00:00
deepin-bot[bot] bd31ad47e0
File Sync from linuxdeepin/.github (#58)
chore: Sync by b5a441b9bb
2022-04-21 07:01:49 +00:00
deepin-bot[bot] 695d83dc91
chore: Sync by 41155231b0 (#57)
chore: Sync by 41155231b0
2022-04-18 09:42:40 +00:00
xyf 7a24e234d5 chore: Update README.md
将README.md中的Qt版本更新

Log: 更新README.md
2022-04-15 11:37:34 +08:00
Ye ShanShan 3d8c5c1b9d chore: unit error in loongarch64
QSettingsBackend unit is error in loongarch64

Log: 
Influence: none
Change-Id: I364ed6a9601688a7348c12bb740bf964a5f1ab98
2022-04-11 16:53:06 +08:00
Ye ShanShan 044955459a chore: unit error in loongarch64
QSettingsBackend unit is error in loongarch64

Log: 
Influence: none
Change-Id: Ibd656196db2e3f9d73642943b4eb79c3d477084f
2022-04-11 16:53:06 +08:00
Ye ShanShan 4d0cb3fc1b fix: modify loading order of application meta path
for application meta path loads order change from
/usr/share/dsg/apps/${appid}/confgis to
/usr/share/dsg/configs/${appid} or /usr/share/dsg/configs;
replace DStandardPaths::paths to DStandardPaths::path.
modify saved path。

Log:
Influence: all application's configuration would not be loaded
unless updating dtkcommon and it's application package.

Change-Id: Ia8212618fd2d4a5ecf67f05aad32a92d934ea01d
2022-04-11 16:53:06 +08:00
ck 7389c83b78 chore: remove assert in ensureOsVersion
use if condition instead of assert
setStatus No_ERROR when loadfile success

Log:
Influence: none
Change-Id: Id13c9c418054890e41e51dae9367261844fe9ed6
2022-04-11 16:48:54 +08:00
Ye ShanShan 72cc33ec0a feat: Add interface for Dconfig
add reset function;
add Dconfig construct containing appId, to keep compatible,we use
a static function to avoid ambiguous, construct function calls
no appid's. it is useful to access other application's configure
timely in DBusBackend.

Log:
Influence: user can access other application's configure and
reset value for the key.

Change-Id: Id707a96ba1216b406b5c6f724ba5d715cfb053db
2022-04-11 16:48:54 +08:00
ck bcdb09c189 chore: 修改单元测试生成目录
修改单元测试相关文件的目录结构

Log:
Influence: 单元测试目录结构
Change-Id: Ife2dabc8763fd6689c7b5c5fadbc40152217e116
2022-04-11 16:47:38 +08:00
Ye ShanShan 423d530965 feat: add data type check for config
Check value's type of incoming is compatible,
it copies a value and converts to meta type, it promises
that setValue function is not changing meta type.

Log:
Influence: calling DConfig's setValue maybe fail because of type
incompatible.

Change-Id: I35bef57261a3130ebcb4aeeff83261737ad51197
2022-04-11 16:47:38 +08:00
Ye ShanShan 3c80a88052 fix: Can't access QStringList type data for DConfig
it's occur in DBusBackend, and we directly to get meta value that not
exist cache.
normal value type is automatic casted from QDBusVariant to QVariant,
and QVariantList type need to cast explicitly, it's value type is
QDBusArgument.
because our data store backend is using QJsonValue to resolve, so
we only case QVariantList and QVariantMap, it maybe error in lastly.

Log: 
Influence: DConfig is not access stringlist data type.
Change-Id: I81dbc2ea6b7933154d26ddba70def95ef79240d6
2022-04-11 16:47:38 +08:00
Ye ShanShan 490670f596 fix: unit error
inotify_init1 failed in DFileSystemWatcher, it reports Too many
open files, and now we avoid to CHECK temporarily in ut.

Log: 
Influence: none
Change-Id: I42d508b1ad63dfb4dda8328a41bcbfc530082e97
2022-04-11 16:47:38 +08:00
ck 6cb7ec8f70 chore: 主动拉起未启动的 dconfig 服务
如果服务是 Activatable 状态那么直接调用可以启动服务
之前的逻辑是dbus服务必须是启动状态,不会自动拉起来,
可能会出现没有权限写cache

Log: 主动拉起dconfig服务
Influence: dconfig--save--permission
Change-Id: I32eb4606854f568b8754bf765802453dfdb8b15a
2022-04-11 16:44:49 +08:00
Chen Bin d8b924ae25 docs: fix doc generate error
Fix the problem of document generation errors caused by
some symbols and commands.

Log:
Influence: dtkcore docs
Change-Id: I081c12a3bc98c89925e27aa7c2e1aeb0e228c255
2022-04-11 16:44:49 +08:00
ck 5ae0099c78 fix(build): can not find QGSettings
archlinux build failed, include path may have changed

Log:
Influence: none
Change-Id: I75d7aba1fb96a5a48fb819faf087ff1a0c7d9a0c
2022-04-11 16:44:49 +08:00
ck 6071352b6f feat: osversion中OEM标识兼容
根据需求识别os-version中的OEM标识,放置出现非数字时其它未解析。

Task: https://pms.uniontech.com/zentao/task-view-95660.html
Log:
Influence: oem镜像
Change-Id: I4d2e5f71f683131553053928bc7f53115126c73c
2022-04-11 16:44:49 +08:00
yuanqiliang 418498ca03 fix: 修复dtk单例模板缺陷
析构函数设置为虚函数、返回引用

Log:

Influence: 所有用到dtkcore单例模板的地方

Change-Id: I0d1dec61679ff9d86547e6895aafdaf2fcf69115
2022-04-11 16:44:49 +08:00
Ye ShanShan 6ae34243fb fix: change directory of cache for dconfig
change globalcache direcotry
from '/deepin/appdata' to '/var/dsg/appdata'.
it saves failed when user has no home directory.

Bug: https://pms.uniontech.com/zentao/bug-view-105077.html
Log:
Influence: It effects all application used dconfig.

Change-Id: If7a0e67c762f58701bf58a228e84e8c2525a897f
2022-04-11 16:44:49 +08:00
zorowk 3891b1bdae fix: ut link error in dtk.
the member definition need to be separate in some build environment.

Log:
Influence: build error.
Signed-off-by: zorowk <pengwenhao@uniontech.com>
Change-Id: Idd982f0e0a17efa50e170c4590c83ea75abaa031
2022-04-11 16:32:43 +08:00
Wang Fei 12e5b42bed feat: DSettings适配兼容DConfig
增加DSettingsDConfigbackend类,
DSetting可以使用DConfig方式配置

Log: 使DSettings适配兼容DConfig
Influence: DSettings使用DConfig
Change-Id: I1e8485d4c087063536d17f5658a22babd74f31f4
2022-04-11 16:31:42 +08:00
ck dd9d3f9db7 chore: not check dtkcore2 and dtkcore5
防止重复加载这里去掉dtkcore2的加载,部分应用(deepin-system-monitor)
103x上有加载libdtkcore2,此处过滤掉

Bug: https://pms.uniontech.com/zentao/bug-view-103218.html
Log:
Influence: dtkcore2 和 dtkcore5 可同时加载
Change-Id: Ia110a2b726a905c5dc08536f0af36cceb84fed33
2022-04-11 16:31:42 +08:00
Ye ShanShan 91e41b12f2 fix: ut links failed
add dsgapplication.cpp to tests.

Log:
Influence: none
Change-Id: Ib3ca7ddf43e9f3de6e7ff7e9b94d8bcdb59be0ef
2022-04-06 14:42:14 +08:00
Ye ShanShan 5b9329246e fix: DSetting unit error and crash randomly
DSettingsBackend::doSetOption is executing when `DSettings` has
been destroyed, because `doSetOption` is connected in `QueuedConnection`
way, this would be ensure `backendWriteThread`'s eventloop is exited
when `DSetting` destoryed.

we ensure `DSettings` is released before `SettingBackend`, so that
`SettingBackend`'s slot would not be executed when `DSetting` destoryed.

we also should ensure `SettinBackend` is thread safely, because os
`DSettings` has backendWriteThread to execute doSetOption, and getOption,
is execute in main thread.

remove link of libdtkcore in qmake, because we compile it's source code
in unit test.

Log:
Influence: none
2022-03-23 11:17:45 +08:00
Ye ShanShan b6d3462745 fix: dconfig can't support embed complex data type
using recursion to parse QDBusArgument.

Log:
Influence: none
2022-03-23 11:16:43 +08:00
deepin-bot[bot] 6cb60700f1
File Sync from linuxdeepin/.github (#48)
chore: Sync by d459ab5b73
2022-03-15 08:13:46 +00:00
Ye ShanShan 498ed25a42 refactor: Change the way to get appId
get appId by DSGApplication.

Log: 
Influence: none
Change-Id: Ic4968cb97bc224eaf2e004f357a1518d58c874c2
2022-03-14 21:56:42 +08:00
Ye ShanShan 12ed6fea13 chore: add check for filesystemwatcher
add output and check information to hint inotify_init1 failed.

Log: 
Influence: none
Change-Id: I81ab483bc29115513c9d5e7a14b455e0e01b16aa
2022-03-14 21:56:22 +08:00
Ye ShanShan e594322141 fix: modify loading order of application meta path
for application meta path loads order change from
/usr/share/dsg/apps/${appid}/confgis to
/usr/share/dsg/configs/${appid} or /usr/share/dsg/configs;
replace DStandardPaths::paths to DStandardPaths::path.
modify saved path。

Log:
Influence: all application's configuration would not be loaded
unless updating dtkcommon and it's application package.

Change-Id: Ia8212618fd2d4a5ecf67f05aad32a92d934ea01d
2022-03-14 10:17:56 +08:00
ck 72632597fd chore: remove assert in ensureOsVersion
use if condition instead of assert
setStatus No_ERROR when loadfile success

Log:
Influence: none
Change-Id: Id13c9c418054890e41e51dae9367261844fe9ed6
2022-03-14 09:23:58 +08:00
Ye ShanShan b5de9328a2 fix: modify loading order of application meta path
for application meta path loads order change from
/usr/share/dsg/apps/${appid}/confgis to
/usr/share/dsg/configs/${appid} or /usr/share/dsg/configs;
replace DStandardPaths::paths to DStandardPaths::path.
modify saved path。

Log:
Influence: all application's configuration would not be loaded
unless updating dtkcommon and it's application package.

Change-Id: Ia8212618fd2d4a5ecf67f05aad32a92d934ea01d
2022-03-12 12:34:37 +08:00
zccrs 732ec1f338 refactor: add DStandardPaths::paths(DSG type) interface
The DSG::DataDir is a path list like the xdg data dirs, change the env "DSG_DATA_DIR"
to "DSG_DATA_DIRS".

Influence: dconfig 相关的改动,改变了获取配置文件路径的逻辑,与此相关的产品功能不应
该出现任何变化。

Log:
Change-Id: I5f12e42aee607ed749aa63f503c62e352c07b2a6
(cherry picked from commit 33bfc9b25f)
2022-03-10 20:47:27 +08:00
Ye ShanShan 0960bea4e2 feat: Add interface for Dconfig
add reset function;
add Dconfig construct containing appId, to keep compatible,we use
a static function to avoid ambiguous, construct function calls
no appid's. it is useful to access other application's configure
timely in DBusBackend.

Log:
Influence: user can access other application's configure and
reset value for the key.

Change-Id: Id707a96ba1216b406b5c6f724ba5d715cfb053db
2022-03-09 08:46:10 +08:00
zccrs e47884a109 fix: add LIBDTKCORESHARED_EXPORT for DSGApplication
Export the DSGApplication symbols.
Pass the test case if can't write a file for the file watcher.

Influence: 无

Log:
Change-Id: I1e6b4827fc13ededb496393fe9d587e58d759ad4
2022-03-08 17:52:54 +08:00
ck 6867a279be chore: 修改单元测试生成目录
修改单元测试相关文件的目录结构

Log:
Influence: 单元测试目录结构
Change-Id: Ife2dabc8763fd6689c7b5c5fadbc40152217e116
2022-03-04 16:45:51 +08:00
zccrs 0c5dc30e89 feat: add DSGApplication class
The DSGApplication::id() return the application id string, the
application starter should add the "DSG_APP_ID" environment for it.

Influence: 无

Log:
Change-Id: Ifbea7f3f1d35873f0ff56373275e32f3d477a1d7
2022-03-04 14:46:56 +08:00
Ye ShanShan 438f3adce5 feat: add data type check for config
Check value's type of incoming is compatible,
it copies a value and converts to meta type, it promises
that setValue function is not changing meta type.

Log:
Influence: calling DConfig's setValue maybe fail because of type
incompatible.

Change-Id: I35bef57261a3130ebcb4aeeff83261737ad51197
2022-03-02 20:14:28 +08:00
zccrs 33bfc9b25f refactor: add DStandardPaths::paths(DSG type) interface
The DSG::DataDir is a path list like the xdg data dirs, change the env "DSG_DATA_DIR"
to "DSG_DATA_DIRS".

Influence: dconfig 相关的改动,改变了获取配置文件路径的逻辑,与此相关的产品功能不应
该出现任何变化。

Log:
Change-Id: I5f12e42aee607ed749aa63f503c62e352c07b2a6
2022-03-02 15:16:01 +08:00
Ye ShanShan a3503969de fix: Can't access QStringList type data for DConfig
it's occur in DBusBackend, and we directly to get meta value that not
exist cache.
normal value type is automatic casted from QDBusVariant to QVariant,
and QVariantList type need to cast explicitly, it's value type is
QDBusArgument.
because our data store backend is using QJsonValue to resolve, so
we only case QVariantList and QVariantMap, it maybe error in lastly.

Log: 
Influence: DConfig is not access stringlist data type.
Change-Id: I81dbc2ea6b7933154d26ddba70def95ef79240d6
2022-03-01 17:21:41 +08:00
Ye ShanShan 847c721c87 fix: unit error
inotify_init1 failed in DFileSystemWatcher, it reports Too many
open files, and now we avoid to CHECK temporarily in ut.

Log: 
Influence: none
Change-Id: I42d508b1ad63dfb4dda8328a41bcbfc530082e97
2022-03-01 16:55:52 +08:00
Chen Bin 8f69866f49 fix(DCI file): Soft link error
Soft link directories retain the original directory
rather than the directory in the relative DCI file,
resulting in the target file not being indexed correctly

Log:
Influence: dci tool
Change-Id: I15779b6b2552537ac2fd8be8f856d7b3d27be44e
2022-02-22 13:28:48 +08:00
ck 74f86b0e3c chore: 主动拉起未启动的 dconfig 服务
如果服务是 Activatable 状态那么直接调用可以启动服务
之前的逻辑是dbus服务必须是启动状态,不会自动拉起来,
可能会出现没有权限写cache

Log: 主动拉起dconfig服务
Influence: dconfig--save--permission
Change-Id: I32eb4606854f568b8754bf765802453dfdb8b15a
2022-01-26 12:23:23 +08:00
Chen Bin 7e813b8a90 docs: fix doc generate error
Fix the problem of document generation errors caused by
some symbols and commands.

Log:
Influence: dtkcore docs
Change-Id: I081c12a3bc98c89925e27aa7c2e1aeb0e228c255
2022-01-20 12:35:52 +08:00
ck 11c0eb49ad fix(build): can not find QGSettings
archlinux build failed, include path may have changed

Log:
Influence: none
Change-Id: I75d7aba1fb96a5a48fb819faf087ff1a0c7d9a0c
2021-12-24 09:54:32 +08:00
ck 78e7fa0d8f feat: osversion中OEM标识兼容
根据需求识别os-version中的OEM标识,放置出现非数字时其它未解析。

Task: https://pms.uniontech.com/zentao/task-view-95660.html
Log:
Influence: oem镜像
Change-Id: I4d2e5f71f683131553053928bc7f53115126c73c
2021-12-21 16:50:49 +08:00
yuanqiliang 4804211a53 fix: 修复dtk单例模板缺陷
析构函数设置为虚函数、返回引用

Log:

Influence: 所有用到dtkcore单例模板的地方

Change-Id: I0d1dec61679ff9d86547e6895aafdaf2fcf69115
2021-12-17 16:24:41 +08:00
Ye ShanShan cb7c91dfd5 fix: change directory of cache for dconfig
change globalcache direcotry
from '/deepin/appdata' to '/var/dsg/appdata'.
it saves failed when user has no home directory.

Bug: https://pms.uniontech.com/zentao/bug-view-105077.html
Log:
Influence: It effects all application used dconfig.

Change-Id: If7a0e67c762f58701bf58a228e84e8c2525a897f
2021-12-08 11:52:50 +08:00
zorowk 90e010a7ba fix: ut link error in dtk.
the member definition need to be separate in some build environment.

Log:
Influence: build error.
Signed-off-by: zorowk <pengwenhao@uniontech.com>
Change-Id: Idd982f0e0a17efa50e170c4590c83ea75abaa031
2021-12-01 10:12:58 +08:00
Chen Bin a69a098352 feat: Merge branch 'dev/dci' into v23
Add some implementation of DCI.

Log:
Influence: dci
Change-Id: Ide236946abc52cd0da6f9ad08c98f564c68d7a95
2021-11-30 11:04:36 +08:00