Renaming a collapsed preset or configuration group lost its collapsed
state and left a stale entry under the old name. Deleting a group left a
stale entry too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Device Set Presets and Configurations dialogs expanded every group each
time they were opened. With many groups, finding a preset means scrolling
through the whole list.
Remember which groups the user collapses (QSettings keys
presets.collapsed_groups and configurations.collapsed_groups, same mechanism
as graphics.ui_scale_factor) and restore that state when the dialogs are
reopened. The initially selected item is now picked from expanded groups
only, so the selection does not re-expand a collapsed group.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setValue() formatted the new text before clamping the value, so a value
above the maximum produced a text with more digits than the dial and the
dial ended up showing the unclamped value. Format the clamped value
instead.
The current and new texts can still differ in length while animating,
for example when setValueRange() changes the number of digits, so only
compare characters that exist in the new text.
Fixes#2997
Explicitly delete the copy constructor and copy assignment operator for
TVScreenAnalogBuffer to prevent accidental duplication of its buffer.
The destructor deletes m_outOfBoundsLine with delete[]. A shallow copy
would cause multiple instances to own the same array, potentially
resulting in double deletion and memory corruption.
Since TVScreenAnalogBuffer manages this buffer directly, prohibit copying
and assignment at compile time.
cppcheck identified the missing copy constructor and assignment operator
with its noCopyConstructor and noOperatorEq warnings.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize devicePixelRatio to avoid a GCC 14.2 -Wmaybe-uninitialized
warning when the window handle is unavailable.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Normalize existing text files to LF to conform to the repository-wide
line-ending policy defined by .gitattributes by:
git add --renormalize .
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Assign descriptive names to SDRangel threads so thread activity can be
identified when investigating multi-threaded behavior, including crashes,
leaks, and synchronization issues in debuggers and others tools.
Use compact names to fit platform thread-name limits (14 chars) while
retaining the component and thread role where possible.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
MessageQueue::pop() transfers ownership of the popped message to the
caller, but many handleInputMessages() implementations only deleted
the message when handleMessage() returned true. When a message was not
handled, ownership had already been transferred from the queue and the
message was leaked.
This was identified while investigating an ASAN leak in the audio
subsystem.
Update the applicable handleInputMessages() implementations to always
delete messages after handleMessage() returns. Unhandled messages are
also logged with the component and message identifier so unexpected
message routing is visible during debugging.
This change:
- Ensures every message popped from a queue has its ownership resolved.
- Prevents leaks when handleMessage() returns false.
- Makes unhandled messages visible instead of silently discarding them.
- Preserves the existing message handling logic and does not require
components to handle message types that are legitimately irrelevant
to them.
The changes are intentionally mechanical and limited to the common
message queue ownership and diagnostic pattern.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
ConfigurationsDialog calls on_configurationLoad_clicked() from both
on_configurationsTree_itemActivated() (double-click or Enter) and accept()
(the OK button), so a double-click followed by OK - or simply a second click on
Load while the first is still running - starts a second LoadConfigurationFSM.
MainWindow::loadConfiguration() had no guard, so the two ran concurrently: the
second FSM's RemoveAllWorkspacesFSM deletes the workspaces, device sets and GUI
widgets the first FSM is still walking, and the first then dereferences freed
objects.
This is easy to hit on first run, where SDRangel populates the bundled example
configurations and opens the Configurations dialog by itself.
The crash site varies with timing and with which configuration is loaded;
QProgressDialog::setLabelText() from LoadConfigurationFSM::loadDeviceSetSettings()
and the Map feature's QQuickWidget have both been observed. Driving the dialog
with two loads reproduced it 3/3; a single load did not crash in 2/2.
Refuse a load while one is in flight. The in-flight FSM is tracked through a
QPointer so an FSM destroyed without finishing cannot wedge configuration
loading permanently.
LoadConfigurationFSM::m_waitBox becomes a QPointer for the same reason: the
progress dialog is created with WA_DeleteOnClose and the FSM outlives it, so the
existing "if (m_waitBox)" checks in the state handlers were testing a pointer
that could already dangle.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add a world icon button to the position dialog that opens
mapquest.com in the default browser. This makes users aware that
latitude, longitude can be obtained from standard web sites when
a GPS or other positioning device is not available, without
requiring them to search for a way to obtain the information.
This provides an (in)direct path to the values needed by SDRangel.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Removing a channel's sink or source from a device engine was a queued
message, so a channel could be deleted while the engine thread was
still feeding it. When the caller is deleting, the removal now runs on
the engine thread and is waited for, provided that thread is running
and is not the caller. The MIMO engine gains the same deleting flag and
does the same for its MIMO channels.
ScopeVis and GLScope now attach and detach under the vis mutex and each
clears the other on destruction, as SpectrumVis and GLSpectrum already
do, so a scope window closing while its channel is still running no
longer leaves a dangling pointer on either side.
Also drops an unused variable in GLSpectrumView::paintGL.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
GET .../spectrum/history reads the history the spectrum display keeps
for scrolling and reports, over the last seconds and a frequency range
reduced to bins, the per bin maximum, mean and occupancy against a
floor taken as the median of the per bin means, and the signals: each
run of bins above the threshold with its frequency, width, peak, duty
cycle and first and last seen. GET .../spectrum/history/image renders
the same history as a greyscale PNG with its extents in headers.
GLSpectrumInterface gains getSpectrumHistory, which GLSpectrumView
answers from its scroll buffer under its mutex, folding consecutive
rows together by maximum so that at most the rows asked for span the
whole period, since every FFT is a row. Rows taken at another centre or
rate are skipped and counted.
SpectrumVis reads the display while holding its mutex, so the display
is now attached and detached under it, and each side clears the other
on destruction.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>