1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Dependency cleanup (#627)

* DBConnection doesn't use ProjectFileIO or need friendship...

... Instead, it is given its own weak_ptr to the project

* Demote the bypass flag into DBConnection...

... So SqliteSampleBlock needs ProjectFileIO only to get the DBConnection

* Accessor functions for the connection objects for SqliteSampleBlock

* Another level of indirection to get to the DBConnection object...

... The document holds the unique_ptr to DBConnection in an attached object;
later we want the SqliteSampleBlockFactory to locate the same pointer without
using ProjectFileIO

* SqliteSampleBlock and its factory don't use class ProjectFileIO...

... Instead they share a pointer to the pointer to the current DBConnection.

This means they no longer know how to invoke the lazy opening of that
connection.

So just require that this be done before any operations on blocks happen.  If
it hasn't, throw and let the application recover.

* ProjectFileIO no longer needs weak_ptr to Project for safety...

... so eliminate much ugliness from 127696879d

* Move DBConnection to new files...

... And SqliteSampleBlock does not depend on ProjectFileIO.

* SampleBlock.h doesn't need ClientData.h

* Function ProjectFileIO::Conn() isn't needed
This commit is contained in:
Paul Licameli
2020-07-23 02:04:46 -04:00
committed by GitHub
parent 38e830edf0
commit a3fcd611b5
9 changed files with 535 additions and 441 deletions

View File

@@ -536,7 +536,6 @@ AudacityProject *ProjectManager::New()
InitProjectWindow( window );
auto &projectFileIO = ProjectFileIO::Get( *p );
projectFileIO.Init( *p );
projectFileIO.SetProjectTitle();
MenuManager::Get( project ).CreateMenusAndCommands( project );