diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2019-11-24 12:14:55 +0100 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2019-11-24 12:40:04 +0100 |
commit | c930736caf594834da200c78f60fce4508e012bc (patch) | |
tree | 5482533dc6ad2568e78e8690bf9b830502abfe98 | |
parent | 2d9e84756407f643cce51295cb22516bc7bfaf89 (diff) |
Don't pass QPointer around
-rw-r--r-- | src/library/library.cpp | 5 | ||||
-rw-r--r-- | src/library/library.h | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/library/library.cpp b/src/library/library.cpp index ccb416391e..d15c409787 100644 --- a/src/library/library.cpp +++ b/src/library/library.cpp @@ -211,6 +211,11 @@ Library::~Library() { // Empty but required due to forward declarations in header file! } +TrackCollectionManager* Library::trackCollections() const { + // Cannot be implimented inline due to forward declarations + return m_pTrackCollectionManager; +} + void Library::stopPendingTasks() { if (m_pAnalysisFeature) { m_pAnalysisFeature->stopAnalysis(); diff --git a/src/library/library.h b/src/library/library.h index a142d5401f..1554b6ca04 100644 --- a/src/library/library.h +++ b/src/library/library.h @@ -52,9 +52,7 @@ class Library: public QObject { return m_pDbConnectionPool; } - const QPointer<TrackCollectionManager>& trackCollections() const { - return m_pTrackCollectionManager; - } + TrackCollectionManager* trackCollections() const; // Deprecated: Obtain directly from TrackCollectionManager TrackCollection& trackCollection(); @@ -130,7 +128,7 @@ class Library: public QObject { // The Mixxx database connection pool const mixxx::DbConnectionPoolPtr m_pDbConnectionPool; - QPointer<TrackCollectionManager> m_pTrackCollectionManager; + const QPointer<TrackCollectionManager> m_pTrackCollectionManager; SidebarModel* m_pSidebarModel; |