Skip to content

Fix crash when opening the direct file picker - #10

Open
jpmartins98 wants to merge 1 commit into
sachk:mainfrom
jpmartins98:fix-open-file-dialog-crash
Open

Fix crash when opening the direct file picker#10
jpmartins98 wants to merge 1 commit into
sachk:mainfrom
jpmartins98:fix-open-file-dialog-crash

Conversation

@jpmartins98

@jpmartins98 jpmartins98 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix a user-facing crash triggered by clicking Open File Directly on the landing page.

Problem and root cause

LandingPage._open_file_dialog() calls QFileDialog.getOpenFileNames(), but QFileDialog is not imported by landing_page.py. The first click therefore raises NameError before the native file picker can be displayed. This is platform-independent and affects Windows, Linux, and macOS.

Changes

  • Import QFileDialog from PySide6.QtWidgets.
  • Add a regression test that invokes the direct file workflow with a mocked dialog.
  • Verify that cancelling the dialog returns normally without emitting a selection or crashing.

Why this PR is needed

Opening individual Smart Switch files is a primary workflow for .data, .penc, .apk, .bk, .smem, contacts, and call-log files. The workflow is currently unusable whenever this missing symbol is reached. The fix is deliberately isolated from the other UI and build changes.

Compatibility and risk

This does not change file parsing, extraction, dialog filters, or public APIs. It only restores the missing Qt import and adds regression coverage.

Validation

  • uv run pytest -q tests/test_file_dialogs.py: 4 passed.
  • Combined validation with all proposed PRs: 118 passed, 2 skipped.
  • No merge conflicts with the other proposed branches.

AI disclosure

This PR and all changes introduced by it, including implementation, tests, and this description, were generated by OpenAI Codex under the user's direction. The resulting changes were reviewed through source inspection and the validation described above

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