Skip to content

Store the settings when the settings dialog is closed - #3996

Draft
ann0see wants to merge 1 commit into
mainfrom
ios/save-settings-on-close
Draft

ann0see wants to merge 1 commit into
mainfrom
ios/save-settings-on-close

Conversation

@ann0see

@ann0see ann0see commented Nov 15, 2026

Copy link
Copy Markdown
Member

Short description of changes

Write the settings when the settings dialog is hidden, so that they are not lost when the application is terminated before it becomes inactive.

CSettings writes the ini file when the application becomes inactive or quits. Anything that ends the process before that — a crash, or the app being killed — discards whatever the user just configured: alias, instrument, audio device, buffer delay, language, MIDI settings.

CClientSettingsDlg::hideEvent() now calls CSettings::Save ( false ). That covers closing the dialog from its menu, unticking the Settings check box, and the hide during shutdown.

CHANGELOG: Client: Fixed settings being lost when the application is closed unexpectedly

Context: Fixes an issue?

Fixes #3994 (second item).

Measured on the iOS simulator with Jamulus.ini:

Step name_base64 before the change after
alias changed, dialog closed still the old value immediately the new value (No NameBgTestPer)
simctl terminate, relaunch change lost change survives

Does this change need documentation? What needs to be documented and how?

No.

Status of this Pull Request

Working implementation.

What is missing until this pull request can be merged?

  • Tested on the iPad Pro 11-inch simulator (iOS 27.2) with Qt 6.11.1, on top of Only compile the iOS app delegate for Qt 5 #3988, because main does not launch on iOS with Qt 6 without it.
  • Verified: closing and reopening the settings dialog twice does not crash, the ini stays valid (72 KB), and no new crash reports appear.
  • The write happens on every dialog close rather than per control change, so it is one ini write per settings session.
  • Not tested on Windows, Linux or macOS. The change is not platform-specific: the same data loss applies to any termination that does not go through the inactive or quit path there too, but the desktop behaviour was not exercised.

🤖 Used AI: DeepSeek V4.1 Flash, OpenCode

Settings are currently only written when the application becomes inactive or
quits (see CSettings). Anything that ends the process before that, for example a
crash or the application being killed, discards the changes the user just made,
including the musician profile, the audio device configuration and the language.

Write them as well when the settings dialog is hidden, which covers closing it
from the menu, from the check box and during shutdown.
@ann0see ann0see added the AI AI generated or potentially AI generated label Nov 15, 2026
@ann0see ann0see mentioned this pull request Nov 15, 2026
6 of 16 tasks
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The client settings dialog now saves settings when it is hidden. It then calls the base-class hide-event handler.

Changes: Client Settings Persistence

Layer / File(s) Summary
Save settings on hide
src/clientsettingsdlg.h, src/clientsettingsdlg.cpp
CClientSettingsDlg declares a hideEvent override. The handler calls pSettings->Save(false) before calling QDialog::hideEvent.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested labels: bug

Suggested reviewers: pljones, softins

Merge Risk: Minimal · up to 9c8e5

Settings are now written to the ini file when the settings dialog is hidden, so recent changes are less likely to be lost if the app terminates early. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: the settings are now stored when the settings dialog closes. The raw summary confirms that CClientSettingsDlg::hideEvent() now calls CSettings::Save(false), so the ti…
Description check Passed The description covers the required template sections. It gives a short description of the change and a CHANGELOG entry. It links the fix to issue #3994, states that no documentation is needed, gives …
Linked Issues check Passed Directly linked issue #3994 has one checked item in scope for this PR: settings changes are lost when the app does not go inactive first. The objective is to persist settings when the settings dialog …
Out of Scope Changes check Passed The change set consists of one hideEvent override declaration in src/clientsettingsdlg.h and one hideEvent body in src/clientsettingsdlg.cpp that calls CSettings::Save(false) (per the supplied summary…
Full details: Title check

Explanation

The title states the main change: the settings are now stored when the settings dialog closes. The raw summary confirms that CClientSettingsDlg::hideEvent() now calls CSettings::Save(false), so the title matches the changeset.

Full details: Description check

Explanation

The description covers the required template sections. It gives a short description of the change and a CHANGELOG entry. It links the fix to issue #3994, states that no documentation is needed, gives the status as a working implementation, and lists what remains before merge. The checklist is not ticked, but the template treats it as a maintainer step. Some items are not in the template, such as the test table and the AI usage note, but they add useful context.

Full details: Linked Issues check

Explanation

Directly linked issue #3994 has one checked item in scope for this PR: settings changes are lost when the app does not go inactive first. The objective is to persist settings when the settings dialog is closed, so later termination does not discard them. The PR adds CClientSettingsDlg::hideEvent(), which calls CSettings::Save(false) before QDialog::hideEvent (src/clientsettingsdlg.cpp, and the override declared in src/clientsettingsdlg.h). The write covers closing the dialog from the menu, unticking the Settings check box, and hiding during shutdown. This matches the issue's measured repro (alias changed, dialog closed, ini updated). Other #3994 items (chat z-order, keyboard layout, Load Mixer Channels, labels, accessibility) are not in this PR's stated scope and are not assessed. Limits: the file diff tool returned no content, so this verdict relies on the supplied AI-generated summary of the diff and the PR description, not on a read of the changed hunk. Settings changed while the dialog stays open and the process is killed before the dialog closes are not saved by this change; the issue's repro does not cover that case.

Full details: Out of Scope Changes check

Explanation

The change set consists of one hideEvent override declaration in src/clientsettingsdlg.h and one hideEvent body in src/clientsettingsdlg.cpp that calls CSettings::Save(false) (per the supplied summary, +9/-0 lines in the .cpp and +1 line in the .h). This directly implements the settings persistence objective of #3994. No unrelated changes were identified in the supplied evidence. The file diff could not be read, so this verdict relies on the supplied summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: fd83ae03-9a96-43a3-9c2c-87ceb011ea1e
Commits

Reviewing files that changed from the base of the PR and between 2442abc and 9c8e59d.

Files selected for processing: 2

  • src/clientsettingsdlg.cpp
  • src/clientsettingsdlg.h

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@ann0see
ann0see marked this pull request as draft November 15, 2026 17:36
@ann0see

ann0see commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

Not 100% sure about this one, might need more investigation.

@ann0see ann0see added the bug Something isn't working label Nov 15, 2026
@github-project-automation github-project-automation Bot moved this to Triage in Tracking Nov 15, 2026
@ann0see ann0see added the iOS iOS runtime issue label Nov 15, 2026
Comment thread src/clientsettingsdlg.cpp

void CClientSettingsDlg::hideEvent ( QHideEvent* event )
{
// store the settings when the dialog is closed, so that they survive the

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
// store the settings when the dialog is closed, so that they survive the
// store the settings when the dialog is hidden, so that they survive the

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

Labels

AI AI generated or potentially AI generated bug Something isn't working iOS iOS runtime issue

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

AI bug findings for iOS

1 participant