Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle application configuration using QSettings #135

Closed
stdevCrow opened this issue Sep 18, 2019 · 1 comment · Fixed by #260 or #292
Closed

Handle application configuration using QSettings #135

stdevCrow opened this issue Sep 18, 2019 · 1 comment · Fixed by #260 or #292
Assignees
Labels
config App configuration enhancement New feature or request gui Problem with the Graphic User Interface os-windows Specific to Microsoft Windows platform stdev
Milestone

Comments

@stdevCrow
Copy link
Contributor

stdevCrow commented Sep 18, 2019

Description
We are using JSON format to save/restore configuration, while using QSettings is a better approach.

Advantages over the JSON approach

  • Uses the standard configuration format for every system the application runs on.
    • Windows: System registry
    • Darwin: Property list files
    • UNIX: In absence of an standard, uses INI text files
  • Creating and destroying QSettings objects is very fast
  • It ensures that the location is always writable
  • The location and storage format is transparent for the developer
  • Each developer can save/load its own settings with two lines of code without affecting others or making a bigger implementation
  • There is an equivalent QML component named Settings that allows to write and read settings directly from QML

See QSettings and Settings in Qt Docs for details

How to use it?

Read configurations when necessary:

QSettings settings;

int value1 = settings.value("cipher/someInteger").toInt();
QString value2 = settings.value("cipher/someString").toString();

And write/update configurations when necessary:

QSettings settings;

int value1 = 5;
QString value2 = "bla bla bla";
settings.setValue("cipher/someInteger", value1);
settings.setValue("cipher/someString", value2);

In the above examples, "cipher" it's just a group of properties, like a folder.
You can name your group (if any) as you want.

@stdevCrow stdevCrow added enhancement New feature or request stdev gui Problem with the Graphic User Interface config App configuration labels Sep 18, 2019
@olemis olemis added this to To do in FiberCrypto wallet - Iteration 1 via automation Nov 1, 2019
@olemis olemis added the os-windows Specific to Microsoft Windows platform label Nov 1, 2019
@olemis olemis added this to the 0.27.0 milestone Nov 1, 2019
hsequeda added a commit to simelo/fibercryptowallet that referenced this issue Dec 4, 2019
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 13, 2019
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 13, 2019
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 13, 2019
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 13, 2019
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 13, 2019
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 13, 2019
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 13, 2019
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 14, 2019
… make run-docker

Use it in Travis script
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 14, 2019
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 14, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 18, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 20, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 20, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 20, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 21, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 21, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 21, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 21, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 21, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 22, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 22, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 23, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 23, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 23, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 23, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 23, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 23, 2019
stdevMac added a commit to simelo/fibercryptowallet that referenced this issue Dec 23, 2019
FiberCrypto wallet - Iteration 1 automation moved this from To do to Done Dec 24, 2019
olemis added a commit that referenced this issue Dec 24, 2019
…lication_configuration_using_QSettings

Fixes #135: Handle application configuration using `QSettings`
@olemis
Copy link
Contributor

olemis commented Dec 30, 2019

This needs be reopened so as to fix errors on Travis Windows builds

@olemis olemis reopened this Dec 30, 2019
FiberCrypto wallet - Iteration 1 automation moved this from Done to In progress Dec 30, 2019
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 30, 2019
olemis added a commit to simelo/fibercryptowallet that referenced this issue Dec 30, 2019
FiberCrypto wallet - Iteration 1 automation moved this from In progress to Done Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config App configuration enhancement New feature or request gui Problem with the Graphic User Interface os-windows Specific to Microsoft Windows platform stdev
9 participants