Comments (12)
from dtkcore.
“如果找不到全局目录,回退到用户目录下的configs-fake-global,但是也是由于没有权限的问题,创建目录的代码并没有成功执行。”
回退到用户目录下的 configs-fake-global 会失败吗?这个情况是不应该的
from dtkcore.
app data 目录,一般来说用环境变量 DSG_APP_DATA 指定就行。但是无论用环境变量还是用 D_DSG_APP_DATA_FALLBACK 在编译器指定,都有一个前提,那就是发行版或者桌面环境要准备好这个目录,且它符合dtk的需要(不以root身份运行也有权限编辑目标)。
from dtkcore.
app data目录设计的意义是,dtk需要一个专为应用程序提供的目录,无论这个程序以哪个用户身份执行,这个目录都能被它读写。这个目录会被应用程序存放一些与用户无关的内容(也就是多个用户之间共享的内容),但是Linux中肯定没有符合这种要求的目录,所以默认没有提供,回退到 configs-fake-global 只是能保证存储这一类配置项时不至于丢失,但是达不到“多个用户之间共享”这个目的了。
from dtkcore.
“如果找不到全局目录,回退到用户目录下的configs-fake-global,但是也是由于没有权限的问题,创建目录的代码并没有成功执行。”
回退到用户目录下的 configs-fake-global 会失败吗?这个情况是不应该的
也会也需要root权限运行才能成功,不使用root权限,无法从成功创建 configs-fake-global 目录
from dtkcore.
app data目录设计的意义是,dtk需要一个专为应用程序提供的目录,无论这个程序以哪个用户身份执行,这个目录都能被它读写。这个目录会被应用程序存放一些与用户无关的内容(也就是多个用户之间共享的内容),但是Linux中肯定没有符合这种要求的目录,所以默认没有提供,回退到 configs-fake-global 只是能保证存储这一类配置项时不至于丢失,但是达不到“多个用户之间共享”这个目的了。
当然如果是提前准备好该目录,并制定了权限的情况下,不使用root权限也可以正常保存
from dtkcore.
“如果找不到全局目录,回退到用户目录下的configs-fake-global,但是也是由于没有权限的问题,创建目录的代码并没有成功执行。”
回退到用户目录下的 configs-fake-global 会失败吗?这个情况是不应该的也会也需要root权限运行才能成功,不使用root权限,无法从成功创建 configs-fake-global 目录
可以看一下拿到的 applicationCacheDir 是什么
from dtkcore.
使用root情况下成功创建的是root用户的,/root/.config/dsg/configs-fake-global
运行普通用户的时候是在,普通用户目录下的/.config/dsg/configs-fake-global,创建用户缓存的时候是到各自用户目录的/.config/dsg/configs-fake-global下创建
使用了全局缓存的时候是先到/var/dsg/appdata下创建configs目录,当然需要用root权限,否则也是没法创建
from dtkcore.
/var/dsg/appdata 创建失败是可以预料到的,不算是一个意外情况。
from dtkcore.
那这个宏没定义呢,如果没加宏这段代码没被运行,globalCacheDir直接获得空字符串,
from dtkcore.
正常,这个宏在deepin中不应该被定义。globalCacheDir返回一个空字符串的原因是获取到的 appDataDir 为空(在deepin上应该保证这个不为空),DstandardPaths::DSG::AppData 是靠环境变量指定的,系统应该为程序指定正确的环境变量。
from dtkcore.
正常,这个宏在deepin中不应该被定义。globalCacheDir返回一个空字符串的原因是获取到的 appDataDir 为空(在deepin上应该保证这个不为空),DstandardPaths::DSG::AppData 是靠环境变量指定的,系统应该为程序指定正确的环境变量。
好的 明白了
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]
- Doc: [Example documents][dconfigfile.h] HOT 4
- 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.