diff options
Diffstat (limited to 'src/backend/config/btconfigcore.h')
-rw-r--r-- | src/backend/config/btconfigcore.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/backend/config/btconfigcore.h b/src/backend/config/btconfigcore.h index 5c24b4f..257295d 100644 --- a/src/backend/config/btconfigcore.h +++ b/src/backend/config/btconfigcore.h @@ -4,7 +4,7 @@ * * This file is part of BibleTime's source code, http://www.bibletime.info/. * -* Copyright 1999-2014 by the BibleTime developers. +* Copyright 1999-2016 by the BibleTime developers. * The BibleTime source code is licensed under the GNU General Public License version 2.0. * **********/ @@ -18,6 +18,7 @@ #include <QHash> #include <QMutex> #include <QStringList> +#include "../../util/btassert.h" /** @@ -27,15 +28,17 @@ */ class BtConfigCore { - Q_DISABLE_COPY(BtConfigCore) Q_DECLARE_TR_FUNCTIONS(BtConfigCore) public: /* Types: */ - typedef QHash<QString, QString> SessionNamesHashMap; + using SessionNamesHashMap = QHash<QString, QString>; public: /* Methods: */ + BtConfigCore(BtConfigCore const &) = delete; + BtConfigCore & operator=(BtConfigCore const &) = delete; + /** \param[in] settingsFile The filename of the settings file. */ @@ -57,9 +60,9 @@ public: /* Methods: */ */ inline const QString & currentSessionName() const { QMutexLocker lock(&m_mutex); - typedef QHash<QString, QString>::const_iterator SSHCI; + using SSHCI = QHash<QString, QString>::const_iterator; SSHCI it = m_sessionNames.constFind(m_currentSessionKey); - Q_ASSERT(it != m_sessionNames.constEnd()); + BT_ASSERT(it != m_sessionNames.constEnd()); return it.value(); } @@ -239,13 +242,13 @@ public: /* Methods: */ \param[in] prefix the prefix to append */ inline void beginGroup(QString prefix) { - Q_ASSERT(!prefix.isEmpty()); + BT_ASSERT(!prefix.isEmpty()); while (prefix.startsWith('/')) prefix.remove(0, 1); - Q_ASSERT(!prefix.isEmpty()); + BT_ASSERT(!prefix.isEmpty()); while (prefix.endsWith('/')) prefix.chop(1); - Q_ASSERT(!prefix.isEmpty()); + BT_ASSERT(!prefix.isEmpty()); m_mutex.lock(); m_groups.append(prefix); @@ -262,7 +265,8 @@ public: /* Methods: */ \warning Locks the object (recursively) until endGroup(). */ inline void endGroup() { - Q_ASSERT_X(!m_groups.isEmpty(), "BtConfig", "endGroup() called, but no beginGroup() active."); + BT_ASSERT(!m_groups.isEmpty() + && "BtConfig::endGroup() called, but no beginGroup() active"); m_groups.removeLast(); m_cachedGroup = QString(); m_mutex.unlock(); |