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

Default database directory location #272

Closed
mikfire opened this issue Jun 3, 2016 · 1 comment
Closed

Default database directory location #272

mikfire opened this issue Jun 3, 2016 · 1 comment

Comments

@mikfire
Copy link
Contributor

mikfire commented Jun 3, 2016

If you start from a brand new configuration, we create ~/.config/brewtarget with all the right defaults, including user_data_dir set as an empty string.

On the next run of brewtarget, that empty string is taken as meaning cwd and you get a completely different database.

I kind of dig it as a developer, because I get the database.sqlite file in my build directory, which makes rapid prototyping rapid. But I'm thinking it may surprise somebody.

@mikfire
Copy link
Contributor Author

mikfire commented Jun 3, 2016

Oh. That's fun.

When starting from scratch, Brewtarget::initialize() calls Brewtarget::getConfigDir() which creates a QDir with a path of ~/.config/brewtarget. At this point, the path doesn't exist because we haven't created it. canonicalPath() returns an empty string, which causes user_data_dir to be saved as an empty string. Things go weirdly after that.

@mikfire mikfire closed this as completed in ca49d68 Jun 8, 2016
mikfire added a commit that referenced this issue Jun 8, 2016
Closes #272 -- Default database directory location
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

No branches or pull requests

1 participant