From 2c28cd842e0c2b4933666db3ebcdcef70d75dd43 Mon Sep 17 00:00:00 2001 From: silverqx Date: Wed, 14 Feb 2024 13:22:31 +0100 Subject: [PATCH] removed using aliases (used using declaration) - added/updated comments --- include/orm/tiny/model.hpp | 4 ++-- include/orm/tiny/relations/pivot.hpp | 4 ++-- include/orm/tiny/tinytypes.hpp | 4 ++-- include/orm/tiny/types/connectionoverride.hpp | 3 ++- include/orm/tiny/types/modelattributes.hpp | 4 ++-- include/orm/tiny/types/syncchanges.hpp | 4 ++-- include/orm/types/log.hpp | 3 ++- include/orm/types/sqlquery.hpp | 3 ++- include/orm/types/statementscounter.hpp | 3 ++- src/orm/databasemanager.cpp | 2 +- src/orm/schema/sqliteschemabuilder.cpp | 4 ++-- .../functional/orm/tiny/model_appends/tst_model_appends.cpp | 3 ++- .../tiny/model_hidesattributes/tst_model_hidesattributes.cpp | 3 ++- .../orm/tiny/model_serialization/tst_model_serialization.cpp | 3 ++- tom/include/tom/concerns/pretendable.hpp | 2 +- 15 files changed, 28 insertions(+), 21 deletions(-) diff --git a/include/orm/tiny/model.hpp b/include/orm/tiny/model.hpp index 81c650069..81ae856ff 100644 --- a/include/orm/tiny/model.hpp +++ b/include/orm/tiny/model.hpp @@ -28,8 +28,8 @@ namespace Orm::Tiny template class SoftDeletes; - /*! Alias for the GuardedModel. */ - using GuardedModel = Concerns::GuardedModel; // Don't remove + /*! Alias for the Concerns::GuardedModel, shortcut alias. */ + using Concerns::GuardedModel; // Don't remove // NOLINT(misc-unused-using-decls) // TODO model missing methods Model::loadMissing() silverqx // TODO model missing saveOrFail(), updateOrFail(), deleteOrFail(), I will need to implement ManagesTransaction::transaction(callback) method silverqx diff --git a/include/orm/tiny/relations/pivot.hpp b/include/orm/tiny/relations/pivot.hpp index eca79410b..a6d35aa54 100644 --- a/include/orm/tiny/relations/pivot.hpp +++ b/include/orm/tiny/relations/pivot.hpp @@ -36,8 +36,8 @@ namespace Tiny::Relations } // namespace Tiny::Relations - /*! Alias for the Pivot, shortcut alias. */ - using Pivot = Tiny::Relations::Pivot; + /*! Alias for the Relations::Pivot, shortcut alias. */ + using Tiny::Relations::Pivot; // NOLINT(misc-unused-using-decls) } // namespace Orm diff --git a/include/orm/tiny/tinytypes.hpp b/include/orm/tiny/tinytypes.hpp index f411fffd2..80171cdef 100644 --- a/include/orm/tiny/tinytypes.hpp +++ b/include/orm/tiny/tinytypes.hpp @@ -210,8 +210,8 @@ namespace Concerns } // namespace Concerns } // namespace Tiny - /*! Alias for the Orm::Tiny::One, shortcut alias. */ - using One = Tiny::One; + /*! Alias for the Tiny::One, shortcut alias. */ + using Tiny::One; // NOLINT(misc-unused-using-decls) } // namespace Orm diff --git a/include/orm/tiny/types/connectionoverride.hpp b/include/orm/tiny/types/connectionoverride.hpp index 800bceab4..b315e672c 100644 --- a/include/orm/tiny/types/connectionoverride.hpp +++ b/include/orm/tiny/types/connectionoverride.hpp @@ -35,7 +35,8 @@ namespace Types } // namespace Types - using ConnectionOverride = Tiny::Types::ConnectionOverride; + /*! Alias for the Types::ConnectionOverride, shortcut alias. */ + using Tiny::Types::ConnectionOverride; // NOLINT(misc-unused-using-decls) } // namespace Orm::Tiny diff --git a/include/orm/tiny/types/modelattributes.hpp b/include/orm/tiny/types/modelattributes.hpp index 7efe02240..3a669305b 100644 --- a/include/orm/tiny/types/modelattributes.hpp +++ b/include/orm/tiny/types/modelattributes.hpp @@ -67,8 +67,8 @@ namespace Types } // namespace Types - /*! Alias for the ModelAttributes. */ - using ModelAttributes = Tiny::Types::ModelAttributes; + /*! Alias for the Types::ModelAttributes, shortcut alias. */ + using Tiny::Types::ModelAttributes; // NOLINT(misc-unused-using-decls) } // namespace Orm::Tiny diff --git a/include/orm/tiny/types/syncchanges.hpp b/include/orm/tiny/types/syncchanges.hpp index cbe4cc34c..498e9fdf3 100644 --- a/include/orm/tiny/types/syncchanges.hpp +++ b/include/orm/tiny/types/syncchanges.hpp @@ -406,8 +406,8 @@ namespace Types } // namespace Types - /*! Alias for the SyncChanges. */ - using SyncChanges = Tiny::Types::SyncChanges; + /*! Alias for the Types::SyncChanges, shortcut alias. */ + using Tiny::Types::SyncChanges; // NOLINT(misc-unused-using-decls) } // namespace Tiny } // namespace Orm diff --git a/include/orm/types/log.hpp b/include/orm/types/log.hpp index d27fe0522..37063946b 100644 --- a/include/orm/types/log.hpp +++ b/include/orm/types/log.hpp @@ -45,7 +45,8 @@ namespace Types } // namespace Types - using Log = Types::Log; + /*! Alias for the Types::Log, shortcut alias. */ + using Types::Log; // NOLINT(misc-unused-using-decls) } // namespace Orm diff --git a/include/orm/types/sqlquery.hpp b/include/orm/types/sqlquery.hpp index 058a6ec90..4e36f273b 100644 --- a/include/orm/types/sqlquery.hpp +++ b/include/orm/types/sqlquery.hpp @@ -98,7 +98,8 @@ namespace Types } // namespace Types - using SqlQuery = Types::SqlQuery; + /*! Alias for the Types::SqlQuery, shortcut alias. */ + using Types::SqlQuery; // NOLINT(misc-unused-using-decls) } // namespace Orm diff --git a/include/orm/types/statementscounter.hpp b/include/orm/types/statementscounter.hpp index 7449c3950..01451b629 100644 --- a/include/orm/types/statementscounter.hpp +++ b/include/orm/types/statementscounter.hpp @@ -28,7 +28,8 @@ namespace Types } // namespace Types - using StatementsCounter = Types::StatementsCounter; + /*! Alias for the Types::StatementsCounter, shortcut alias. */ + using Types::StatementsCounter; // NOLINT(misc-unused-using-decls) } // namespace Orm diff --git a/src/orm/databasemanager.cpp b/src/orm/databasemanager.cpp index baaec21c2..d6e830e28 100644 --- a/src/orm/databasemanager.cpp +++ b/src/orm/databasemanager.cpp @@ -971,7 +971,7 @@ void DatabaseManager::registerQMetaTypesForQt5() QMetaType::registerEqualsComparator>(); #ifndef TINYORM_DISABLE_ORM - using AttributeItem = Tiny::AttributeItem; + using Tiny::AttributeItem; if (!QMetaType::hasRegisteredComparators()) QMetaType::registerEqualsComparator(); diff --git a/src/orm/schema/sqliteschemabuilder.cpp b/src/orm/schema/sqliteschemabuilder.cpp index 855417f63..38a6667fa 100644 --- a/src/orm/schema/sqliteschemabuilder.cpp +++ b/src/orm/schema/sqliteschemabuilder.cpp @@ -54,7 +54,7 @@ void SQLiteSchemaBuilder::dropAllTables() const if (m_connection->getDatabaseName() != in_memory) return refreshDatabaseFile(); // clazy:exclude=returning-void-expression - using SQLiteSchemaGrammar = Grammars::SQLiteSchemaGrammar; + using Grammars::SQLiteSchemaGrammar; m_connection->selectFromWriteConnection(SQLiteSchemaGrammar:: compileEnableWriteableSchema()); @@ -69,7 +69,7 @@ void SQLiteSchemaBuilder::dropAllTables() const void SQLiteSchemaBuilder::dropAllViews() const { - using SQLiteSchemaGrammar = Grammars::SQLiteSchemaGrammar; + using Grammars::SQLiteSchemaGrammar; m_connection->selectFromWriteConnection(SQLiteSchemaGrammar:: compileEnableWriteableSchema()); diff --git a/tests/auto/functional/orm/tiny/model_appends/tst_model_appends.cpp b/tests/auto/functional/orm/tiny/model_appends/tst_model_appends.cpp index 6074fdd49..74d5806a4 100644 --- a/tests/auto/functional/orm/tiny/model_appends/tst_model_appends.cpp +++ b/tests/auto/functional/orm/tiny/model_appends/tst_model_appends.cpp @@ -15,7 +15,8 @@ using Orm::Constants::Progress; using Orm::Constants::SIZE_; using Orm::Constants::UPDATED_AT; -using NullVariant = Orm::Utils::NullVariant; +using Orm::Utils::NullVariant; + using TypeUtils = Orm::Utils::Type; using Orm::Tiny::AttributeItem; diff --git a/tests/auto/functional/orm/tiny/model_hidesattributes/tst_model_hidesattributes.cpp b/tests/auto/functional/orm/tiny/model_hidesattributes/tst_model_hidesattributes.cpp index 6959aef2e..9484102f3 100644 --- a/tests/auto/functional/orm/tiny/model_hidesattributes/tst_model_hidesattributes.cpp +++ b/tests/auto/functional/orm/tiny/model_hidesattributes/tst_model_hidesattributes.cpp @@ -16,7 +16,8 @@ using Orm::Constants::Progress; using Orm::Constants::SIZE_; using Orm::Constants::UPDATED_AT; -using NullVariant = Orm::Utils::NullVariant; +using Orm::Utils::NullVariant; + using TypeUtils = Orm::Utils::Type; using Orm::Tiny::AttributeItem; diff --git a/tests/auto/functional/orm/tiny/model_serialization/tst_model_serialization.cpp b/tests/auto/functional/orm/tiny/model_serialization/tst_model_serialization.cpp index dd2a49b88..1bfdcbeec 100644 --- a/tests/auto/functional/orm/tiny/model_serialization/tst_model_serialization.cpp +++ b/tests/auto/functional/orm/tiny/model_serialization/tst_model_serialization.cpp @@ -22,7 +22,8 @@ using Orm::Constants::pivot_; using Orm::Utils::Helpers; -using NullVariant = Orm::Utils::NullVariant; +using Orm::Utils::NullVariant; + using TypeUtils = Orm::Utils::Type; using Orm::Tiny::AttributeItem; diff --git a/tom/include/tom/concerns/pretendable.hpp b/tom/include/tom/concerns/pretendable.hpp index f376515b3..4a0c29e2a 100644 --- a/tom/include/tom/concerns/pretendable.hpp +++ b/tom/include/tom/concerns/pretendable.hpp @@ -20,7 +20,7 @@ namespace Types { struct Log; } - using Log = Orm::Types::Log; + using Orm::Types::Log; class DatabaseConnection; } // namespace Orm