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

UI: Fix missing support for portable configuration files #11300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PatTheMav
Copy link
Member

Description

Fixes broken support for portable mode on Linux and Windows.

Motivation and Context

Windows and Linux allow the storage of configuration files relative to the binary location, which is enabled by default on Windows and has to be explicitly enabled on Linux.

This was originally conflated with the LINUX_PORTABLE build setting which also allowed the application itself to be run from non-default locations on a Linux system.

This change reintroduces the functionality behind the ENABLE_PORTABLE_CONFIG build setting on Linux.

It also adds necessary code to make this setting compatible with the recently introduced relocatable settings code changes:

When portable mode is enabled, user configuration, scene collections, and profiles are stored in the config directory created for portable mode.

How Has This Been Tested?

Tested on Windows 11 with portable mode enabled and disabled and observed configuration files being created in different respective locations.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@PatTheMav PatTheMav added Bug Fix Non-breaking change which fixes an issue Windows Affects Windows Linux Affects Linux labels Sep 18, 2024
@PatTheMav PatTheMav force-pushed the portable-config-fix branch 2 times, most recently from 9e58c78 to 5ade18d Compare September 18, 2024 21:23
Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

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

Looks okay at a glance.

@RytoEX RytoEX self-assigned this Sep 19, 2024
@RytoEX RytoEX requested a review from Lain-B September 19, 2024 00:09
UI/cmake/os-linux.cmake Outdated Show resolved Hide resolved
Windows and Linux allow the storage of configuration files relative
to the binary location, which is enabled by default on Windows and has
to be explicitly enabled on Linux.

This was originally conflated with the LINUX_PORTABLE build setting
which also allowed the application itself to be run from non-default
locations on a Linux system.

This change reintroduces the functionality behind the
ENABLE_PORTABLE_CONFIG build setting on Linux.

It also adds necessary code to make this setting compatible with the
recently introduced relocatable settings code changes:

When portable mode is enabled, user configuration, scene collections,
and profiles are stored in the config directory created for portable
mode.
@Lain-B
Copy link
Collaborator

Lain-B commented Sep 20, 2024

Shouldn't this be on by default on Windows? Or does Windows always have this on?

@PatTheMav
Copy link
Member Author

Shouldn't this be on by default on Windows? Or does Windows always have this on?

Correct, it’s always enabled on Windows. The explicit build flag is only needed if _WIN32 is not set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue Linux Affects Linux Windows Affects Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants