Skip to content

Return extension from file dialog and use it on file save - #199

Merged
kryksyh merged 1 commit into
musescore:mainfrom
embarc-gabriel:fix-file-picker-on-linux
Aug 11, 2026
Merged

Return extension from file dialog and use it on file save#199
kryksyh merged 1 commit into
musescore:mainfrom
embarc-gabriel:fix-file-picker-on-linux

Conversation

@embarc-gabriel

Copy link
Copy Markdown
Contributor

Resolves: audacity/audacity#8166

Linux file picker on save does not add the selected extension to the filename.
This PR returns the extension from the dialog and append it to the filename.

  • I signed the CLA as username:
  • The title of the PR describes the problem it addresses.
  • Each commit's message describes its purpose and effects, and references the issue it resolves. If changes are extensive, there is a sequence of easily reviewable commits.
  • The code in the PR follows the coding rules.
  • I understand all aspects of the code I'm contributing and I'm able to explain it if requested.
  • The code compiles and runs on my machine, preferably after each commit individually. I have manually tested and verified that my changes fulfil their intended purpose.
  • No prior attempts to resolve this problem exist, or if they do, I listed them in my PR description and described how I avoided repeating past mistakes.
  • There are no unnecessary changes.
  • I created a unit test or vtest to verify the changes I made (if applicable).

Build configuration

audacity: audacity/audacity/master
audacity platforms: linux_x64
musescore: musescore/MuseScore/main
musescore platforms: linux_x64

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e61cc9a0-b668-400e-a07b-5aab0edf0b46

📥 Commits

Reviewing files that changed from the base of the PR and between d8bdcad and b821d67.

📒 Files selected for processing (1)
  • framework/interactive/qml/Muse/Interactive/FileDialog.qml

📝 Walkthrough

Walkthrough

The QML file dialog resets the selected name-filter index before opening. It adds an allFilesExtension property and an appendSuffixIfNeeded(filePath) helper. The helper appends the first selected filter extension unless the extension is empty, wildcard, or already present. Save-file acceptance uses the helper. Other acceptance modes retain their existing behavior.

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The changes handle save-file suffixes but do not show that native import filters expose .txt preset files as required by issue #8166. Update the import name filter to include .txt preset files, or link this PR to the issue that tracks save-extension behavior.
Out of Scope Changes check ⚠️ Warning Save-file suffix handling is separate from issue #8166, which concerns visibility of .txt presets in the native import picker. Remove the unrelated save-path changes or provide evidence that they also implement the issue's import-filter requirement.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes returning and applying the selected file extension during saving.
Description check ✅ Passed The description explains the problem, proposed fix, issue link, checklist status, and build configuration; the missing test is non-critical.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@framework/interactive/qml/Muse/Interactive/FileDialog.qml`:
- Around line 51-58: Update the extension lookup in the return construction to
index root.selectedNameFilter.extensions from zero, using the first extension
(or the contractually required representation of all alternatives) instead of
selectedNameFilter.index. Preserve the existing empty-string fallback and path
handling.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1db4a5a0-f431-4f69-8689-f60bb48fc5f6

📥 Commits

Reviewing files that changed from the base of the PR and between d9878b9 and cdef143.

📒 Files selected for processing (2)
  • framework/interactive/internal/interactive.cpp
  • framework/interactive/qml/Muse/Interactive/FileDialog.qml

Comment thread framework/interactive/qml/Muse/Interactive/FileDialog.qml Outdated
Comment thread framework/interactive/internal/interactive.cpp Outdated
@embarc-gabriel
embarc-gabriel force-pushed the fix-file-picker-on-linux branch from 373fa1b to d8bdcad Compare August 6, 2026 12:33
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@framework/interactive/qml/Muse/Interactive/FileDialog.qml`:
- Around line 42-50: Update appendSuffixIfNeeded to check filePath against every
entry in root.selectedNameFilter.extensions, returning it unchanged when it
already ends with any valid suffix; only append the first non-special extension
when no listed suffix matches, while preserving the existing empty and all-files
behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3333aff1-cdc8-43ab-bd3b-acca41df6164

📥 Commits

Reviewing files that changed from the base of the PR and between bb220c0 and d8bdcad.

📒 Files selected for processing (1)
  • framework/interactive/qml/Muse/Interactive/FileDialog.qml

Comment thread framework/interactive/qml/Muse/Interactive/FileDialog.qml
@embarc-gabriel
embarc-gabriel force-pushed the fix-file-picker-on-linux branch 2 times, most recently from 6d70b1d to eb6dddd Compare August 6, 2026 12:50
@kryksyh
kryksyh force-pushed the fix-file-picker-on-linux branch from eb6dddd to b821d67 Compare August 11, 2026 12:09
@kryksyh
kryksyh merged commit d605d80 into musescore:main Aug 11, 2026
2 of 3 checks passed
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.

Native Ubuntu File Picker Does Not Show Exported Presets

3 participants