Repository navigation
Conversation
The revision 4 profile conversion added in EdgeTX#7623 validated each profile's language with getCurrentFirmware(), but settings are converted in g.init() and when importing previous-version settings on first launch, both before any firmware is registered. The current firmware is still null there, so Companion and the standalone simulator segfault on startup for anyone with profiles in revision 3 (or 2.12) settings. Drop the firmware lookup: the profile settings already fall back to a supported language. Only fill in a missing language, and never overwrite one already split out by an earlier conversion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a startup segfault in Companion and the standalone simulator. It hits anyone upgrading from settings revision 3 or lower who has at least one radio profile. That includes every 2.12 user who has profiles, on their first 3.0 launch, because the automatic settings import runs the same conversion.
Cause
EdgeTX#7623 added a revision 4 conversion that splits each profile's
fwTypeinto type, options and language. It checked the language withgetCurrentFirmware()->getFirmwareBase()->languageList().Settings are converted in
g.init()and inimportSettings(). Both run inmain()beforeregisterOpenTxFirmwares()andFirmware::setCurrentVariant(), soFirmware::currentVariantis stillnullptrat that point.The check also had two other problems, even when a firmware was available:
QLocale::languageToString()returns a name like "English", not a code, so the locale fallback could never match.Fix
prefs_profile.cppalready falls back to a supported language when the stored one is not in the profile's firmware list.GeneralSettingsfalls back toenwhen the language is empty.enonly when a profile has no language at all.CPN_SETTINGS_REVISION, so it will run again on already-converted settings the next time the revision is bumped.Testing
Linux native build in the container, run offscreen against hand-written settings files:
edgetx-tx16s-heli-ppmus-frbecomes typeedgetx-tx16s, optionsheli-ppmus, languagefr.edgetx-x9dbecomesedgetx-x9d, languageen. The version is stamped v3.0.0.4._importsettings are cleaned up.fr/enlanguages are kept.🤖 Generated with Claude Code