Repository navigation
fix(open): fall back to the fast content type GVfs SMB reports - #1955
Conversation
GVfs SMB sets only standard::fast-content-type when a name's type guess is uncertain (.md, .py, .json), so opening, Open With, Properties and preview lost the type and logged a GLib critical. Read it the way GLib's default handler lookup does. Fixes lgse#1944
Manual testing on an SMB shareTested against a GVfs-mounted Samba share (
|
GVfs SMB sets standard::is-hidden only for hidden files, so FileInfo::is_hidden logged a GLib critical in Properties for every other file. Use the listing's existing info_is_hidden check. Refs lgse#1944
|
The |
|
Looks good. I found no blocking issues. The fix goes after the cause described in #1944, and I verified each change below by reading the code. What I checked
Nits
|
ReviewMerged Verdict: no blocking issues. The fix matches GLib's own Change made: Feedback disposition:
Tests: the new table-driven unit test checks precedence, fallback and the missing case, so it was kept as is. Local verification (pinned container, |
Description
GVfs's SMB backend sets
standard::content-typeonly when the name-based type guess is certain; for.md,.py,.jsonand other uncertain names it sets onlystandard::fast-content-type(daemon/gvfsbackendsmb.c, gvfs 1.62). Strata queried and read onlystandard::content-type, so opening such a file failed with "Unable to determine the selected file type" and GLib logged aGFileInfo created without standard::content-typecritical. Open With, Properties (Kind / Opens with) and the text preview lost the type the same way.A new
adapters::content_type_ofhelper readsstandard::content-typeand falls back tostandard::fast-content-type, as GLib's owng_file_query_default_handlerdoes (which is whygio openworked). EveryFileInfotype lookup now queries both attributes and uses it; checkinghas_attributefirst also removes the critical.Properties also read
standard::is-hidden, which GVfs SMB sets only for hidden files, without checking it was present, logging aGFileInfo created without standard::is-hiddencritical. It now uses the listing's existinginfo_is_hiddencheck.The container QA environment has no SMB backend, and the local backend always sets
standard::content-type, so the regression is covered by a unit test on the helper rather than a QA scenario.Visual evidence
N/A — non-visual fix to file type resolution.
How to test
gio mount smb://server/share) that contains aREADME.md, a.pyand a.jsonfile. Confirmgio info -a standard::content-type smb://server/share/README.mdlists no content type..md.Expected result: each file opens in its default application, Open With lists matching applications, Properties shows the file's Kind and "Opens with", the preview shows the text, and no
GLib-GIO-CRITICALappears in the log..txtfiles keep working as before.Related issue
Closes #1944