removed all const class data members

It's considered bad practice, I have only commented them.

tag: cppcoreguidelines-avoid-const-or-ref-data-members
This commit is contained in:
silverqx
2023-03-28 17:10:16 +02:00
parent 51a600dfc1
commit 1e5d14acbf
7 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -271,7 +271,7 @@ namespace Orm
/*! The QSqlDatabase connection resolver. */
std::function<Connectors::ConnectionName()> m_qtConnectionResolver;
/*! The name of the connected database. */
const QString m_database;
/*const*/ QString m_database;
/*! The table prefix for the connection. */
QString m_tablePrefix;
/*! Determine how the QDateTime time zone will be converted. */
@@ -281,7 +281,7 @@ namespace Orm
/*! Determine whether to return the QDateTime or QString (SQLite only). */
std::optional<bool> m_returnQDateTime = std::nullopt;
/*! The database connection configuration options. */
const QVariantHash m_config;
/*const*/ QVariantHash m_config;
/*! The reconnector instance for the connection. */
ReconnectorType m_reconnector = nullptr;
+2 -2
View File
@@ -63,9 +63,9 @@ namespace Orm::Query
private:
/*! The type of join being performed. */
const QString m_type;
/*const*/ QString m_type;
/*! The table the join clause is joining to. */
const JoinTable m_table;
/*const*/ JoinTable m_table;
};
const QString &
@@ -111,7 +111,7 @@ namespace Orm::Tiny::Concerns
private:
/*! Store type held by relation store. */
const RelationStoreType m_storeType;
/*const*/ RelationStoreType m_storeType;
};
/*! The store for loading eager relations. */
@@ -266,7 +266,7 @@ namespace Orm::Tiny::Concerns
const QString &m_comparison;
/*! Required number of records, used during querying relationship
exitence. */
const qint64 m_count;
/*const*/ qint64 m_count;
/*! Condition operator, used during querying relationship exitence. */
const QString &m_condition;
/*! Builder callback, used during querying relationship exitence. */
@@ -41,7 +41,7 @@ namespace Private
/*! Comparison operator. */
const QString &comparison;
/*! Number to compare against. */
const qint64 count;
/*const*/ qint64 count;
/*! User defined callback. */
const std::function<void(TinyBuilder<Related> &)> &callback;
};
+1 -1
View File
@@ -316,7 +316,7 @@ namespace Orm::Tiny
// Args &&...parameters);
/*! The base query builder instance. */
const std::shared_ptr<QueryBuilder> m_query;
/*const*/ std::shared_ptr<QueryBuilder> m_query;
/* This can't be a reference because the model is created on the stack
in Model::query(), then copied here and the original is destroyed
immediately. */
+1 -1
View File
@@ -95,7 +95,7 @@ namespace Tom::Commands
static QStringList getConnectionNamesFromFile();
/*! Commands to exclude from the list. */
const std::unordered_set<QString> m_dontList {
/*const*/ std::unordered_set<QString> m_dontList {
Tom::Constants::Complete,
};
};
+1 -1
View File
@@ -82,7 +82,7 @@ namespace Tom::Commands
getCommandsByNamespace(const QString &name) const;
/*! Commands to exclude from the list. */
const std::unordered_set<QString> m_dontList {
/*const*/ std::unordered_set<QString> m_dontList {
Tom::Constants::Complete,
};
};