Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 862
    • Issues 862
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 41
    • Merge requests 41
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !2893

GSettings: New schema source from path, bytes and resource

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Zipdox requested to merge zipdox/glib:main into main Sep 13, 2022
  • Overview 96
  • Commits 1
  • Pipelines 18
  • Changes 7

Allows the creation of a GSettingsSchemaSource from a file path directly, from a GBytes object and form a resource compiled with glib-compile-resources.

Adds 3 new methods:

  • g_settings_schema_source_new_from_path
  • g_settings_schema_source_new_from_bytes
  • g_settings_schema_source_new_from_resource

Why this is important:

  • Portability
    • Embedding the schema inside a program improves its portability as you don't have to worry about shipping a separate schema file.
  • Cross platform support
    • Windows and MacOS do not use XDG_DATA_DIRS and therefore it's not clear where to put schemas. This merge request omits that problem entirely.
  • Speed
    • Loading a schema from a resource is faster than loading it from a file.

Fixes: #2749 (closed) and #499

Edited Oct 14, 2022 by Philip Withnall
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: main