Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support XDG config #30

Merged
merged 10 commits into from
Aug 15, 2022
Merged

support XDG config #30

merged 10 commits into from
Aug 15, 2022

Conversation

Goodjooy
Copy link
Contributor

@Goodjooy Goodjooy commented Jul 29, 2022

#28

  • 封装 原有路径加载接口
  • 使用 directories 进行本地文件管理
  • 允许特殊设置配置修改默认文件夹位置

@Goodjooy Goodjooy changed the title Xdg config support XDG config Jul 29, 2022
@Goodjooy
Copy link
Contributor Author

我觉得差不多了, @lomirus 你要不要调试一下,我的开发平台不支持XDG

@Goodjooy Goodjooy marked this pull request as ready for review July 30, 2022 03:09
@lomirus
Copy link
Owner

lomirus commented Jul 30, 2022

另外我觉得 resource-loader/src 下面的文件可以参考 xdg 的标准优化一下目录结构结构,现在的 configs/ops, config, local_db, avatar, client, temporary 啥的总感觉有些乱

@Goodjooy
Copy link
Contributor Author

另外我觉得 resource-loader/src 下面的文件可以参考 xdg 的标准优化一下目录结构结构,现在的 configs/ops, config, local_db, avatar, client, temporary 啥的总感觉有些乱

这个可以有,不过临时文件还是继续沿用系统临时文件把?

@Goodjooy Goodjooy marked this pull request as draft July 30, 2022 08:51
@lomirus
Copy link
Owner

lomirus commented Jul 30, 2022

这个可以有,不过临时文件还是继续沿用系统临时文件把?

🉑

@Goodjooy
Copy link
Contributor Author

Goodjooy commented Aug 10, 2022

这个可以有,不过临时文件还是继续沿用系统临时文件把?

🉑

windows 下有和XDG 类似的文件夹规范,主要是 ~/AppData/Local~/AppData/Roaming,参考XDG

  • config 文件路径更改为 ~/AppData/Roaming/.gtk-qq/config.toml
  • data home 路径为 ~/AppData/Local/.gtk-qq/share
  • state home 路径为 ~/AppData/Local/.gtk-qq/state
  • cache home 路径为 ~/AppData/Local/.gtk-qq/cache

resource_root 会将以上文件夹更改为 {resource_root}/XXX

@Goodjooy
Copy link
Contributor Author

https://crates.io/crates/directories
我应该多多网上冲浪的()

@Goodjooy Goodjooy marked this pull request as ready for review August 10, 2022 09:59
@Goodjooy Goodjooy requested a review from lomirus August 12, 2022 07:52
@lomirus
Copy link
Owner

lomirus commented Aug 12, 2022

这几天忙着赶项目,估计得到月末才能 review(

@lomirus lomirus merged commit 989abfe into lomirus:main Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants