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

inventory: use standard AppDataLocation for model files #142

Merged
merged 5 commits into from
Sep 14, 2023

Conversation

pacien
Copy link
Contributor

@pacien pacien commented Aug 24, 2023

inventory: use standard AppDataLocation for model files

This puts the models in $XDG_DATA_DIR/translateLocally on Linux,
or equivalent user data directories on other platforms.

This avoids putting relatively large files in the config directory,
which may be versioned for user dotfiles.

Github: closes #139

@jelmervdl
Copy link
Collaborator

I like this, a lot!

One thing that's unclear to me is what happens with the models people have already downloaded?

Will they still show up? (The scanning code seems to purely be an addition, so yes?)

Or should they be moved on first run? (Sounds tricky to make fault tolerant)

Copy link
Owner

@XapaJIaMnu XapaJIaMnu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should try to move anything, that could potentially get tricky. Scanning one additional directory for models on startup is not a big deal.

@pacien
Copy link
Contributor Author

pacien commented Aug 25, 2023 via email

@XapaJIaMnu
Copy link
Owner

Yes, please add scanning the config dir as well. I think it was here.

scanForModels(QDir::current().path()); // Scan the current directory for models. @TODO archives found in this folder would not be used

@pacien
Copy link
Contributor Author

pacien commented Aug 25, 2023 via email

Because we're putting app data in it in this class.
This puts the models in $XDG_DATA_DIR/translateLocally on Linux,
or equivalent user data directories on other platforms.

This avoids putting relatively large files in the config directory,
which may be versioned for user dotfiles.

Github: closes XapaJIaMnu#139
@pacien
Copy link
Contributor Author

pacien commented Aug 29, 2023

I added a commit which moves the model directories and tarballs from the config
directory to the new app data directory. This should work fine in most cases.
If the move operation fails (silently), the models are still listed because
the config directory is still scanned.

I'll let you decide whteher to pick this latest commit or not.

@XapaJIaMnu
Copy link
Owner

@pacien sorry for the late reply. It seems the automatic builds fail. QT5 vs QT6 issue?

@pacien
Copy link
Contributor Author

pacien commented Sep 7, 2023 via email

@XapaJIaMnu
Copy link
Owner

XapaJIaMnu commented Sep 7, 2023

Hmm, the windows build is suddenly broken. I need to investigate to see if something changed in the github runner or inadvertently this broke something (Last week it was passing).

The Mac runner had some brew changes that happened that I need to fix as well...

Putting on hold until then.

@XapaJIaMnu XapaJIaMnu merged commit cbe407f into XapaJIaMnu:master Sep 14, 2023
7 of 13 checks passed
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.

Model directory path
3 participants