Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create TrackSetTableModel as base for Crate- & PlaylistTableModel #2717

Merged
merged 7 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reformat constructors
  • Loading branch information
xeruf committed May 19, 2020
commit 1afd4babd93416d223be76fe113ecfae01553111
13 changes: 8 additions & 5 deletions src/library/basesqltablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ const QString kEmptyString = QStringLiteral("");

} // anonymous namespace

BaseSqlTableModel::BaseSqlTableModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager, const char* settingsNamespace)
BaseSqlTableModel::BaseSqlTableModel(
QObject* parent,
TrackCollectionManager* pTrackCollectionManager,
const char* settingsNamespace)
: BaseTrackTableModel(parent, pTrackCollectionManager, settingsNamespace),
uklotzde marked this conversation as resolved.
Show resolved Hide resolved
m_pTrackCollectionManager(pTrackCollectionManager),
m_database(pTrackCollectionManager->internalCollection()->database()),
m_bInitialized(false),
m_currentSearch(kEmptyString) {
m_pTrackCollectionManager(pTrackCollectionManager),
m_database(pTrackCollectionManager->internalCollection()->database()),
m_bInitialized(false),
m_currentSearch(kEmptyString) {
}

BaseSqlTableModel::~BaseSqlTableModel() {
Expand Down
5 changes: 4 additions & 1 deletion src/library/basetracktablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ QStringList BaseTrackTableModel::defaultTableColumns() {
return kDefaultTableColumns;
}

BaseTrackTableModel::BaseTrackTableModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager, const char* settingsNamespace)
BaseTrackTableModel::BaseTrackTableModel(
QObject* parent,
TrackCollectionManager* pTrackCollectionManager,
const char* settingsNamespace)
: QAbstractTableModel(parent),
TrackModel(cloneDatabase(pTrackCollectionManager), settingsNamespace),
m_pTrackCollectionManager(pTrackCollectionManager),
Expand Down
9 changes: 4 additions & 5 deletions src/library/crate/cratetablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
#include "mixer/playermanager.h"
#include "util/db/fwdsqlquery.h"

#include <QtDebug>

CrateTableModel::CrateTableModel(QObject* pParent, TrackCollectionManager* pTrackCollectionManager)
: TrackSetTableModel(pParent, pTrackCollectionManager,
"mixxx.db.model.crate") {
CrateTableModel::CrateTableModel(
QObject* pParent,
TrackCollectionManager* pTrackCollectionManager)
: TrackSetTableModel(pParent, pTrackCollectionManager, "mixxx.db.model.crate") {
}

void CrateTableModel::selectCrate(CrateId crateId) {
Expand Down
11 changes: 5 additions & 6 deletions src/library/playlisttablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
#include "library/trackcollection.h"
#include "library/trackcollectionmanager.h"

#include "mixer/playermanager.h"

PlaylistTableModel::PlaylistTableModel(QObject* parent,
TrackCollectionManager* pTrackCollectionManager,
const char* settingsNamespace,
bool keepDeletedTracks)
PlaylistTableModel::PlaylistTableModel(
QObject* parent,
TrackCollectionManager* pTrackCollectionManager,
const char* settingsNamespace,
bool keepDeletedTracks)
: TrackSetTableModel(parent, pTrackCollectionManager, settingsNamespace),
m_iPlaylistId(-1),
m_keepDeletedTracks(keepDeletedTracks) {
Expand Down
5 changes: 4 additions & 1 deletion src/library/tracksettablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

#include "mixer/playermanager.h"

TrackSetTableModel::TrackSetTableModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager, const char* settingsNamespace)
TrackSetTableModel::TrackSetTableModel(
QObject* parent,
TrackCollectionManager* pTrackCollectionManager,
const char* settingsNamespace)
: BaseSqlTableModel(parent, pTrackCollectionManager, settingsNamespace) {
}

Expand Down