Comments (4)
@18202781743 我想问一下我在写DConfigFiel例子, configfile.save()的时候,非全局缓存的话,会拼接用户目录/.config/dsg/configs-fake-global/appid,好像我没看到能设置成全局缓存的函数,或者我选择别的方法,怎么写比较好呢?
from dtkcore.
@18202781743 我想问一下我在写DConfigFiel例子, configfile.save()的时候,非全局缓存的话,会拼接用户目录/.config/dsg/configs-fake-global/appid,好像我没看到能设置成全局缓存的函数,或者我选择别的方法,怎么写比较好呢?
生成全局缓存,是在配置项设置了global,此项有更新之后被调用。
对于缓存,DConfigFile内部有DConfigCacheImpl类去管理,根据flag来判断是全局还是用户级的。
DConfigFile内部默认持有的是全局缓存,对于非全局缓存,是根据用户创建的,
你可以在DConfig的filebackend里看到它的使用,
你也可以在dde-app-services里的dde-dconfig-daemon里看到这个逻辑的处理,
from dtkcore.
@18202781743 我想问一下我在写DConfigFiel例子, configfile.save()的时候,非全局缓存的话,会拼接用户目录/.config/dsg/configs-fake-global/appid,好像我没看到能设置成全局缓存的函数,或者我选择别的方法,怎么写比较好呢?
生成全局缓存,是在配置项设置了global,此项有更新之后被调用。 对于缓存,DConfigFile内部有DConfigCacheImpl类去管理,根据flag来判断是全局还是用户级的。 DConfigFile内部默认持有的是全局缓存,对于非全局缓存,是根据用户创建的, 你可以在DConfig的filebackend里看到它的使用, 你也可以在dde-app-services里的dde-dconfig-daemon里看到这个逻辑的处理,
好的 谢谢 我去看看
from dtkcore.
@18202781743 调用DConfigFile load的时候确实是读取了/usr/share/dsg/configs/appid下的json,但是setValue的时候要加入userCache,数据就保存到用户目录/.config/dsg/configs-fake-global/,我看DConfigFilePrivate里setValue也是需要userCache,那是不是save的时候只允许保存到用户目录下,而不是那个全局目录
from dtkcore.
Related Issues (20)
- Doc: [Standardized documents][ddesktopentry.h]
- Doc: [Example documents][ddesktopentry.h] HOT 1
- Doc: [Example documents][dconfig.h]
- Doc: [Standardized documents][dsysinfo.h]
- 关于dconfigfile中缺失的宏以及创建目录的问题 HOT 12
- Doc: [Example documents][ddcifile.h]
- Doc: [Example documents][dsettings.h]
- Doc: [Standardized documents][dfilesystemwatcher.h]
- Need to add new features to dfilewatchermanager HOT 1
- Compile failed: a header file not found HOT 3
- 汉字转拼音多音字支持 HOT 1
- dcapfsfileengine.cpp implementation HOT 2
- header files include mess HOT 2
- Add test: [DStandardPaths]
- Add test: [RollingFileAppender]
- 使用QLoggingCategory时,DLog输出"No appenders assotiated with category" HOT 12
- 环境变量及部分关键字的地方支持 `DDE` 字段
- Feature request: implement missing features of QtDBus HOT 3
- DConfig接口支持异步
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dtkcore.