On some platforms (e.g. KDE) accelerators are automatically added to
the text properties of QActions, thus changing the value returned by
text().
Thus we cannot rely on the text to always represent the same text that
we set originally and have to explicitly store and retrieve the value
as a property.
Coincidentally this not only fixes possible issues on other platforms,
but is also architecturally more correct.
The old method to update the profile menu iterated over the directory
entries of the profile directory in the order provided by the operating
system.
The system calls used for this explicitly state that the order of items
is "undefined" but seems to have followed a case-insensitive
alphabetical order on Windows, an order which users have come to expect.
The new code uses a std::map to store discovered profiles and scene
collections, which is ordered by key and with std::string used for keys
this means a lexicographical sorting of keys which is case-sensitive.
To restore the old behavior, profiles and scene collections need to be
added to their respective menus sorted by case-insensitive order, which
has to be done manually before adding the items.
That is, leave only the code that was under USE_XDG. Previously the
Linux CMake build defined USE_XDG unconditionally, while it was not set
by the FreeBSD build.
The non-USE_XDG code was broken, and FreeBSD should follow the XDG
convention anyway (in particular, storing config files typically under
$HOME/.config/obs-studio). Defining USE_XDG in the os-freebsd.cmake
files would leave the non-USE_XDG code unused anywhere, so instead just
remove it.
Clang 19 has become more strict about mixing different enum types, which
resulted in an error building multimedia/obs-studio on FreeBSD:
/wrkdirs/usr/ports/multimedia/obs-studio/work/obs-studio-30.2.3/plugins
/obs-outputs/flv-mux.c:659:37: error: bitwise operation between
different enumeration types ('enum multitrack_type_t' and 'enum
packet_type_t') [-Werror,-Wenum-enum-conversion]
During development on FreeBSD I encountered an uncaught exception abort
from the copy in MigrateGlobalSettings. Catch the error and print a
user-facing message:
error: Unable to migrate global configuration - copy failed.
SetupNewProfile is used to create new profiles when OBS is already
running, which requires resetting program state for the new profile.
This function cannot be used to create a new profile as a fallback
for either a non-existing profile or for a fresh installation of OBS
Studio because by the point this is called from OBSBasic::OBSInit, the
runtime modules are not loaded yet and as such no services exist.
Activating the new profile without a profile reset fixes this issue
as the reset will be done explicitly by OBSBasic::OBSInit later.
cb026964b0 changed most instances of
MuteCheckBox as a selector for the button that mutes/unmutes a source in
the mixer to indicator-mute, but left a few instances of the old
selector, especially in variant themes while the base theme got changed.
This lead to competing selections where apparently indicator-mute won
which meant that the variant themes wouldn't override the base.
Changing all instances of MuteCheckBox to to indicator-mute fixes this
and hopefully prevents future uses of MuteCheckBox as a selector
anywhere.
When a starting scene collection or profile is provided, current code
would crash as the corresponding collections and management functions
do not exist yet (they are tied to OBSBasic, which is not initialized
that early in the program execution).
This change moves the checks for command line arguments into OBSBasic
into the parts responsible for initializing profiles and scene
collections and check for arguments provided via command line there.
When a scene collection is deleted, the generated backup files should
not automatically be deleted. This was new behavior introduced in OBS
30.0.0.
This change restores the prior behavior.
After a profile or scene collection is deleted, the last item in each
list would have been automatically activated as the new current profile
or scene collection.
This is opposite to prior behavior, which would always select the first
item in the list.
This code restores the prior behavior.
As outlined in c5965c8605, bmalloc(0) is
pretty much always a mistake, possibly hiding other bugs.
It's been two years since that commit introduced a warning announcing
that this will crash in a future version of OBS, let's make that happen.