diff options
author | Uwe Klotz <uwe_klotz@web.de> | 2017-01-24 19:17:16 +0100 |
---|---|---|
committer | Uwe Klotz <uwe_klotz@web.de> | 2017-01-29 21:16:04 +0100 |
commit | 726d9fe15e884005ea9b9130d1e7eb92016f7d8d (patch) | |
tree | 21729b76369509f3ee8c150449240a3b2a9534f1 /src/library/library.cpp | |
parent | 7d49c99e458c69cc17561e208a16e21ad6e6e9cc (diff) |
Replace CrateDAO with CrateStorage
...with TrackCollection as a controller for accessing all library entities
in the database.
All classes in the data access layer ("storage" classes) should not send
or receive signals. All coordination and signal routing must be implemented
in a controller, namely TrackCollection (for the time being). The existing
"design" where every QObject is communicating with its siblings in
uncontrollable ways is error prone and unmaintainable chaos.
TrackCollection must become a controller and the facade for all write
operations while read operations might still be called directly on the
individual storage classes. TrackCollection may provide additional
read operations that aggregate results from multiple queries.
Currently this new design has only been implemented for CrateStorage
(formerly known as CrateDAO). It serves as a prototype and blueprint
for others. And it demonstrates how to use transactions correctly.
We need a solid foundation before adding another layer for
asynchronous (= "multi-threaded") database access.
Diffstat (limited to 'src/library/library.cpp')
-rw-r--r-- | src/library/library.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library/library.cpp b/src/library/library.cpp index 41e636af47..efa9f1db3b 100644 --- a/src/library/library.cpp +++ b/src/library/library.cpp @@ -15,7 +15,7 @@ #include "library/trackcollection.h" #include "library/trackmodel.h" #include "library/browse/browsefeature.h" -#include "library/cratefeature.h" +#include "library/crate/cratefeature.h" #include "library/rhythmbox/rhythmboxfeature.h" #include "library/banshee/bansheefeature.h" #include "library/recording/recordingfeature.h" @@ -327,7 +327,7 @@ void Library::slotRequestRemoveDir(QString dir, RemovalType removalType) { break; case Library::PurgeTracks: // The user requested that we purge all metadata. - m_pTrackCollection->getTrackDAO().purgeTracks(dir); + m_pTrackCollection->purgeTracks(dir); break; case Library::LeaveTracksUnchanged: default: |