Class sh::settings::SettingsManager¶
-
class
sh::settings
::
SettingsManager
: public QObject, public sh::base::Singleton¶ Manager for Shallot settings.
This is the more flexible way of shallot customization. It includes everything you see in the ‘Manage saved settings’ or ‘Save settings’.
See sh::settings::Setting for more.
Public Functions
-
void
applyPerEurlSettingsToFileView
(sh::ui::FileView *list)¶ Applies all stored settings, which are per-eurl to a fileview.
-
void
applyGlobalSettingsToFileView
(sh::ui::FileView *list)¶ Applies all stored settings, which are global to a fileview.
-
void
applyPerEurlSettingsToMainWindow
()¶ Applies all stored settings, which are per-eurl to main window.
-
void
applyGlobalSettingsToMainWindow
()¶ Applies all stored settings, which are global to a main window.
-
QList<sh::settings::ProfileNode*>
getNodesForProfile
(QString profile)¶ Returns a list of all stored settings (as
ProfileNode
s) for a given profile.
-
sh::settings::ProfileNode *
getNodeByNodeId
(QString nodeId)¶ Searches and returns a ProfileNode by id.
-
std::shared_ptr<sh::settings::Setting>
getSettingByName
(QString name)¶ Searches and returns a Setting by name.
-
QList<std::shared_ptr<sh::settings::Setting>>
getAllSettings
()¶ Returns a list of all available settings, primarily sorted by group.
-
QStringList
getProfileList
()¶ Returns a list of all existing profiles.
-
void
removeProfile
(QString profile)¶ Removes a profile (including all
ProfileNode
s inside it).
-
void
removeNode
(QString nodeId)¶ Removes a
ProfileNode
by id.
Stores one setting into a profile.
-
~SettingsManager
()¶
-
void
doInitialize
()¶ Executes singleton initialization.
-
void
doShutdown
()¶ Executes singleton shutdown.
-
void
shutdown
()¶ Shutdown down this singleton.
-
bool
isAlive
()¶ Returns if this singleton is alive (true until its shutdown begins).
Signals
-
void
profilesChanged
()¶ Triggered when the list of profiles or the nodes inside it change.
Can also be triggered when nothing really changed!
Private Functions
-
void
applyToFileView
(sh::ui::FileView *list, QMap<QString, QString> settings)¶ Applies some settings (as string tuples) to a fileview.
-
void
applyToMainWindow
(QMap<QString, QString> settings)¶ Applies some settings (as string tuples) to main window.
Computes all effective settings (including inheritance and sub-directories) for a given situation (global or eurl-bound; fileview- or mainwindow-bound) and returns it as string tuples.
- Parameters
eurl
: The directory to consider as current (ornullptr
for global settings).profilename
: The current profile.fileviewindex
: The fileview index (or -1 for mainwindow-bound settings).directNode
: If the given directory is to be considered as the real current directory (not e.g. a parent).
Used internally by _getSettings().
-
void
invalidateCache
()¶ Invalidates the _getSettings cache.
-
void
readStoredProfiles
()¶ Reads all profiles (including all setting nodes) from filesystem.
-
SettingsManager
()¶
Private Members
-
QMap<QString, QMap<QString, QString>>
_getSettings_cache
¶
-
QMap<std::shared_ptr<const sh::filesystem::Eurl>, QMap<QString, QList<sh::settings::ProfileNode*>>>
_profileNodes
¶
-
QMap<QString, sh::settings::ProfileNode*>
_profileNodesById
¶
-
QList<QString>
_profileNames
¶
Friends
- friend class sh::settings::SettingsRegistration
-
class
_MyHandler
: public QXmlDefaultHandler¶ Used internally for reading profile node XMLs.
Public Functions
-
_MyHandler
(sh::settings::ProfileNode *node, QString filename)¶
-
bool
startElement
(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)¶
-
bool
endElement
(const QString &namespaceURI, const QString &localName, const QString &qName)¶
Private Functions
-
void
throwError
()¶
-
-
class
_SettingsFinderStructure
¶ Used internally by _getSettings().
-
void