Skip to content

Commit

Permalink
[doc] settings and global config
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien-B committed Feb 14, 2024
1 parent d63106d commit fbf2834
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/source/developer_guide/index_developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ Developer guide
This part will guide you through the code of PprzGCS, and some desing choices that have been made.

.. toctree::
:maxdepth: 2
:maxdepth: 1

how_to_build
concepts
pprzapplication
settings
aircraft
widgets
map
Expand Down
31 changes: 31 additions & 0 deletions docs/source/developer_guide/settings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Settings and config
===================

Settings and global configurations are both global and accessible from anywhere in the application. They differ only by the intended lifespan.

Settings
--------

Settings are stored in a file and are saved accross sessions.

It uses the QSettings interface, with a file named ``settings.conf`` at the standard path ``QStandardPaths::AppDataLocation``.
Thus, it's most probably corresponds to ``$HOME/.local/share/pprzgcs/settings.conf``.


Use the helper function ``QSettings getAppSettings()`` from ``gcs_utils.h`` to start using them.


GlobalConfig
------------

The global config is a singleton holding a key/value configuration.

It lives only for the current session.

Use the helper function ``GlobalConfig* appConfig()`` from ``gcs_utils.h`` to start using it.

Like the settings, it uses QVariant type to hold its items.



0 comments on commit fbf2834

Please sign in to comment.