Skip to content

Fix log view sort order reset after using settings dialog. Fixes issue #988#989

Open
barjac wants to merge 1 commit intoea4k:masterfrom
barjac:bcj-log-order
Open

Fix log view sort order reset after using settings dialog. Fixes issue #988#989
barjac wants to merge 1 commit intoea4k:masterfrom
barjac:bcj-log-order

Conversation

@barjac
Copy link
Copy Markdown

@barjac barjac commented Apr 15, 2026

LogModel::setColumns() always resets the model's ORDER BY to "id ASC" (line 228 of logmodel.cpp). This is called via logWindow->setColumns() from loadSettings() every time the settings dialog is shown. If the selected log did not change, createlogPanel() is skipped on dialog close, so the sort is never restored to the user-visible sort order. The next refresh() then runs select() with the wrong ORDER BY, placing newly saved QSOs at the bottom instead of the top.

Fix: re-apply the view header's sort indicator to the model at the start of refresh(), before calling select(). The header indicator is not touched by setColumns(), so it always reflects the correct order.

LogModel::setColumns() always resets the model's ORDER BY to "id ASC"
(line 228 of logmodel.cpp).  This is called via logWindow->setColumns()
from loadSettings() every time the settings dialog is shown.  If the
selected log did not change, createlogPanel() is skipped on dialog
close, so the sort is never restored to the user-visible sort order.
The next refresh() then runs select() with the wrong ORDER BY, placing
newly saved QSOs at the bottom instead of the top.

Fix: re-apply the view header's sort indicator to the model at the
start of refresh(), before calling select().  The header indicator is
not touched by setColumns(), so it always reflects the correct order.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant