diff options
author | Uwe Klotz <uwe_klotz@web.de> | 2017-06-14 00:28:52 +0200 |
---|---|---|
committer | Uwe Klotz <uwe_klotz@web.de> | 2017-06-14 00:28:52 +0200 |
commit | 7a30111f57e3c8ed615fe59c7f86c46616bfffaf (patch) | |
tree | 43b2f55fbdd1509a36eaf1de588cf42a6c86d834 | |
parent | f11ea9b148a34a8d766fdeca1c24e3e0a35ba47a (diff) |
Renaming: 'Repository' -> 'MixxxDb'
-rw-r--r-- | build/depends.py | 4 | ||||
-rw-r--r-- | src/controllers/controllermanager.cpp | 2 | ||||
-rw-r--r-- | src/database/mixxxdb.cpp (renamed from src/repository/repository.cpp) | 24 | ||||
-rw-r--r-- | src/database/mixxxdb.h (renamed from src/repository/repository.h) | 18 | ||||
-rw-r--r-- | src/database/schemamanager.cpp (renamed from src/repository/schemamanager.cpp) | 2 | ||||
-rw-r--r-- | src/database/schemamanager.h (renamed from src/repository/schemamanager.h) | 0 | ||||
-rw-r--r-- | src/library/library.cpp | 18 | ||||
-rw-r--r-- | src/library/library.h | 8 | ||||
-rw-r--r-- | src/library/scanner/libraryscanner.cpp | 20 | ||||
-rw-r--r-- | src/preferences/dialog/dlgprefwaveform.cpp | 12 | ||||
-rw-r--r-- | src/preferences/upgrade.cpp | 14 | ||||
-rw-r--r-- | src/test/librarytest.h | 16 | ||||
-rw-r--r-- | src/test/queryutiltest.cpp | 8 | ||||
-rw-r--r-- | src/test/schemamanager_test.cpp | 36 | ||||
-rw-r--r-- | src/util/db/dbconnectionpool.cpp | 2 | ||||
-rw-r--r-- | src/util/db/dbconnectionpool.h | 4 |
16 files changed, 90 insertions, 98 deletions
diff --git a/build/depends.py b/build/depends.py index 60b8ddb325..a3b4fdd90e 100644 --- a/build/depends.py +++ b/build/depends.py @@ -886,8 +886,8 @@ class MixxxCore(Feature): "widget/wanalysislibrarytableview.cpp", "widget/wlibrarytextbrowser.cpp", - "repository/repository.cpp", - "repository/schemamanager.cpp", + "database/mixxxdb.cpp", + "database/schemamanager.cpp", "library/trackcollection.cpp", "library/basesqltablemodel.cpp", diff --git a/src/controllers/controllermanager.cpp b/src/controllers/controllermanager.cpp index 4e40783098..54029398d4 100644 --- a/src/controllers/controllermanager.cpp +++ b/src/controllers/controllermanager.cpp @@ -476,7 +476,7 @@ bool ControllerManager::importScript(const QString& scriptPath, << scriptPath; } - // The name we will save this file as in our local script repository. The + // The name we will save this file as in our local script mixxxdb. The // conflict resolution logic below will mutate this variable if the name is // already taken. QString scriptFileName = script.fileName(); diff --git a/src/repository/repository.cpp b/src/database/mixxxdb.cpp index 262fe31e53..2046129b44 100644 --- a/src/repository/repository.cpp +++ b/src/database/mixxxdb.cpp @@ -1,28 +1,26 @@ -#include "repository/repository.h" +#include "database/mixxxdb.h" -#include "repository/schemamanager.h" +#include "database/schemamanager.h" #include "util/assert.h" #include "util/logger.h" -namespace mixxx { - // The schema XML is baked into the binary via Qt resources. //static -const QString Repository::kDefaultSchemaFile(":/schema.xml"); +const QString MixxxDb::kDefaultSchemaFile(":/schema.xml"); //static -const int Repository::kRequiredSchemaVersion = 27; +const int MixxxDb::kRequiredSchemaVersion = 27; namespace { -const Logger kLogger("Repository"); +const mixxx::Logger kLogger("MixxxDb"); // The connection parameters for the main Mixxx DB -DbConnection::Params dbConnectionParams( +mixxx::DbConnection::Params dbConnectionParams( const UserSettingsPointer& pConfig) { - DbConnection::Params params; + mixxx::DbConnection::Params params; params.type = "QSQLITE"; params.hostName = "localhost"; params.filePath = QDir(pConfig->getSettingsPath()).filePath("mixxxdb.sqlite"); @@ -33,12 +31,12 @@ DbConnection::Params dbConnectionParams( } // anonymous namespace -Repository::Repository( +MixxxDb::MixxxDb( const UserSettingsPointer& pConfig) - : m_pDbConnectionPool(std::make_shared<DbConnectionPool>(dbConnectionParams(pConfig), "MIXXX")) { + : m_pDbConnectionPool(std::make_shared<mixxx::DbConnectionPool>(dbConnectionParams(pConfig), "MIXXX")) { } -bool Repository::initDatabaseSchema( +bool MixxxDb::initDatabaseSchema( const QSqlDatabase& database, const QString& schemaFile, int schemaVersion) { @@ -86,5 +84,3 @@ bool Repository::initDatabaseSchema( DEBUG_ASSERT(!"unhandled switch/case"); return false; } - -} // namespace mixxx diff --git a/src/repository/repository.h b/src/database/mixxxdb.h index 4bc8e5dd0d..4e5fe77182 100644 --- a/src/repository/repository.h +++ b/src/database/mixxxdb.h @@ -1,5 +1,5 @@ -#ifndef MIXXX_REPOSITORY_H -#define MIXXX_REPOSITORY_H +#ifndef MIXXXDB_H +#define MIXXXDB_H #include <QSqlDatabase> @@ -9,9 +9,7 @@ #include "util/db/dbconnectionpool.h" -namespace mixxx { - -class Repository : public QObject { +class MixxxDb : public QObject { Q_OBJECT public: @@ -24,18 +22,16 @@ class Repository : public QObject { const QString& schemaFile = kDefaultSchemaFile, int schemaVersion = kRequiredSchemaVersion); - explicit Repository( + explicit MixxxDb( const UserSettingsPointer& pConfig); - DbConnectionPoolPtr dbConnectionPool() const { + mixxx::DbConnectionPoolPtr connectionPool() const { return m_pDbConnectionPool; } private: - DbConnectionPoolPtr m_pDbConnectionPool; + mixxx::DbConnectionPoolPtr m_pDbConnectionPool; }; -} // namespace mixxx - -#endif // MIXXX_REPOSITORY_H +#endif // MIXXXDB_H diff --git a/src/repository/schemamanager.cpp b/src/database/schemamanager.cpp index de8d96781b..2e678fc8e1 100644 --- a/src/repository/schemamanager.cpp +++ b/src/database/schemamanager.cpp @@ -1,4 +1,4 @@ -#include "repository/schemamanager.h" +#include "database/schemamanager.h" #include "util/db/fwdsqlquery.h" #include "util/db/sqltransaction.h" diff --git a/src/repository/schemamanager.h b/src/database/schemamanager.h index a43cbd61e2..a43cbd61e2 100644 --- a/src/repository/schemamanager.h +++ b/src/database/schemamanager.h diff --git a/src/library/library.cpp b/src/library/library.cpp index 57ca81a9d5..49b4d4283a 100644 --- a/src/library/library.cpp +++ b/src/library/library.cpp @@ -6,7 +6,7 @@ #include <QTranslator> #include <QDir> -#include "repository/repository.h" +#include "database/mixxxdb.h" #include "mixer/playermanager.h" #include "library/library.h" @@ -62,13 +62,13 @@ Library::Library(QObject* parent, UserSettingsPointer pConfig, PlayerManagerInterface* pPlayerManager, RecordingManager* pRecordingManager) : m_pConfig(pConfig), - m_repository(pConfig), - m_dbConnectionScope(m_repository.dbConnectionPool()), + m_mixxxDb(pConfig), + m_dbConnectionScope(m_mixxxDb.connectionPool()), m_pSidebarModel(new SidebarModel(parent)), m_pTrackCollection(new TrackCollection(pConfig)), m_pLibraryControl(new LibraryControl(this)), m_pRecordingManager(pRecordingManager), - m_scanner(m_repository.dbConnectionPool(), m_pTrackCollection, pConfig) { + m_scanner(m_mixxxDb.connectionPool(), m_pTrackCollection, pConfig) { kLogger.info() << "Opening datbase connection"; if (!m_dbConnectionScope) { QMessageBox::critical(0, tr("Cannot open database"), @@ -80,11 +80,11 @@ Library::Library(QObject* parent, UserSettingsPointer pConfig, // TODO(XXX) something a little more elegant exit(-1); } - QSqlDatabase sqlDatabase(m_dbConnectionScope); - DEBUG_ASSERT(sqlDatabase.isOpen()); + QSqlDatabase dbConnection(m_dbConnectionScope); + DEBUG_ASSERT(dbConnection.isOpen()); kLogger.info() << "Initializing or upgrading database schema"; - if (!mixxx::Repository::initDatabaseSchema(sqlDatabase)) { + if (!MixxxDb::initDatabaseSchema(dbConnection)) { // TODO(XXX) something a little more elegant exit(-1); } @@ -93,13 +93,13 @@ Library::Library(QObject* parent, UserSettingsPointer pConfig, // and repairing the database on the next restart of the application. if (pConfig->getValue(kConfigKeyRepairDatabaseOnNextRestart, false)) { kLogger.info() << "Checking and repairing database (if necessary)"; - m_pTrackCollection->repairDatabase(sqlDatabase); + m_pTrackCollection->repairDatabase(dbConnection); // Reset config value pConfig->setValue(kConfigKeyRepairDatabaseOnNextRestart, false); } kLogger.info() << "Connecting database"; - m_pTrackCollection->connectDatabase(sqlDatabase); + m_pTrackCollection->connectDatabase(dbConnection); qRegisterMetaType<Library::RemovalType>("Library::RemovalType"); diff --git a/src/library/library.h b/src/library/library.h index fb4170bd45..6065980431 100644 --- a/src/library/library.h +++ b/src/library/library.h @@ -13,7 +13,7 @@ #include <QFont> #include "preferences/usersettings.h" -#include "repository/repository.h" +#include "database/mixxxdb.h" #include "track/track.h" #include "recording/recordingmanager.h" #include "analysisfeature.h" @@ -51,7 +51,7 @@ class Library : public QObject { virtual ~Library(); mixxx::DbConnectionPoolPtr dbConnectionPool() const { - return m_repository.dbConnectionPool(); + return m_mixxxDb.connectionPool(); } void bindWidget(WLibrary* libraryWidget, @@ -123,8 +123,8 @@ class Library : public QObject { private: UserSettingsPointer m_pConfig; - // The Mixxx repository in a SQLite3 database - mixxx::Repository m_repository; + // The Mixxx SQLite3 database + MixxxDb m_mixxxDb; // The Mixxx database connection for this (and only this!) thread const mixxx::DbConnectionPool::ThreadLocalScope m_dbConnectionScope; diff --git a/src/library/scanner/libraryscanner.cpp b/src/library/scanner/libraryscanner.cpp index 84ac64de8b..94dff6e5db 100644 --- a/src/library/scanner/libraryscanner.cpp +++ b/src/library/scanner/libraryscanner.cpp @@ -101,15 +101,15 @@ void LibraryScanner::run() { kLogger.debug() << "Exiting thread"; return; } - QSqlDatabase sqlDatabase(dbConnectionScope); - DEBUG_ASSERT(sqlDatabase.isOpen()); + QSqlDatabase dbConnection(dbConnectionScope); + DEBUG_ASSERT(dbConnection.isOpen()); - m_libraryHashDao.initialize(sqlDatabase); - m_cueDao.initialize(sqlDatabase); - m_trackDao.initialize(sqlDatabase); - m_playlistDao.initialize(sqlDatabase); - m_analysisDao.initialize(sqlDatabase); - m_directoryDao.initialize(sqlDatabase); + m_libraryHashDao.initialize(dbConnection); + m_cueDao.initialize(dbConnection); + m_trackDao.initialize(dbConnection); + m_playlistDao.initialize(dbConnection); + m_analysisDao.initialize(dbConnection); + m_directoryDao.initialize(dbConnection); // Start the event loop. kLogger.debug() << "Event loop starting"; @@ -240,8 +240,8 @@ void LibraryScanner::cleanUpScan() { // Start a transaction for all the library hashing (moved file // detection) stuff. - QSqlDatabase database = m_pDbConnectionPool->threadLocalConnection(); - ScopedTransaction transaction(database); + QSqlDatabase dbConnection = m_pDbConnectionPool->threadLocalConnection(); + ScopedTransaction transaction(dbConnection); kLogger.debug() << "Marking tracks in changed directories as verified"; m_trackDao.markTrackLocationsAsVerified(m_scannerGlobal->verifiedTracks()); diff --git a/src/preferences/dialog/dlgprefwaveform.cpp b/src/preferences/dialog/dlgprefwaveform.cpp index c42cecef5c..5a089a6310 100644 --- a/src/preferences/dialog/dlgprefwaveform.cpp +++ b/src/preferences/dialog/dlgprefwaveform.cpp @@ -219,17 +219,17 @@ void DlgPrefWaveform::slotWaveformMeasured(float frameRate, int droppedFrames) { void DlgPrefWaveform::slotClearCachedWaveforms() { AnalysisDao analysisDao(m_pConfig); - QSqlDatabase sqlDatabase(m_pLibrary->dbConnectionPool()->threadLocalConnection()); - analysisDao.deleteAnalysesByType(sqlDatabase, AnalysisDao::TYPE_WAVEFORM); - analysisDao.deleteAnalysesByType(sqlDatabase, AnalysisDao::TYPE_WAVESUMMARY); + QSqlDatabase dbConnection(m_pLibrary->dbConnectionPool()->threadLocalConnection()); + analysisDao.deleteAnalysesByType(dbConnection, AnalysisDao::TYPE_WAVEFORM); + analysisDao.deleteAnalysesByType(dbConnection, AnalysisDao::TYPE_WAVESUMMARY); calculateCachedWaveformDiskUsage(); } void DlgPrefWaveform::calculateCachedWaveformDiskUsage() { AnalysisDao analysisDao(m_pConfig); - QSqlDatabase sqlDatabase(m_pLibrary->dbConnectionPool()->threadLocalConnection()); - size_t numBytes = analysisDao.getDiskUsageInBytes(sqlDatabase, AnalysisDao::TYPE_WAVEFORM) + - analysisDao.getDiskUsageInBytes(sqlDatabase, AnalysisDao::TYPE_WAVESUMMARY); + QSqlDatabase dbConnection(m_pLibrary->dbConnectionPool()->threadLocalConnection()); + size_t numBytes = analysisDao.getDiskUsageInBytes(dbConnection, AnalysisDao::TYPE_WAVEFORM) + + analysisDao.getDiskUsageInBytes(dbConnection, AnalysisDao::TYPE_WAVESUMMARY); // Display total cached waveform size in mebibytes with 2 decimals. QString sizeMebibytes = QString::number( diff --git a/src/preferences/upgrade.cpp b/src/preferences/upgrade.cpp index 72f2a498ec..c2ea2429dd 100644 --- a/src/preferences/upgrade.cpp +++ b/src/preferences/upgrade.cpp @@ -24,7 +24,7 @@ #include <QScopedPointer> #include "preferences/usersettings.h" -#include "repository/repository.h" +#include "database/mixxxdb.h" #include "controllers/defs_controllers.h" #include "defs_version.h" #include "library/library_preferences.h" @@ -361,15 +361,15 @@ UserSettingsPointer Upgrade::versionUpgrade(const QString& settingsPath) { qDebug() << "Upgrading from v1.11.x..."; bool successful = false; { - mixxx::Repository repository(config); + MixxxDb mixxxDb(config); const mixxx::DbConnectionPool::ThreadLocalScope dbConnectionScope( - repository.dbConnectionPool()); + mixxxDb.connectionPool()); if (dbConnectionScope) { - QSqlDatabase sqlDatabase(dbConnectionScope); - DEBUG_ASSERT(sqlDatabase.isOpen()); - if (mixxx::Repository::initDatabaseSchema(sqlDatabase)) { + QSqlDatabase connection(dbConnectionScope); + DEBUG_ASSERT(connection.isOpen()); + if (MixxxDb::initDatabaseSchema(connection)) { TrackCollection tc(config); - tc.connectDatabase(sqlDatabase); + tc.connectDatabase(connection); // upgrade to the multi library folder settings QString currentFolder = config->getValueString(PREF_LEGACY_LIBRARY_DIR); diff --git a/src/test/librarytest.h b/src/test/librarytest.h index 9abbefdf5a..17511079d0 100644 --- a/src/test/librarytest.h +++ b/src/test/librarytest.h @@ -3,26 +3,26 @@ #include "test/mixxxtest.h" -#include "repository/repository.h" +#include "database/mixxxdb.h" #include "library/trackcollection.h" class LibraryTest : public MixxxTest { protected: LibraryTest() - : m_repository(config()), - m_dbConnectionScope(m_repository.dbConnectionPool()), + : m_mixxxDb(config()), + m_dbConnectionScope(m_mixxxDb.connectionPool()), m_trackCollection(config()) { - QSqlDatabase sqlDatabase(m_dbConnectionScope); - mixxx::Repository::initDatabaseSchema(sqlDatabase); - m_trackCollection.connectDatabase(sqlDatabase); + QSqlDatabase dbConnection(m_dbConnectionScope); + MixxxDb::initDatabaseSchema(dbConnection); + m_trackCollection.connectDatabase(dbConnection); } ~LibraryTest() override { m_trackCollection.disconnectDatabase(); } mixxx::DbConnectionPoolPtr dbConnectionPool() const { - return m_repository.dbConnectionPool(); + return m_mixxxDb.connectionPool(); } const mixxx::DbConnectionPool::ThreadLocalScope& dbConnectionScope() const { @@ -34,7 +34,7 @@ class LibraryTest : public MixxxTest { } private: - mixxx::Repository m_repository; + MixxxDb m_mixxxDb; const mixxx::DbConnectionPool::ThreadLocalScope m_dbConnectionScope; TrackCollection m_trackCollection; }; diff --git a/src/test/queryutiltest.cpp b/src/test/queryutiltest.cpp index ebcc6d5efb..7f71d0eaae 100644 --- a/src/test/queryutiltest.cpp +++ b/src/test/queryutiltest.cpp @@ -2,7 +2,7 @@ #include "test/mixxxtest.h" -#include "repository/repository.h" +#include "database/mixxxdb.h" #include "library/queryutil.h" #include "util/db/sqllikewildcardescaper.h" @@ -10,14 +10,14 @@ class QueryUtilTest : public MixxxTest { protected: QueryUtilTest() - : m_repository(config()), - m_dbConnectionScope(m_repository.dbConnectionPool()) { + : m_mixxxDb(config()), + m_dbConnectionScope(m_mixxxDb.connectionPool()) { // This test only needs a connection to an empty database // without any particular schema. No need to initialize the // database schema. } - mixxx::Repository m_repository; + MixxxDb m_mixxxDb; const mixxx::DbConnectionPool::ThreadLocalScope m_dbConnectionScope; }; diff --git a/src/test/schemamanager_test.cpp b/src/test/schemamanager_test.cpp index 6b458b4295..7168dd3c31 100644 --- a/src/test/schemamanager_test.cpp +++ b/src/test/schemamanager_test.cpp @@ -2,8 +2,8 @@ #include "test/mixxxtest.h" -#include "repository/repository.h" -#include "repository/schemamanager.h" +#include "database/mixxxdb.h" +#include "database/schemamanager.h" #include "library/dao/settingsdao.h" @@ -13,8 +13,8 @@ class SchemaManagerTest : public MixxxTest { protected: SchemaManagerTest() - : m_repository(config()), - m_dbConnectionScope(m_repository.dbConnectionPool()) { + : m_mixxxDb(config()), + m_dbConnectionScope(m_mixxxDb.connectionPool()) { } const mixxx::DbConnectionPool::ThreadLocalScope& dbConnectionScope() const { @@ -22,7 +22,7 @@ class SchemaManagerTest : public MixxxTest { } private: - mixxx::Repository m_repository; + MixxxDb m_mixxxDb; const mixxx::DbConnectionPool::ThreadLocalScope m_dbConnectionScope; }; @@ -31,14 +31,14 @@ TEST_F(SchemaManagerTest, CanUpgradeFreshDatabaseToRequiredVersion) { { SchemaManager schemaManager(dbConnectionScope()); SchemaManager::Result result = schemaManager.upgradeToSchemaVersion( - mixxx::Repository::kDefaultSchemaFile, mixxx::Repository::kRequiredSchemaVersion); + MixxxDb::kDefaultSchemaFile, MixxxDb::kRequiredSchemaVersion); EXPECT_EQ(SchemaManager::Result::UpgradeSucceeded, result); } // Subsequent upgrade(s) { SchemaManager schemaManager(dbConnectionScope()); SchemaManager::Result result = schemaManager.upgradeToSchemaVersion( - mixxx::Repository::kDefaultSchemaFile, mixxx::Repository::kRequiredSchemaVersion); + MixxxDb::kDefaultSchemaFile, MixxxDb::kRequiredSchemaVersion); EXPECT_EQ(SchemaManager::Result::CurrentVersion, result); } } @@ -46,7 +46,7 @@ TEST_F(SchemaManagerTest, CanUpgradeFreshDatabaseToRequiredVersion) { TEST_F(SchemaManagerTest, NonExistentSchema) { SchemaManager schemaManager(dbConnectionScope()); SchemaManager::Result result = schemaManager.upgradeToSchemaVersion( - ":file_doesnt_exist.xml", mixxx::Repository::kRequiredSchemaVersion); + ":file_doesnt_exist.xml", MixxxDb::kRequiredSchemaVersion); EXPECT_EQ(SchemaManager::Result::SchemaError, result); } @@ -56,7 +56,7 @@ TEST_F(SchemaManagerTest, BackwardsCompatibleVersion) { // Upgrade to version 1 to get the settings table. SchemaManager schemaManager(dbConnectionScope()); SchemaManager::Result result = schemaManager.upgradeToSchemaVersion( - mixxx::Repository::kDefaultSchemaFile, 1); + MixxxDb::kDefaultSchemaFile, 1); EXPECT_EQ(SchemaManager::Result::UpgradeSucceeded, result); SettingsDAO settings(dbConnectionScope()); @@ -65,14 +65,14 @@ TEST_F(SchemaManagerTest, BackwardsCompatibleVersion) { // Pretend the database version is one past the required version but // min_compatible is the required version. settings.setValue(SchemaManager::SETTINGS_VERSION_STRING, - mixxx::Repository::kRequiredSchemaVersion + 1); + MixxxDb::kRequiredSchemaVersion + 1); settings.setValue(SchemaManager::SETTINGS_MINCOMPATIBLE_STRING, - mixxx::Repository::kRequiredSchemaVersion); + MixxxDb::kRequiredSchemaVersion); } SchemaManager schemaManager(dbConnectionScope()); SchemaManager::Result result = schemaManager.upgradeToSchemaVersion( - mixxx::Repository::kDefaultSchemaFile, mixxx::Repository::kRequiredSchemaVersion); + MixxxDb::kDefaultSchemaFile, MixxxDb::kRequiredSchemaVersion); EXPECT_EQ(SchemaManager::Result::NewerVersionBackwardsCompatible, result); } @@ -82,7 +82,7 @@ TEST_F(SchemaManagerTest, BackwardsIncompatibleVersion) { // Upgrade to version 1 to get the settings table. SchemaManager schemaManager(dbConnectionScope()); SchemaManager::Result result = schemaManager.upgradeToSchemaVersion( - mixxx::Repository::kDefaultSchemaFile, 1); + MixxxDb::kDefaultSchemaFile, 1); EXPECT_EQ(SchemaManager::Result::UpgradeSucceeded, result); SettingsDAO settings(dbConnectionScope()); @@ -91,14 +91,14 @@ TEST_F(SchemaManagerTest, BackwardsIncompatibleVersion) { // Pretend the database version is one past the required version and // min_compatible is one past the required version. settings.setValue(SchemaManager::SETTINGS_VERSION_STRING, - mixxx::Repository::kRequiredSchemaVersion + 1); + MixxxDb::kRequiredSchemaVersion + 1); settings.setValue(SchemaManager::SETTINGS_MINCOMPATIBLE_STRING, - mixxx::Repository::kRequiredSchemaVersion + 1); + MixxxDb::kRequiredSchemaVersion + 1); } SchemaManager schemaManager(dbConnectionScope()); SchemaManager::Result result = schemaManager.upgradeToSchemaVersion( - mixxx::Repository::kDefaultSchemaFile, mixxx::Repository::kRequiredSchemaVersion); + MixxxDb::kDefaultSchemaFile, MixxxDb::kRequiredSchemaVersion); EXPECT_EQ(SchemaManager::Result::NewerVersionIncompatible, result); } @@ -108,7 +108,7 @@ TEST_F(SchemaManagerTest, FailedUpgrade) { // Upgrade to version 3 to get the modern library table. SchemaManager schemaManager(dbConnectionScope()); SchemaManager::Result result = schemaManager.upgradeToSchemaVersion( - mixxx::Repository::kDefaultSchemaFile, 3); + MixxxDb::kDefaultSchemaFile, 3); EXPECT_EQ(SchemaManager::Result::UpgradeSucceeded, result); } @@ -119,6 +119,6 @@ TEST_F(SchemaManagerTest, FailedUpgrade) { SchemaManager schemaManager(dbConnectionScope()); SchemaManager::Result result = schemaManager.upgradeToSchemaVersion( - mixxx::Repository::kDefaultSchemaFile, mixxx::Repository::kRequiredSchemaVersion); + MixxxDb::kDefaultSchemaFile, MixxxDb::kRequiredSchemaVersion); EXPECT_EQ(SchemaManager::Result::UpgradeFailed, result); } diff --git a/src/util/db/dbconnectionpool.cpp b/src/util/db/dbconnectionpool.cpp index 6cf93ab155..12d6b7fdd4 100644 --- a/src/util/db/dbconnectionpool.cpp +++ b/src/util/db/dbconnectionpool.cpp @@ -75,7 +75,7 @@ DbConnectionPool::ThreadLocalScope::ThreadLocalScope( DbConnectionPoolPtr pDbConnectionPool) { if (pDbConnectionPool && pDbConnectionPool->createThreadLocalConnection()) { m_pDbConnectionPool = std::move(pDbConnectionPool); - m_sqlDatabase = m_pDbConnectionPool->threadLocalConnection(); + m_dbConnection = m_pDbConnectionPool->threadLocalConnection(); } } diff --git a/src/util/db/dbconnectionpool.h b/src/util/db/dbconnectionpool.h index edfdb79678..7e16d4f158 100644 --- a/src/util/db/dbconnectionpool.h +++ b/src/util/db/dbconnectionpool.h @@ -46,7 +46,7 @@ class DbConnectionPool final { } operator QSqlDatabase() const { - return m_sqlDatabase; + return m_dbConnection; } private: @@ -55,7 +55,7 @@ class DbConnectionPool final { ThreadLocalScope& operator=(ThreadLocalScope&&) = delete; DbConnectionPoolPtr m_pDbConnectionPool; - QSqlDatabase m_sqlDatabase; + QSqlDatabase m_dbConnection; }; private: |