Giter Club home page Giter Club logo

qtgsettings's Introduction

Qt GSettings

License GitHub release GitHub issues CI

Qt-style API to wrap GSettings.

Dependencies

Qt >= 6.6.0 with at least the following modules is required:

The following modules and their dependencies are required:

Installation

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/path/to/prefix ..
make
make install # use sudo if necessary

Replace /path/to/prefix to your installation prefix. Default is /usr/local.

Licensing

Licensed under the terms of the GNU Lesser General Public License version 3.

qtgsettings's People

Contributors

aldrog avatar damianatorrpm avatar ibelieve avatar plfiorini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

qtgsettings's Issues

stringmaps are converted incorrecty (wrong data)

stringmaps work as long as keys are not repeating in same a{ss} array,
though they are supposed to from /ca/desrt/dconf-editor/relocatable-schemas-user-paths:

A dictionary that maps schema IDs with path specifications. It is used to allow the user to associate a relocatable schema to certain paths. Path specifications may contain wildcards in the form of empty segments (e.g. /ca/desrt/dconf-editor//), defining possibly multiple paths. The same schema ID may be associated with multiple path specifications.

example:

    auto settings = new QGSettings(QStringLiteral("ca.desrt.dconf-editor.Settings"),
                                   QStringLiteral("/ca/desrt/dconf-editor/"));
     QVariant tt = settings->value("relocatableSchemasUserPaths");

where the actual data looked like this
{'ca.desrt.dconf-editor.Demo.Relocatable': '/ca/desrt/dconf-editor/Demo/relocatable/', 'org.test.test': '/org/test/test/subpath1'}

works fine

but when keys are used multiple times

    auto settings = new QGSettings(QStringLiteral("ca.desrt.dconf-editor.Settings"),
                                   QStringLiteral("/ca/desrt/dconf-editor/"));
     QVariant tt = settings->value("relocatableSchemasUserPaths");

where the actual data looked like this
{'ca.desrt.dconf-editor.Demo.Relocatable': '/ca/desrt/dconf-editor/Demo/relocatable/', 'org.test.test': '/org/test/test/subpath1', 'org.test.test': '/org/test/test/subpath2'}

than setting the value will delete any key that repeats

Long story short

    auto settings = new QGSettings(QStringLiteral("ca.desrt.dconf-editor.Settings"),
                                   QStringLiteral("/ca/desrt/dconf-editor/"));
     QVariant tt = settings->value("relocatableSchemasUserPaths");

will replace your original data
{'ca.desrt.dconf-editor.Demo.Relocatable': '/ca/desrt/dconf-editor/Demo/relocatable/', 'org.test.test': '/org/test/test/subpath1', 'org.test.test': '/org/test/test/subpath2'}
with
{'ca.desrt.dconf-editor.Demo.Relocatable': '/ca/desrt/dconf-editor/Demo/relocatable/', 'org.test.test': '/org/test/test/subpath2'}

I suspect this is due to the converting of gvariant to qvariant and qvariant being optimized and it "optimizes" the data away.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.