You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is a structure tQucsSettings which has one instance QucsSettings that holds a copy of [most] of the application settings.
To some extent, this duplicates the functionality of QSettings which is designed to provide easy access to all application settings.
I would like to propose replacing QucsSettings with the direct use of QSettings via a static singleton access point.
So, to access the Qucsator binary, you would call _settings::Get().item<QString>("Qucsator"); instead of QucsSettings.Qucsator.
In this case ::item() would return either the stored key for "Qucsator" or the default value if one is defined.
The default values would be stored in a std::map.
Whilst this may look slightly more unwieldy, I think it will make the settings functions easier to maintain going forwards and simplify additional functionality such as shortcut keys.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Currently there is a structure
tQucsSettings
which has one instanceQucsSettings
that holds a copy of [most] of the application settings.To some extent, this duplicates the functionality of
QSettings
which is designed to provide easy access to all application settings.I would like to propose replacing
QucsSettings
with the direct use ofQSettings
via a static singleton access point.So, to access the Qucsator binary, you would call
_settings::Get().item<QString>("Qucsator");
instead ofQucsSettings.Qucsator
.In this case ::item() would return either the stored key for "Qucsator" or the default value if one is defined.
The default values would be stored in a
std::map
.Whilst this may look slightly more unwieldy, I think it will make the settings functions easier to maintain going forwards and simplify additional functionality such as shortcut keys.
See iwbnwif/qucs_s:static_settings_object for the new classes and an example of usage.
Please note: This is 100% compatible with all existing settings and can run in parallel with
QucsSettings
if wanted.Beta Was this translation helpful? Give feedback.
All reactions