Append default suffix when saving/exporting with a single filter - #139
Append default suffix when saving/exporting with a single filter#139denisfalqueto wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 57 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change modifies the Linux implementation of the internal 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…ainst file dialog quirks Two independent fixes for PDF export failing/crashing on Linux: - src/app/main.cpp: only force QT_QPA_PLATFORMTHEME=gtk3 when the user hasn't already set it. gtk3 was forced unconditionally to fix keyboard input in the legacy Qt file dialog (musescore#13113), but this also silently overrode any theme the user configured (e.g. "xdgdesktopportal" for proper portal/sandboxed dialog support), which is a likely contributor to file dialogs not respecting the user's desktop environment. The default (gtk3) is unchanged for users who don't set this variable, so musescore#13113 is not reintroduced. QT_QPA_PLATFORM=xcb is left untouched, since it fixes unrelated Wayland issues (VST crashes musescore#28446, panel docking musescore#28352). - src/project/internal/exportprojectscenario.cpp: after the file dialog returns a save path, force the expected export suffix if the path doesn't already have one of the format's known suffixes. On some Linux native/portal dialogs the extension isn't auto-appended when the user doesn't type one, which previously left exportScores() unable to find a writer for the path, causing the export to silently fail. A companion fix in muse_framework (musescore/muse_framework#139) makes the underlying file dialog request a default suffix directly, which addresses the same root cause at the source for the single-format case; this commit adds a safety net that's independent of dialog backend. Resolves: musescore#33341 Resolves: musescore#33559
7ef638f to
6ac4402
Compare
…ainst file dialog quirks Two independent fixes for PDF export failing/crashing on Linux: - src/app/main.cpp: only force QT_QPA_PLATFORMTHEME=gtk3 when the user hasn't already set it. gtk3 was forced unconditionally to fix keyboard input in the legacy Qt file dialog (musescore#13113), but this also silently overrode any theme the user configured (e.g. "xdgdesktopportal" for proper portal/sandboxed dialog support), which is a likely contributor to file dialogs not respecting the user's desktop environment. The default (gtk3) is unchanged for users who don't set this variable, so musescore#13113 is not reintroduced. QT_QPA_PLATFORM=xcb is left untouched, since it fixes unrelated Wayland issues (VST crashes musescore#28446, panel docking musescore#28352). - src/project/internal/exportprojectscenario.cpp: after the file dialog returns a save path, force the expected export suffix if the path doesn't already have one of the format's known suffixes. On some Linux native/portal dialogs the extension isn't auto-appended when the user doesn't type one, which previously left exportScores() unable to find a writer for the path, causing the export to silently fail. A companion fix in muse_framework (musescore/muse_framework#139) makes the underlying file dialog request a default suffix directly, which addresses the same root cause at the source for the single-format case; this commit adds a safety net that's independent of dialog backend. Resolves: musescore#33341 Resolves: musescore#33559
…ainst file dialog quirks Two independent fixes for PDF export failing/crashing on Linux: - src/app/main.cpp: only force QT_QPA_PLATFORMTHEME=gtk3 when the user hasn't already set it. gtk3 was forced unconditionally to fix keyboard input in the legacy Qt file dialog (musescore#13113), but this also silently overrode any theme the user configured (e.g. "xdgdesktopportal" for proper portal/sandboxed dialog support), which is a likely contributor to file dialogs not respecting the user's desktop environment. The default (gtk3) is unchanged for users who don't set this variable, so musescore#13113 is not reintroduced. QT_QPA_PLATFORM=xcb is left untouched, since it fixes unrelated Wayland issues (VST crashes musescore#28446, panel docking musescore#28352). - src/project/internal/exportprojectscenario.cpp: after the file dialog returns a save path, force the expected export suffix if the path doesn't already have one of the format's known suffixes. On some Linux native/portal dialogs the extension isn't auto-appended when the user doesn't type one, which previously left exportScores() unable to find a writer for the path, causing the export to silently fail. A companion fix in muse_framework (musescore/muse_framework#139) makes the underlying file dialog request a default suffix directly, which addresses the same root cause at the source for the single-format case; this commit adds a safety net that's independent of dialog backend. Resolves: musescore#33341 Resolves: musescore#33559
…le filter Some Linux native/portal file dialogs don't auto-append the file extension when the user doesn't type one. When the caller offers a single filter (e.g. exporting to PDF), request a defaultSuffix from the dialog so the returned path always has the expected extension. This is skipped when more than one filter is offered (e.g. "Save As" with the experimental uncompressed-folder option), since a single global default suffix would be applied regardless of which filter the user actually picked. Resolves: musescore/MuseScore#33559 Resolves: musescore/MuseScore#33341
6ac4402 to
db2cecd
Compare
Summary
On some Linux desktop environments, the native/portal file dialog used for
saving and exporting doesn't auto-append the file extension when the user
doesn't type one. This leaves the caller (e.g. PDF export in the main
MuseScore repo) unable to pick the correct writer for the returned path,
causing exports to silently fail.
makeSelectFileQuery()(interactive.cpp), when opening aSaveFiledialog, request a
defaultSuffixfrom the dialog derived from thesuggested
currentpath's own suffix.callers (e.g. "Save As" for a MuseScore project) offer two filters at
once — the normal
*.msczformat and an experimental uncompressed-folderoption — and a dialog-wide default suffix would be applied regardless of
which filter the user actually selected, silently defeating the
alternate option. That ambiguous case is left untouched.
Companion PR
This is a companion fix to a related PR in
musescore/MuseScore(
src/app/main.cppandsrc/project/internal/exportprojectscenario.cpp),which adds a safety net that enforces the correct suffix after the dialog
returns, regardless of dialog backend.
Testing
Verified with a full local Debug build of MuseScore Studio (main repo,
pointing at this branch) on KDE Plasma Wayland:
.pdffile..pdfexplicitly still works, without aduplicated suffix.
confirm) verified unaffected — this was a deliberate regression check,
since a past issue (#13113) was caused by a different, broken Linux file
dialog swallowing keyboard input.
Disclaimer
This change was implemented with the assistance of Claude Code (Anthropic),
which performed the code changes, the build, and the testing steps
described above. A human reviewed and validated the entire process step by
step, and endorses the final result.