Skip to content

fix: restrict folder dialog to file:// URLs (#1631)#2476

Open
OsamaGharibElwaly wants to merge 1 commit intoborgbase:masterfrom
OsamaGharibElwaly:fix/file-dialog-supported-schemes-1631
Open

fix: restrict folder dialog to file:// URLs (#1631)#2476
OsamaGharibElwaly wants to merge 1 commit intoborgbase:masterfrom
OsamaGharibElwaly:fix/file-dialog-supported-schemes-1631

Conversation

@OsamaGharibElwaly
Copy link
Copy Markdown

Summary

Sets \QFileDialog.setSupportedSchemes(['file'])\ in \choose_file_dialog()\ so the add-repo, mount, and extract folder pickers do not offer unsupported schemes (e.g. \smb://, \sftp://) that can freeze or misbehave on some platforms.

Testing

  • \pytest tests/unit/test_utils.py::test_choose_file_dialog_sets_file_scheme_only\

Related to #1631

Sets QFileDialog supportedSchemes to file only for choose_file_dialog (add repo, mount, extract). Adds unit test.

Made-with: Cursor
Copy link
Copy Markdown
Contributor

@m3nu m3nu left a comment

Choose a reason for hiding this comment

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

Minimal, correct fix for #1631. QFileDialog.setSupportedSchemes(['file']) is the documented Qt mechanism and all Vorta file dialogs only need local filesystem access.

  • Placement after setOption(ShowDirsOnly) is fine -- order doesn't matter for these independent properties
  • Applied unconditionally to both folder and file pickers, which is correct
  • Test verifies setSupportedSchemes is called with the right argument

No issues found. Ready to merge once CI passes.

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.

2 participants