BibleTime
|
#include <btconfigcore.h>
Public Member Functions | |
BtConfigCore (BtConfigCore &&)=default | |
BtConfigCore (BtConfigCore const &)=default | |
QStringList | childGroups () const |
QStringList | childKeys () const |
template<typename Prefix > | |
BtConfigCore | group (Prefix &&prefix) && |
template<typename Prefix > | |
BtConfigCore | group (Prefix &&prefix) const & |
BtConfigCore & | operator= (BtConfigCore &&)=default |
BtConfigCore & | operator= (BtConfigCore const &)=default |
QVariant | qVariantValue (QString const &key, QVariant const &defaultValue=QVariant()) const |
Returns the settings value for the given global key as a QVariant. More... | |
void | remove (QString const &key) |
removes a key (and its children) from the current group. More... | |
template<typename T > | |
void | setValue (QString const &key, T const &value) |
Sets a value for a key. More... | |
void | sync () |
Synchronizes the configuration to disk. More... | |
template<typename T > | |
T | value (QString const &key, T const &defaultValue=T()) const |
Returns the settings value for the given global key. More... | |
~BtConfigCore () | |
Private Member Functions | |
BtConfigCore (std::shared_ptr< QSettings > state, QString groupPrefix=QString()) | |
void | setValue_ (QString const &key, QVariant value) |
Private Attributes | |
QString | m_groupPrefix |
Empty or absolute path with trailing slash. More... | |
std::shared_ptr< QSettings > | m_state |
Friends | |
class | BtConfig |
Definition at line 29 of file btconfigcore.h.
|
default |
|
default |
|
default |
|
private |
Definition at line 33 of file btconfigcore.cpp.
References BT_ASSERT, BT_DEBUG_ONLY, and m_groupPrefix.
QStringList BtConfigCore::childGroups | ( | ) | const |
Definition at line 57 of file btconfigcore.cpp.
References anonymous_namespace{btconfigcore.cpp}::groupGuard(), m_groupPrefix, and m_state.
QStringList BtConfigCore::childKeys | ( | ) | const |
Definition at line 50 of file btconfigcore.cpp.
References anonymous_namespace{btconfigcore.cpp}::groupGuard(), m_groupPrefix, and m_state.
|
inline |
[in] | prefix | the prefix to append |
Definition at line 101 of file btconfigcore.h.
References m_groupPrefix.
|
inline |
[in] | prefix | the prefix to append |
Definition at line 93 of file btconfigcore.h.
References m_groupPrefix, and m_state.
Referenced by BtConfig::BtConfig(), BtEditTextPage::BtEditTextPage(), BtTextFiltersTab::BtTextFiltersTab(), BtConfig::getDisplayOptions(), BtConfig::getFilterOptions(), BtConfig::getShortcuts(), BibleTime::initActions(), BtEditTextPage::initHtmlFont(), BtConfig::loadDisplayOptionsFromGroup(), BtConfig::loadFilterOptionsFromGroup(), BibleTime::reloadProfile(), BtTextFiltersTab::save(), BtConfig::session(), BtConfig::setShortcuts(), BibleTime::showOrHideToolBars(), BibleTime::slotToggleMainToolbar(), BibleTime::slotToggleNavigatorToolbar(), BibleTime::slotToggleTextWindowHeader(), BibleTime::slotToggleToolBarsInEachWindow(), BibleTime::slotToggleToolsToolbar(), BibleTime::slotToggleWorksToolbar(), BibleTime::slotUpdateWindowArrangementActions(), BtConfig::storeDisplayOptionsToGroup(), and BtConfig::storeFilterOptionsToGroup().
|
default |
|
default |
QVariant BtConfigCore::qVariantValue | ( | QString const & | key, |
QVariant const & | defaultValue = QVariant() |
||
) | const |
Returns the settings value for the given global key as a QVariant.
[in] | key | Key to get the value for. |
[in] | defaultValue | The value to return if no saved value is found. |
Definition at line 46 of file btconfigcore.cpp.
References m_groupPrefix, and m_state.
Referenced by BtConfig::getFontForLanguage(), BtBookshelfTreeModel::Grouping::loadFrom(), and value().
void BtConfigCore::remove | ( | QString const & | key | ) |
removes a key (and its children) from the current group.
[in] | key | the key to remove |
Definition at line 64 of file btconfigcore.cpp.
References m_groupPrefix, and m_state.
Referenced by BtConfig::deleteSearchScopesWithCurrentLocale(), and BtConfig::deleteSession().
|
inline |
Sets a value for a key.
[in] | key | Ket to set. |
[in] | value | Value to set. |
Definition at line 73 of file btconfigcore.h.
References setValue_(), and value().
Referenced by BtBookshelfWizard::accept(), BtEditTextWizard::accept(), BtConfig::addSession(), BtIndexDialog::autoDeleteOrphanedIndicesChanged(), BtConfig::booknameLanguage(), BtConfig::BtConfig(), BtEditTextPage::BtEditTextPage(), BtTipDialog::BtTipDialog(), BtConfig::forceMigrate(), BtConfig::initBtConfig(), main(), BibleTime::processCommandline(), CDisplaySettingsPage::resetLanguage(), CDisplaySettingsPage::save(), BtBookshelfWidget::saveBookshelfState(), Search::BtSearchResultArea::saveDialogSettings(), BibleTime::saveProfile(), Search::BtSearchOptionsArea::saveSettings(), BtBookshelfTreeModel::Grouping::saveTo(), BtConfig::setCurrentSession(), BtConfig::setDefaultSwordModuleByType(), BtConfig::setFontForLanguage(), CSwordModuleInfo::setHidden(), BtConfig::setModuleEncryptionKey(), Search::BtSearchOptionsArea::setModules(), BtConfig::setSearchScopesWithCurrentLocale(), BtBookshelfWorksPage::slotPathChanged(), BtConfig::storeDisplayOptionsToGroup(), BtConfig::storeFilterOptionsToGroup(), CDisplayWindow::storeProfileSettings(), CBookReadWindow::storeProfileSettings(), CCommentaryReadWindow::storeProfileSettings(), BibleTimeApp::~BibleTimeApp(), CConfigurationDialog::~CConfigurationDialog(), and Search::CSearchDialog::~CSearchDialog().
|
private |
Definition at line 69 of file btconfigcore.cpp.
References m_groupPrefix, m_state, and value().
Referenced by setValue().
void BtConfigCore::sync | ( | ) |
Synchronizes the configuration to disk.
Definition at line 67 of file btconfigcore.cpp.
References m_state.
Referenced by BibleTime::processCommandline().
|
inline |
Returns the settings value for the given global key.
[in] | key | Key to get the value for. |
[in] | defaultValue | The value to return if no saved value is found. |
Definition at line 50 of file btconfigcore.h.
References qVariantValue().
Referenced by CDisplayTemplateMgr::activeTemplateName(), CDisplayWindow::applyProfileSettings(), CBookReadWindow::applyProfileSettings(), CCommentaryReadWindow::applyProfileSettings(), BtTipDialog::BtTipDialog(), BibleTime::createMenuAndToolBar(), CSwordModuleInfo::CSwordModuleInfo(), BtConfig::initBtConfig(), BtBookshelfLanguagesPage::initializePage(), BtBookshelfSourcesPage::initializePage(), BibleTimeApp::initLightDarkPalette(), BtBookshelfWidget::loadBookshelfState(), Search::BtSearchResultArea::loadDialogSettings(), Search::BtSearchOptionsArea::readSettings(), setValue(), setValue_(), BtBookshelfWorksPage::slotInitPathCombo(), BibleTime::slotToggleMainToolbar(), BibleTime::slotToggleNavigatorToolbar(), BibleTime::slotToggleTextWindowHeader(), BibleTime::slotToggleToolBarsInEachWindow(), BibleTime::slotToggleToolsToolbar(), and BibleTime::slotToggleWorksToolbar().
|
friend |
Definition at line 31 of file btconfigcore.h.
Referenced by BtConfig::initBtConfig().
|
private |
Empty or absolute path with trailing slash.
Definition at line 119 of file btconfigcore.h.
Referenced by BtConfigCore(), childGroups(), childKeys(), group(), qVariantValue(), remove(), and setValue_().
|
private |
Definition at line 118 of file btconfigcore.h.
Referenced by childGroups(), childKeys(), group(), qVariantValue(), remove(), setValue_(), and sync().