Repository navigation
fix(window): offer Save as when the open file is read-only (#211) (#212) - #213
Merged
Merged
Conversation
A document lent by the Flatpak document portal can be exported read-only, and a plain 0444 file cannot be written either. Both failed with EACCES on the first Ctrl+S. The save action now checks whether the file can be opened for writing and falls back to Save as, reusing the existing dialog and the existing duplicate-path guard. The header subtitle no longer shows the portal mount path, which says nothing about where the document lives. Closes #211 Closes #212
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #211
Closes #212
What
A file opened through the Flatpak document portal can be exported read-only (for example from the GNOME overview search), and a plain 0444 file cannot be written either. In both cases the first Ctrl+S failed with
Permission denied (os error 13)and nothing was saved.The save action now opens the file for writing first. If that fails, it shows a short message and continues through the existing Save as dialog, so the user picks where the copy goes and the document keeps working from there. Nothing is written behind the user's back and the sandbox permissions do not change.
The header subtitle no longer shows the portal mount path (
/run/user/<uid>/doc/<id>). That directory is a temporary grant from the portal, it says nothing about where the document lives, and it was the confusing part of #212. The tooltip keeps the real path.Tests
guardado::tests::un_fichero_de_solo_lectura_no_es_escribible(a 0444 file is not writable, an existing writable file and a missing file are).guardado::tests::reconoce_las_rutas_del_portal_de_documentos(portal paths and lookalikes).make checkgreen: fmt, clippy-D warnings, unit and integration suites, version checks. Both strings are inpo/es.po.