forked from Mudlet/Mudlet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
/claim Mudlet#888 #### Brief overview of PR changes/additions This PR: - refactors Mudlet initialisation code to use a single source of truth for config directory paths - change QSettings storage to an `IniFormat` file in the config directory and adds migration code from old formats - adds support for a `<executable_dir>/portable.txt` marker which sets the config directory to `<executable_dir>/portable` #### Motivation for adding to Mudlet This PR teaches Mudlet to store data portably. #### Usage Instructions If you're interested in trying out this PR, you can download the CI builds from the **add-deployment-links** bot below. There are currently two ways to enable portable mode for Mudlet (in order of importance): - You can create an empty `portable.txt` file in the same folder as the Mudlet executable (or appimage etc.) - This will tell Mudlet to use a folder named `portable` (in the same folder as the executable) for its data - You can create an `~/.config/mudlet/portable.txt` file with its contents being a path on your filesystem - This will tell Mudlet to use the path written in the file as the folder for its data - e.g. the contents could be `/mount/media/flashdrive/mudlet_data` or `D:\games\portable\mudlet_data` - The path can be relative, in which case it will be interpreted relative to the Mudlet executable's folder - Mudlet will create _exactly_ one folder, that is, the last part of the given path, if it doesn't exist already. At least everything up to its parent folder must exist already or it will lead to an error. - e.g. if given `D:\games\portable\mudlet_data`, at least `D:\games\portable` must be an existing folder - This is to avoid taking unintended input. If you see this error but this actually is what you want, just create those folders manually Any errors will result in the issue being printed to stderr and the program terminating. You probably won't see the error outputs if launched from GUI so it's recommended to start Mudlet from the terminal. Ofc when you first launch Mudlet in portable mode, it will start with a new clean config in the respective folder, just like a new install. If you wish to migrate your existing config data to be portable: - You need to launch this build at least once (without any `portable.txt`) - This is because it needs to migrate config files from the old format to the new, portable-friendly one - Then you can just copy/move your default data directory `~/.config/mudlet` to wherever you want and use one of the above `portable.txt`s to point Mudlet to that path.
- Loading branch information
1 parent
10fedaf
commit d8cd226
Showing
6 changed files
with
155 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.