GithubHelp home page GithubHelp logo

Comments (4)

chenchongbiao avatar chenchongbiao commented on June 12, 2024

@18202781743 我想问一下我在写DConfigFiel例子, configfile.save()的时候,非全局缓存的话,会拼接用户目录/.config/dsg/configs-fake-global/appid,好像我没看到能设置成全局缓存的函数,或者我选择别的方法,怎么写比较好呢?

from dtkcore.

18202781743 avatar 18202781743 commented on June 12, 2024

@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.

chenchongbiao avatar chenchongbiao commented on June 12, 2024

@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.

chenchongbiao avatar chenchongbiao commented on June 12, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.