Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • S shared-mime-info
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 42
    • Issues 42
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 29
    • Merge requests 29
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • xdg
  • shared-mime-info
  • Merge requests
  • !177

text/x-qml: Lower match priority to avoid conflicts with Python

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Philip Withnall requested to merge pwithnall/shared-mime-info:84-qml into master Feb 14, 2022
  • Overview 6
  • Commits 1
  • Pipelines 2
  • Changes 3

GLib takes priorities >= 80 to mean a short-circuit to a magic match, overriding any conflicting matching globs. More generally, high priority magic should only be used if it’s really unlikely that the magic will match anything except the given MIME type. That’s evidently not true here.

Some Python files which import Qt modules can look like valid QML files, matching the magic but not the glob.

Lower the priority of the magic so that it doesn’t trigger the short-circuit code in GLib. This means the name match is guessed as the right one instead of the magic match.

See https://gitlab.gnome.org/GNOME/glib/-/blob/6ee71750a532d8de5eaed5cf12e8718738ddd5c6/gio/gcontenttype.c#L840 and https://gitlab.gnome.org/GNOME/glib/-/issues/2599.

Tested with XDG_DATA_DIRS=$buildroot/share gio info ./not-qml.py.

Signed-off-by: Philip Withnall pwithnall@endlessos.org

Helps: #84 (closed)

Closes #84 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 84-qml