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

User data dir #85

Closed
wants to merge 12 commits into from
Closed

Conversation

lheckemann
Copy link
Contributor

Discussed to some extent in #79 as well.

The key functionality-introducing commit here is ef15650. Pasting its description here for ease of reading:

Move all direct user directory access to files.cpp

  • Add the openUserFile function, analogous to openDataFile, which opens
    files containing user data, i.e. config, saves and scores.
  • Make the default location for user files $XDG_CONFIG_HOME/barony or
    $HOME/.config/barony if those variables are found. This should
    probably be replaced with behaviour more suitable for OSX
    ($HOME/Library/Application Support/barony?) and windows
    (%APPDATA%/barony?)
  • Add -userdir= option which allows overriding the aforementioned
    behaviour
  • Add setUserDir and setDataDir to the files module, so the knowledge of
    the static storage for these paths can be limited to files.cpp.
    Correspondingly,
  • Remove public datadir variable

In addition, this:

  • Restores the datadir functionality
  • Splits a bit of functionality out of main.hpp into relevant modules' headers, which improves partial compile times

lheckemann added 12 commits May 19, 2017 12:32
cppfuncs.hpp:getLinesFromFile → files.cpp:getLinesFromDataFile

Also rewrite most of its implementation to provide useful errors
when the file cannot be opened.
- Add the openUserFile function, analogous to openDataFile, which opens
  files containing user data, i.e. config, saves and scores.
- Make the default location for user files $XDG_CONFIG_HOME/barony or
  $HOME/.config/barony if those variables are found. This should
  probably be replaced with behaviour more suitable for OSX
  ($HOME/Library/Application Support/barony?) and windows
  (%APPDATA%/barony?)
- Add -userdir= option which allows overriding the aforementioned
  behaviour
- Add setUserDir and setDataDir to the files module, so the knowledge of
  the static storage for these paths can be limited to files.cpp.
  Correspondingly,
- Remove public datadir variable
This was referenced Jun 13, 2017
@lheckemann lheckemann closed this Dec 29, 2017
addictgamer pushed a commit that referenced this pull request May 10, 2018
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.

1 participant