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

Fix: Incorrect directory path if tool is installed by package #119

Merged
merged 2 commits into from
Oct 20, 2023

Conversation

tetektoza
Copy link
Contributor

Currently, if we install d1-graphics-tool with a .deb package, it will try to resolve the path to save a .json file to /usr/bin, since currently we save the configuration file wherever the binary is. User doesn't have an access to write to /usr/bin/ directly and this ends up with a problem in reading/writing to a config, resetting the config everytime app is being used.

This patch changes it, and leaves the configuration for the file to be saved in:

  • Windows: AppData/.config/diasurgical/d1-graphics-tool/ directory path
  • Otherwise: /home/user/.config/diasurgical/d1-graphics-tool/ directory path

Also added missing documentation for config.cpp.

@tetektoza tetektoza marked this pull request as draft October 20, 2023 15:00
source/config.cpp Outdated Show resolved Hide resolved
source/config.cpp Outdated Show resolved Hide resolved
source/config.cpp Outdated Show resolved Hide resolved
Currently, if we install d1-graphics-tool with a .deb package, it will try
to resolve the path to save a .json file to /usr/bin, since currently we
save the configuration file wherever the binary is. User doesn't have an
access to write to /usr/bin/ directly and this ends up with a problem in
reading/writing to a config, resetting the config everytime app is being
used.

This patch changes it, and leaves the configuration for the file to be
saved in:

Windows: AppData/.config/diasurgical/d1-graphics-tool/ directory path
Otherwise: /home/user/.config/diasurgical/d1-graphics-tool/ directory
path
Adds documentation to config.cpp, for functions that were missing it and
also for newly added createDirectoriesOnPath().
@AJenbo AJenbo marked this pull request as ready for review October 20, 2023 15:55
@AJenbo AJenbo merged commit e4127fd into diasurgical:master Oct 20, 2023
5 checks passed
@tetektoza tetektoza deleted the fix_config_location_mismatch branch October 20, 2023 21:29
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.

2 participants