diff --git a/src/library/autodj/autodjfeature.cpp b/src/library/autodj/autodjfeature.cpp index f0cf78c3246..659338d0913 100644 --- a/src/library/autodj/autodjfeature.cpp +++ b/src/library/autodj/autodjfeature.cpp @@ -2,20 +2,20 @@ // FORK FORK FORK on 11/1/2009 by Albert Santoni (alberts@mixxx.org) // Created 8/23/2009 by RJ Ryan (rryan@mit.edu) -#include -#include -#include - #include "library/autodj/autodjfeature.h" +#include +#include +#include + #include "controllers/keyboard/keyboardeventfilter.h" #include "library/autodj/autodjprocessor.h" #include "library/autodj/dlgautodj.h" -#include "library/trackset/crate/cratestorage.h" #include "library/library.h" #include "library/parser.h" #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" +#include "library/trackset/crate/cratestorage.h" #include "library/treeitem.h" #include "mixer/playermanager.h" #include "sources/soundsourceproxy.h" diff --git a/src/library/autodj/autodjfeature.h b/src/library/autodj/autodjfeature.h index 74db1128639..5b23464d0d2 100644 --- a/src/library/autodj/autodjfeature.h +++ b/src/library/autodj/autodjfeature.h @@ -5,22 +5,22 @@ #ifndef AUTODJFEATURE_H #define AUTODJFEATURE_H -#include -#include -#include +#include #include -#include #include #include +#include #include -#include #include +#include +#include +#include +#include "library/dao/autodjcratesdao.h" #include "library/libraryfeature.h" -#include "preferences/usersettings.h" -#include "library/treeitemmodel.h" #include "library/trackset/crate/crate.h" -#include "library/dao/autodjcratesdao.h" +#include "library/treeitemmodel.h" +#include "preferences/usersettings.h" class DlgAutoDJ; class Library; diff --git a/src/library/banshee/bansheeplaylistmodel.cpp b/src/library/banshee/bansheeplaylistmodel.cpp index c579225ed78..d8242379c84 100644 --- a/src/library/banshee/bansheeplaylistmodel.cpp +++ b/src/library/banshee/bansheeplaylistmodel.cpp @@ -195,7 +195,11 @@ void BansheePlaylistModel::setTableModel(int playlistId) { << CLM_COMPOSER; QSharedPointer trackSource( - new BaseTrackCache(m_pTrackCollectionManager->internalCollection(), m_tempTableName, CLM_TRACK_ID, trackSourceColumns, false)); + new BaseTrackCache(m_pTrackCollectionManager->internalCollection(), + m_tempTableName, + CLM_TRACK_ID, + trackSourceColumns, + false)); setTable(m_tempTableName, CLM_TRACK_ID, tableColumns, trackSource); setSearch(""); diff --git a/src/library/browse/browsetablemodel.cpp b/src/library/browse/browsetablemodel.cpp index 39111e2060c..a57739a69fd 100644 --- a/src/library/browse/browsetablemodel.cpp +++ b/src/library/browse/browsetablemodel.cpp @@ -159,10 +159,11 @@ TrackPointer BrowseTableModel::getTrack(const QModelIndex& index) const { TrackPointer BrowseTableModel::getTrackByRef(const TrackRef& trackRef) const { if (m_pRecordingManager->getRecordingLocation() == trackRef.getLocation()) { - QMessageBox::critical( - 0, + QMessageBox::critical(0, tr("Mixxx Library"), - tr("Could not load the following file because it is in use by Mixxx or another application.") + "\n" + trackRef.getLocation()); + tr("Could not load the following file because it is in use by " + "Mixxx or another application.") + + "\n" + trackRef.getLocation()); return TrackPointer(); } // NOTE(uklotzde, 2015-12-08): Accessing tracks from the browse view diff --git a/src/library/dao/autodjcratesdao.cpp b/src/library/dao/autodjcratesdao.cpp index 1b13d71719f..6f76a70c6d5 100644 --- a/src/library/dao/autodjcratesdao.cpp +++ b/src/library/dao/autodjcratesdao.cpp @@ -1,16 +1,16 @@ +#include "library/dao/autodjcratesdao.h" + #include #include -#include "library/dao/autodjcratesdao.h" - -#include "mixer/playerinfo.h" -#include "mixer/playermanager.h" -#include "library/trackset/crate/crateschema.h" #include "library/dao/settingsdao.h" #include "library/dao/trackdao.h" #include "library/dao/trackschema.h" #include "library/queryutil.h" #include "library/trackcollection.h" +#include "library/trackset/crate/crateschema.h" +#include "mixer/playerinfo.h" +#include "mixer/playermanager.h" #define AUTODJCRATESTABLE_TRACKID "track_id" #define AUTODJCRATESTABLE_CRATEREFS "craterefs" diff --git a/src/library/dao/autodjcratesdao.h b/src/library/dao/autodjcratesdao.h index 74c4d2bd120..46974008850 100644 --- a/src/library/dao/autodjcratesdao.h +++ b/src/library/dao/autodjcratesdao.h @@ -4,8 +4,8 @@ #include #include -#include "preferences/usersettings.h" #include "library/trackset/crate/crateid.h" +#include "preferences/usersettings.h" #include "track/track.h" #include "util/class.h" diff --git a/src/library/dao/playlistdao.cpp b/src/library/dao/playlistdao.cpp index 918bcc4dd56..bd37244fdf1 100644 --- a/src/library/dao/playlistdao.cpp +++ b/src/library/dao/playlistdao.cpp @@ -876,7 +876,9 @@ void PlaylistDAO::searchForDuplicateTrack(const int fromPosition, } } -void PlaylistDAO::shuffleTracks(const int playlistId, const QList& positions, const QHash& allIds) { +void PlaylistDAO::shuffleTracks(const int playlistId, + const QList& positions, + const QHash& allIds) { ScopedTransaction transaction(m_database); QSqlQuery query(m_database); diff --git a/src/library/dao/trackdao.cpp b/src/library/dao/trackdao.cpp index 17688572b8b..a2bde18e37e 100644 --- a/src/library/dao/trackdao.cpp +++ b/src/library/dao/trackdao.cpp @@ -1,43 +1,42 @@ #include "library/dao/trackdao.h" -#include +#include #include #include #include -#include #include #include -#include +#include +#include -#include "sources/soundsourceproxy.h" -#include "track/track.h" -#include "library/queryutil.h" -#include "util/db/sqlstringformatter.h" -#include "util/db/sqllikewildcards.h" -#include "util/db/sqllikewildcardescaper.h" -#include "util/db/sqltransaction.h" #include "library/coverart.h" #include "library/coverartutils.h" -#include "library/dao/trackschema.h" -#include "library/trackset/crate/cratestorage.h" -#include "library/dao/cuedao.h" -#include "library/dao/playlistdao.h" #include "library/dao/analysisdao.h" +#include "library/dao/cuedao.h" #include "library/dao/libraryhashdao.h" +#include "library/dao/playlistdao.h" +#include "library/dao/trackschema.h" +#include "library/queryutil.h" +#include "library/trackset/crate/cratestorage.h" +#include "sources/soundsourceproxy.h" #include "track/beatfactory.h" #include "track/beats.h" +#include "track/globaltrackcache.h" #include "track/keyfactory.h" #include "track/keyutils.h" -#include "track/globaltrackcache.h" +#include "track/track.h" #include "track/tracknumbers.h" #include "util/assert.h" #include "util/compatibility.h" #include "util/datetime.h" +#include "util/db/sqllikewildcardescaper.h" +#include "util/db/sqllikewildcards.h" +#include "util/db/sqlstringformatter.h" +#include "util/db/sqltransaction.h" #include "util/file.h" #include "util/logger.h" -#include "util/timer.h" #include "util/math.h" - +#include "util/timer.h" namespace { diff --git a/src/library/hiddentablemodel.cpp b/src/library/hiddentablemodel.cpp index 4132d922119..b46bde650ec 100644 --- a/src/library/hiddentablemodel.cpp +++ b/src/library/hiddentablemodel.cpp @@ -38,7 +38,10 @@ void HiddenTableModel::setTableModel() { QStringList tableColumns; tableColumns << LIBRARYTABLE_ID; - setTable(tableName, LIBRARYTABLE_ID, tableColumns, m_pTrackCollectionManager->internalCollection()->getTrackSource()); + setTable(tableName, + LIBRARYTABLE_ID, + tableColumns, + m_pTrackCollectionManager->internalCollection()->getTrackSource()); setDefaultSort(fieldIndex("artist"), Qt::AscendingOrder); setSearch(""); } diff --git a/src/library/library.cpp b/src/library/library.cpp index 1cccb1b6e56..926950fa27b 100644 --- a/src/library/library.cpp +++ b/src/library/library.cpp @@ -12,7 +12,6 @@ #include "library/autodj/autodjfeature.h" #include "library/banshee/bansheefeature.h" #include "library/browse/browsefeature.h" -#include "library/trackset/crate/cratefeature.h" #include "library/externaltrackcollection.h" #include "library/itunes/itunesfeature.h" #include "library/library_preferences.h" @@ -28,6 +27,7 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "library/trackmodel.h" +#include "library/trackset/crate/cratefeature.h" #include "library/trackset/playlistfeature.h" #include "library/trackset/setlogfeature.h" #include "library/traktor/traktorfeature.h" @@ -117,33 +117,49 @@ Library::Library( addFeature(new SetlogFeature(this, UserSettingsPointer(m_pConfig))); m_pAnalysisFeature = new AnalysisFeature(this, m_pConfig); - connect(m_pPlaylistFeature, &PlaylistFeature::analyzeTracks, m_pAnalysisFeature, &AnalysisFeature::analyzeTracks); - connect(m_pCrateFeature, &CrateFeature::analyzeTracks, m_pAnalysisFeature, &AnalysisFeature::analyzeTracks); + connect(m_pPlaylistFeature, + &PlaylistFeature::analyzeTracks, + m_pAnalysisFeature, + &AnalysisFeature::analyzeTracks); + connect(m_pCrateFeature, + &CrateFeature::analyzeTracks, + m_pAnalysisFeature, + &AnalysisFeature::analyzeTracks); addFeature(m_pAnalysisFeature); // Suspend a batch analysis while an ad-hoc analysis of // loaded tracks is in progress and resume it afterwards. - connect(pPlayerManager, &PlayerManager::trackAnalyzerProgress, this, &Library::onPlayerManagerTrackAnalyzerProgress); - connect(pPlayerManager, &PlayerManager::trackAnalyzerIdle, this, &Library::onPlayerManagerTrackAnalyzerIdle); + connect(pPlayerManager, + &PlayerManager::trackAnalyzerProgress, + this, + &Library::onPlayerManagerTrackAnalyzerProgress); + connect(pPlayerManager, + &PlayerManager::trackAnalyzerIdle, + this, + &Library::onPlayerManagerTrackAnalyzerIdle); // iTunes and Rhythmbox should be last until we no longer have an obnoxious // messagebox popup when you select them. (This forces you to reach for your // mouse or keyboard if you're using MIDI control and you scroll through them...) if (RhythmboxFeature::isSupported() && - m_pConfig->getValue(ConfigKey(kConfigGroup, "ShowRhythmboxLibrary"), true)) { + m_pConfig->getValue( + ConfigKey(kConfigGroup, "ShowRhythmboxLibrary"), true)) { addFeature(new RhythmboxFeature(this, m_pConfig)); } - if (m_pConfig->getValue(ConfigKey(kConfigGroup, "ShowBansheeLibrary"), true)) { + if (m_pConfig->getValue( + ConfigKey(kConfigGroup, "ShowBansheeLibrary"), true)) { BansheeFeature::prepareDbPath(m_pConfig); if (BansheeFeature::isSupported()) { addFeature(new BansheeFeature(this, m_pConfig)); } } if (ITunesFeature::isSupported() && - m_pConfig->getValue(ConfigKey(kConfigGroup, "ShowITunesLibrary"), true)) { + m_pConfig->getValue( + ConfigKey(kConfigGroup, "ShowITunesLibrary"), true)) { addFeature(new ITunesFeature(this, m_pConfig)); } if (TraktorFeature::isSupported() && - m_pConfig->getValue(ConfigKey(kConfigGroup, "ShowTraktorLibrary"), true)) { + m_pConfig->getValue( + ConfigKey(kConfigGroup, "ShowTraktorLibrary"), true)) { addFeature(new TraktorFeature(this, m_pConfig)); } @@ -151,26 +167,28 @@ Library::Library( // dynamically appear/disappear when correctly prepared removable devices // are mounted/unmounted would be to have some form of timed thread to check // periodically. Not ideal performance wise. - if (m_pConfig->getValue(ConfigKey(kConfigGroup, "ShowRekordboxLibrary"), true)) { + if (m_pConfig->getValue( + ConfigKey(kConfigGroup, "ShowRekordboxLibrary"), true)) { addFeature(new RekordboxFeature(this, m_pConfig)); } - if (m_pConfig->getValue(ConfigKey(kConfigGroup, "ShowSeratoLibrary"), true)) { + if (m_pConfig->getValue( + ConfigKey(kConfigGroup, "ShowSeratoLibrary"), true)) { addFeature(new SeratoFeature(this, m_pConfig)); } - for (const auto& externalTrackCollection : m_pTrackCollectionManager->externalCollections()) { - auto feature = externalTrackCollection->newLibraryFeature(this, m_pConfig); + for (const auto& externalTrackCollection : + m_pTrackCollectionManager->externalCollections()) { + auto feature = + externalTrackCollection->newLibraryFeature(this, m_pConfig); if (feature) { - kLogger.info() - << "Adding library feature for" - << externalTrackCollection->name(); + kLogger.info() << "Adding library feature for" + << externalTrackCollection->name(); addFeature(feature); } else { - kLogger.info() - << "Library feature for" - << externalTrackCollection->name() - << "is not available"; + kLogger.info() << "Library feature for" + << externalTrackCollection->name() + << "is not available"; } } @@ -181,12 +199,14 @@ Library::Library( foreach (QString directoryPath, getDirs()) { QFileInfo directory(directoryPath); bool hasAccess = Sandbox::askForAccess(directory.canonicalFilePath()); - qDebug() << "Checking for access to" << directoryPath << ":" << hasAccess; + qDebug() << "Checking for access to" << directoryPath << ":" + << hasAccess; } m_iTrackTableRowHeight = m_pConfig->getValue( ConfigKey(kConfigGroup, "RowHeight"), kDefaultRowHeightPx); - QString fontStr = m_pConfig->getValueString(ConfigKey(kConfigGroup, "Font")); + QString fontStr = + m_pConfig->getValueString(ConfigKey(kConfigGroup, "Font")); if (!fontStr.isEmpty()) { m_trackTableFont.fromString(fontStr); } else { @@ -215,10 +235,7 @@ void Library::stopPendingTasks() { } void Library::bindSearchboxWidget(WSearchLineEdit* pSearchboxWidget) { - connect(pSearchboxWidget, - &WSearchLineEdit::search, - this, - &Library::search); + connect(pSearchboxWidget, &WSearchLineEdit::search, this, &Library::search); connect(this, &Library::disableSearch, pSearchboxWidget, @@ -274,15 +291,13 @@ void Library::bindSidebarWidget(WLibrarySidebar* pSidebarWidget) { } } -void Library::bindLibraryWidget(WLibrary* pLibraryWidget, - KeyboardEventFilter* pKeyboard) { - WTrackTableView* pTrackTableView = - new WTrackTableView( - pLibraryWidget, - m_pConfig, - m_pTrackCollectionManager, - pLibraryWidget->getTrackTableBackgroundColorOpacity(), - true); +void Library::bindLibraryWidget( + WLibrary* pLibraryWidget, KeyboardEventFilter* pKeyboard) { + WTrackTableView* pTrackTableView = new WTrackTableView(pLibraryWidget, + m_pConfig, + m_pTrackCollectionManager, + pLibraryWidget->getTrackTableBackgroundColorOpacity(), + true); pTrackTableView->installEventFilter(pKeyboard); connect(this, &Library::showTrackModel, @@ -348,10 +363,7 @@ void Library::addFeature(LibraryFeature* feature) { &LibraryFeature::switchToView, this, &Library::slotSwitchToView); - connect(feature, - &LibraryFeature::loadTrack, - this, - &Library::slotLoadTrack); + connect(feature, &LibraryFeature::loadTrack, this, &Library::slotLoadTrack); connect(feature, &LibraryFeature::loadTrackToPlayer, this, @@ -415,7 +427,8 @@ void Library::slotLoadLocationToPlayer(QString location, QString group) { } } -void Library::slotLoadTrackToPlayer(TrackPointer pTrack, QString group, bool play) { +void Library::slotLoadTrackToPlayer( + TrackPointer pTrack, QString group, bool play) { emit loadTrackToPlayer(pTrack, group, play); } @@ -448,9 +461,11 @@ void Library::slotRequestAddDir(QString dir) { Sandbox::createSecurityToken(directory); if (!m_pTrackCollectionManager->addDirectory(dir)) { - QMessageBox::information(0, tr("Add Directory to Library"), tr("Could not add the directory to your library. Either this " - "directory is already in your library or you are currently " - "rescanning your library.")); + QMessageBox::information(0, + tr("Add Directory to Library"), + tr("Could not add the directory to your library. Either this " + "directory is already in your library or you are currently " + "rescanning your library.")); } // set at least one directory in the config file so that it will be possible // to downgrade from 1.12 diff --git a/src/library/playlisttablemodel.cpp b/src/library/playlisttablemodel.cpp index 61dd8e5a939..ede7bae4cb3 100644 --- a/src/library/playlisttablemodel.cpp +++ b/src/library/playlisttablemodel.cpp @@ -6,7 +6,6 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" - PlaylistTableModel::PlaylistTableModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager, const char* settingsNamespace, @@ -271,14 +270,18 @@ TrackModel::CapabilitiesFlags PlaylistTableModel::getCapabilities() const { TRACKMODELCAPS_RESETPLAYED; if (m_iPlaylistId != - m_pTrackCollectionManager->internalCollection()->getPlaylistDAO().getPlaylistIdFromName(AUTODJ_TABLE)) { + m_pTrackCollectionManager->internalCollection() + ->getPlaylistDAO() + .getPlaylistIdFromName(AUTODJ_TABLE)) { // Only allow Add to AutoDJ if we aren't currently showing the AutoDJ queue. caps |= TRACKMODELCAPS_ADDTOAUTODJ | TRACKMODELCAPS_REMOVE_PLAYLIST; } else { caps |= TRACKMODELCAPS_REMOVE; } if (PlaylistDAO::PLHT_SET_LOG == - m_pTrackCollectionManager->internalCollection()->getPlaylistDAO().getHiddenType(m_iPlaylistId)) { + m_pTrackCollectionManager->internalCollection() + ->getPlaylistDAO() + .getHiddenType(m_iPlaylistId)) { // Disable track reordering for history playlists caps &= ~(TRACKMODELCAPS_REORDER | TRACKMODELCAPS_REMOVE_PLAYLIST); } diff --git a/src/library/searchquery.cpp b/src/library/searchquery.cpp index f04fbe9e222..af176ed1977 100644 --- a/src/library/searchquery.cpp +++ b/src/library/searchquery.cpp @@ -1,14 +1,13 @@ -#include - #include "library/searchquery.h" -#include "library/queryutil.h" -#include "track/keyutils.h" +#include + #include "library/dao/trackschema.h" +#include "library/queryutil.h" #include "library/trackset/crate/crateschema.h" -#include "util/db/sqllikewildcards.h" +#include "track/keyutils.h" #include "util/db/dbconnection.h" - +#include "util/db/sqllikewildcards.h" QVariant getTrackValueForColumn(const TrackPointer& pTrack, const QString& column) { if (column == LIBRARYTABLE_ARTIST) { diff --git a/src/library/searchquery.h b/src/library/searchquery.h index b0f0aa52757..c6b522f509e 100644 --- a/src/library/searchquery.h +++ b/src/library/searchquery.h @@ -1,20 +1,19 @@ #ifndef SEARCHQUERY_H #define SEARCHQUERY_H -#include -#include - #include -#include #include +#include #include #include +#include +#include -#include "track/track.h" +#include "library/trackset/crate/cratestorage.h" #include "proto/keys.pb.h" +#include "track/track.h" #include "util/assert.h" #include "util/memory.h" -#include "library/trackset/crate/cratestorage.h" const QString kMissingFieldSearchTerm = "\"\""; // "" searches for an empty string diff --git a/src/library/trackcollection.h b/src/library/trackcollection.h index d9657e40124..db99eb8e35e 100644 --- a/src/library/trackcollection.h +++ b/src/library/trackcollection.h @@ -5,14 +5,14 @@ #include #include -#include "preferences/usersettings.h" -#include "library/trackset/crate/cratestorage.h" -#include "library/dao/trackdao.h" -#include "library/dao/cuedao.h" -#include "library/dao/playlistdao.h" #include "library/dao/analysisdao.h" +#include "library/dao/cuedao.h" #include "library/dao/directorydao.h" #include "library/dao/libraryhashdao.h" +#include "library/dao/playlistdao.h" +#include "library/dao/trackdao.h" +#include "library/trackset/crate/cratestorage.h" +#include "preferences/usersettings.h" // forward declaration(s) class BaseTrackCache; diff --git a/src/library/trackmodel.h b/src/library/trackmodel.h index 9ee1ccd69a5..3660870225d 100644 --- a/src/library/trackmodel.h +++ b/src/library/trackmodel.h @@ -29,24 +29,24 @@ class TrackModel { // These enums are the bits in a bitvector. Any individual column cannot // have a value other than 0, 1, 2, 4, or 8! enum Capabilities { - TRACKMODELCAPS_NONE = 0x00000u, - TRACKMODELCAPS_REORDER = 0x00001u, - TRACKMODELCAPS_RECEIVEDROPS = 0x00002u, - TRACKMODELCAPS_ADDTOPLAYLIST = 0x00004u, - TRACKMODELCAPS_ADDTOCRATE = 0x00008u, - TRACKMODELCAPS_ADDTOAUTODJ = 0x00010u, - TRACKMODELCAPS_LOCKED = 0x00020u, - TRACKMODELCAPS_EDITMETADATA = 0x00040u, - TRACKMODELCAPS_LOADTODECK = 0x00080u, - TRACKMODELCAPS_LOADTOSAMPLER = 0x00100u, + TRACKMODELCAPS_NONE = 0x00000u, + TRACKMODELCAPS_REORDER = 0x00001u, + TRACKMODELCAPS_RECEIVEDROPS = 0x00002u, + TRACKMODELCAPS_ADDTOPLAYLIST = 0x00004u, + TRACKMODELCAPS_ADDTOCRATE = 0x00008u, + TRACKMODELCAPS_ADDTOAUTODJ = 0x00010u, + TRACKMODELCAPS_LOCKED = 0x00020u, + TRACKMODELCAPS_EDITMETADATA = 0x00040u, + TRACKMODELCAPS_LOADTODECK = 0x00080u, + TRACKMODELCAPS_LOADTOSAMPLER = 0x00100u, TRACKMODELCAPS_LOADTOPREVIEWDECK = 0x00200u, - TRACKMODELCAPS_REMOVE = 0x00400u, - TRACKMODELCAPS_RESETPLAYED = 0x02000u, - TRACKMODELCAPS_HIDE = 0x04000u, - TRACKMODELCAPS_UNHIDE = 0x08000u, - TRACKMODELCAPS_PURGE = 0x10000u, - TRACKMODELCAPS_REMOVE_PLAYLIST = 0x20000u, - TRACKMODELCAPS_REMOVE_CRATE = 0x40000u, + TRACKMODELCAPS_REMOVE = 0x00400u, + TRACKMODELCAPS_RESETPLAYED = 0x02000u, + TRACKMODELCAPS_HIDE = 0x04000u, + TRACKMODELCAPS_UNHIDE = 0x08000u, + TRACKMODELCAPS_PURGE = 0x10000u, + TRACKMODELCAPS_REMOVE_PLAYLIST = 0x20000u, + TRACKMODELCAPS_REMOVE_CRATE = 0x40000u, }; /// Enables the use of bitwise operators typedef unsigned int CapabilitiesFlags; diff --git a/src/library/trackset/baseplaylistfeature.cpp b/src/library/trackset/baseplaylistfeature.cpp index adb114ebdbe..15343261b1a 100644 --- a/src/library/trackset/baseplaylistfeature.cpp +++ b/src/library/trackset/baseplaylistfeature.cpp @@ -482,11 +482,14 @@ void BasePlaylistFeature::slotExportPlaylist() { // Create a new table model since the main one might have an active search. // This will only export songs that we think exist on default QScopedPointer pPlaylistTableModel( - new PlaylistTableModel(this, m_pLibrary->trackCollections(), "mixxx.db.model.playlist_export")); + new PlaylistTableModel(this, + m_pLibrary->trackCollections(), + "mixxx.db.model.playlist_export")); pPlaylistTableModel->setTableModel(m_pPlaylistTableModel->getPlaylist()); - pPlaylistTableModel->setSort(pPlaylistTableModel->fieldIndex( - ColumnCache::COLUMN_PLAYLISTTRACKSTABLE_POSITION), + pPlaylistTableModel->setSort( + pPlaylistTableModel->fieldIndex( + ColumnCache::COLUMN_PLAYLISTTRACKSTABLE_POSITION), Qt::AscendingOrder); pPlaylistTableModel->select(); @@ -495,12 +498,16 @@ void BasePlaylistFeature::slotExportPlaylist() { ConfigKey("[Library]", "UseRelativePathOnExport")); if (file_location.endsWith(".csv", Qt::CaseInsensitive)) { - ParserCsv::writeCSVFile(file_location, pPlaylistTableModel.data(), useRelativePath); + ParserCsv::writeCSVFile( + file_location, pPlaylistTableModel.data(), useRelativePath); } else if (file_location.endsWith(".txt", Qt::CaseInsensitive)) { - if (m_playlistDao.getHiddenType(pPlaylistTableModel->getPlaylist()) == PlaylistDAO::PLHT_SET_LOG) { - ParserCsv::writeReadableTextFile(file_location, pPlaylistTableModel.data(), true); + if (m_playlistDao.getHiddenType(pPlaylistTableModel->getPlaylist()) == + PlaylistDAO::PLHT_SET_LOG) { + ParserCsv::writeReadableTextFile( + file_location, pPlaylistTableModel.data(), true); } else { - ParserCsv::writeReadableTextFile(file_location, pPlaylistTableModel.data(), false); + ParserCsv::writeReadableTextFile( + file_location, pPlaylistTableModel.data(), false); } } else { // Create and populate a list of files of the playlist @@ -511,15 +518,15 @@ void BasePlaylistFeature::slotExportPlaylist() { playlist_items << pPlaylistTableModel->getTrackLocation(index); } exportPlaylistItemsIntoFile( - file_location, - playlist_items, - useRelativePath); + file_location, playlist_items, useRelativePath); } } void BasePlaylistFeature::slotExportTrackFiles() { QScopedPointer pPlaylistTableModel( - new PlaylistTableModel(this, m_pLibrary->trackCollections(), "mixxx.db.model.playlist_export")); + new PlaylistTableModel(this, + m_pLibrary->trackCollections(), + "mixxx.db.model.playlist_export")); pPlaylistTableModel->setTableModel(m_pPlaylistTableModel->getPlaylist()); pPlaylistTableModel->setSort(pPlaylistTableModel->fieldIndex( diff --git a/src/library/trackset/crate/cratefeature.cpp b/src/library/trackset/crate/cratefeature.cpp index 8e34913682d..85f11db9a4d 100644 --- a/src/library/trackset/crate/cratefeature.cpp +++ b/src/library/trackset/crate/cratefeature.cpp @@ -161,9 +161,14 @@ QIcon CrateFeature::getIcon() { QString CrateFeature::formatRootViewHtml() const { QString cratesTitle = tr("Crates"); - QString cratesSummary = tr("Crates are a great way to help organize the music you want to DJ with."); - QString cratesSummary2 = tr("Make a crate for your next gig, for your favorite electrohouse tracks, or for your most requested songs."); - QString cratesSummary3 = tr("Crates let you organize your music however you'd like!"); + QString cratesSummary = + tr("Crates are a great way to help organize the music you want to " + "DJ with."); + QString cratesSummary2 = + tr("Make a crate for your next gig, for your favorite electrohouse " + "tracks, or for your most requested songs."); + QString cratesSummary3 = + tr("Crates let you organize your music however you'd like!"); QString html; QString createCrateLink = tr("Create New Crate"); @@ -174,8 +179,9 @@ QString CrateFeature::formatRootViewHtml() const { //Colorize links in lighter blue, instead of QT default dark blue. //Links are still different from regular text, but readable on dark/light backgrounds. //https://bugs.launchpad.net/mixxx/+bug/1744816 - html.append(QStringLiteral("%1") - .arg(createCrateLink)); + html.append( + QStringLiteral("%1") + .arg(createCrateLink)); return html; } @@ -187,8 +193,7 @@ std::unique_ptr CrateFeature::newTreeItemForCrateSummary( } void CrateFeature::updateTreeItemForCrateSummary( - TreeItem* pTreeItem, - const CrateSummary& crateSummary) const { + TreeItem* pTreeItem, const CrateSummary& crateSummary) const { DEBUG_ASSERT(pTreeItem != nullptr); if (pTreeItem->getData().isNull()) { // Initialize a newly created tree item @@ -202,7 +207,8 @@ void CrateFeature::updateTreeItemForCrateSummary( pTreeItem->setIcon(crateSummary.isLocked() ? m_lockedCrateIcon : QIcon()); } -bool CrateFeature::dropAcceptChild(const QModelIndex& index, QList urls, QObject* pSource) { +bool CrateFeature::dropAcceptChild( + const QModelIndex& index, QList urls, QObject* pSource) { CrateId crateId(crateIdFromIndex(index)); VERIFY_OR_DEBUG_ASSERT(crateId.isValid()) { return false; @@ -212,8 +218,8 @@ bool CrateFeature::dropAcceptChild(const QModelIndex& index, QList urls, Q // playlist. // pSource != nullptr it is a drop from inside Mixxx and indicates all // tracks already in the DB - QList trackIds = m_pTrackCollection->resolveTrackIdsFromUrls(urls, - !pSource); + QList trackIds = + m_pTrackCollection->resolveTrackIdsFromUrls(urls, !pSource); if (!trackIds.size()) { return false; } @@ -228,15 +234,16 @@ bool CrateFeature::dragMoveAcceptChild(const QModelIndex& index, QUrl url) { return false; } Crate crate; - if (!m_pTrackCollection->crates().readCrateById(crateId, &crate) || crate.isLocked()) { + if (!m_pTrackCollection->crates().readCrateById(crateId, &crate) || + crate.isLocked()) { return false; } return SoundSourceProxy::isUrlSupported(url) || Parser::isPlaylistFilenameSupported(url.toLocalFile()); } -void CrateFeature::bindLibraryWidget(WLibrary* libraryWidget, - KeyboardEventFilter* keyboard) { +void CrateFeature::bindLibraryWidget( + WLibrary* libraryWidget, KeyboardEventFilter* keyboard) { Q_UNUSED(keyboard); WLibraryTextBrowser* edit = new WLibraryTextBrowser(libraryWidget); edit->setHtml(formatRootViewHtml()); @@ -292,7 +299,8 @@ bool CrateFeature::readLastRightClickedCrate(Crate* pCrate) const { qWarning() << "Failed to determine id of selected crate"; return false; } - VERIFY_OR_DEBUG_ASSERT(m_pTrackCollection->crates().readCrateById(crateId, pCrate)) { + VERIFY_OR_DEBUG_ASSERT( + m_pTrackCollection->crates().readCrateById(crateId, pCrate)) { qWarning() << "Failed to read selected crate with id" << crateId; return false; } @@ -308,7 +316,8 @@ void CrateFeature::onRightClick(const QPoint& globalPos) { menu.exec(globalPos); } -void CrateFeature::onRightClickChild(const QPoint& globalPos, QModelIndex index) { +void CrateFeature::onRightClickChild( + const QPoint& globalPos, QModelIndex index) { //Save the model index so we can get it in the action slots... m_lastRightClickedIndex = index; CrateId crateId(crateIdFromIndex(index)); @@ -349,8 +358,8 @@ void CrateFeature::onRightClickChild(const QPoint& globalPos, QModelIndex index) } void CrateFeature::slotCreateCrate() { - CrateId crateId = CrateFeatureHelper( - m_pTrackCollection, m_pConfig) + CrateId crateId = CrateFeatureHelper(m_pTrackCollection, + m_pConfig) .createEmptyCrate(); if (crateId.isValid()) { activateCrate(crateId); @@ -379,28 +388,24 @@ void CrateFeature::slotRenameCrate() { crate.resetName(); for (;;) { bool ok = false; - auto newName = - QInputDialog::getText( - nullptr, - tr("Rename Crate"), - tr("Enter new name for crate:"), - QLineEdit::Normal, - oldName, - &ok) - .trimmed(); + auto newName = QInputDialog::getText(nullptr, + tr("Rename Crate"), + tr("Enter new name for crate:"), + QLineEdit::Normal, + oldName, + &ok) + .trimmed(); if (!ok || newName.isEmpty()) { return; } if (newName.isEmpty()) { - QMessageBox::warning( - nullptr, + QMessageBox::warning(nullptr, tr("Renaming Crate Failed"), tr("A crate cannot have a blank name.")); continue; } if (m_pTrackCollection->crates().readCrateByName(newName)) { - QMessageBox::warning( - nullptr, + QMessageBox::warning(nullptr, tr("Renaming Crate Failed"), tr("A crate by that name already exists.")); continue; @@ -421,8 +426,8 @@ void CrateFeature::slotRenameCrate() { void CrateFeature::slotDuplicateCrate() { Crate crate; if (readLastRightClickedCrate(&crate)) { - CrateId crateId = CrateFeatureHelper( - m_pTrackCollection, m_pConfig) + CrateId crateId = CrateFeatureHelper(m_pTrackCollection, + m_pConfig) .duplicateCrate(crate); if (crateId.isValid()) { activateCrate(crateId); @@ -501,10 +506,12 @@ void CrateFeature::updateChildModel(const QSet& updatedCrateIds) { continue; } CrateSummary crateSummary; - VERIFY_OR_DEBUG_ASSERT(crateStorage.readCrateSummaryById(crateId, &crateSummary)) { + VERIFY_OR_DEBUG_ASSERT( + crateStorage.readCrateSummaryById(crateId, &crateSummary)) { continue; } - updateTreeItemForCrateSummary(m_childModel.getItem(index), crateSummary); + updateTreeItemForCrateSummary( + m_childModel.getItem(index), crateSummary); m_childModel.triggerRepaint(index); } if (m_pSelectedTrack) { @@ -621,10 +628,10 @@ void CrateFeature::slotCreateImportCrate() { if (m_pTrackCollection->insertCrate(crate, &lastCrateId)) { m_crateTableModel.selectCrate(lastCrateId); } else { - QMessageBox::warning( - nullptr, + QMessageBox::warning(nullptr, tr("Crate Creation Failed"), - tr("An unknown error occurred while creating crate: ") + crate.getName()); + tr("An unknown error occurred while creating crate: ") + + crate.getName()); return; } @@ -642,7 +649,8 @@ void CrateFeature::slotAnalyzeCrate() { m_pTrackCollection->crates().countCrateTracks(crateId)); { CrateTrackSelectResult crateTracks( - m_pTrackCollection->crates().selectCrateTracksSorted(crateId)); + m_pTrackCollection->crates().selectCrateTracksSorted( + crateId)); while (crateTracks.next()) { trackIds.append(crateTracks.trackId()); } @@ -665,11 +673,11 @@ void CrateFeature::slotExportPlaylist() { ConfigKey("[Library]", "LastImportExportCrateDirectory"), QStandardPaths::writableLocation(QStandardPaths::MusicLocation)); - QString file_location = QFileDialog::getSaveFileName( - NULL, + QString file_location = QFileDialog::getSaveFileName(NULL, tr("Export Crate"), lastCrateDirectory.append("/").append(crate.getName()), - tr("M3U Playlist (*.m3u);;M3U8 Playlist (*.m3u8);;PLS Playlist (*.pls);;Text CSV (*.csv);;Readable Text (*.txt)")); + tr("M3U Playlist (*.m3u);;M3U8 Playlist (*.m3u8);;PLS Playlist " + "(*.pls);;Text CSV (*.csv);;Readable Text (*.txt)")); // Exit method if user cancelled the open dialog. if (file_location.isNull() || file_location.isEmpty()) { return; diff --git a/src/library/trackset/crate/cratestorage.cpp b/src/library/trackset/crate/cratestorage.cpp index d86302e3be1..9bdcad4e6cd 100644 --- a/src/library/trackset/crate/cratestorage.cpp +++ b/src/library/trackset/crate/cratestorage.cpp @@ -192,23 +192,29 @@ void CrateStorage::repairDatabase(QSqlDatabase database) { { // Remove tracks from non-existent crates FwdSqlQuery query(database, - QStringLiteral("DELETE FROM %1 WHERE %2 NOT IN (SELECT %3 FROM %4)") - .arg(CRATE_TRACKS_TABLE, CRATETRACKSTABLE_CRATEID, CRATETABLE_ID, CRATE_TABLE)); + QStringLiteral( + "DELETE FROM %1 WHERE %2 NOT IN (SELECT %3 FROM %4)") + .arg(CRATE_TRACKS_TABLE, + CRATETRACKSTABLE_CRATEID, + CRATETABLE_ID, + CRATE_TABLE)); if (query.execPrepared() && (query.numRowsAffected() > 0)) { - kLogger.warning() - << "Removed" << query.numRowsAffected() - << "crate tracks from non-existent crates"; + kLogger.warning() << "Removed" << query.numRowsAffected() + << "crate tracks from non-existent crates"; } } { // Remove library purged tracks from crates FwdSqlQuery query(database, - QStringLiteral("DELETE FROM %1 WHERE %2 NOT IN (SELECT %3 FROM %4)") - .arg(CRATE_TRACKS_TABLE, CRATETRACKSTABLE_TRACKID, LIBRARYTABLE_ID, LIBRARY_TABLE)); + QStringLiteral( + "DELETE FROM %1 WHERE %2 NOT IN (SELECT %3 FROM %4)") + .arg(CRATE_TRACKS_TABLE, + CRATETRACKSTABLE_TRACKID, + LIBRARYTABLE_ID, + LIBRARY_TABLE)); if (query.execPrepared() && (query.numRowsAffected() > 0)) { - kLogger.warning() - << "Removed" << query.numRowsAffected() - << "library purged tracks from crates"; + kLogger.warning() << "Removed" << query.numRowsAffected() + << "library purged tracks from crates"; } } } @@ -225,7 +231,8 @@ void CrateStorage::disconnectDatabase() { } void CrateStorage::createViews() { - VERIFY_OR_DEBUG_ASSERT(FwdSqlQuery(m_database, kCrateSummaryViewQuery).execPrepared()) { + VERIFY_OR_DEBUG_ASSERT( + FwdSqlQuery(m_database, kCrateSummaryViewQuery).execPrepared()) { kLogger.critical() << "Failed to create database view for crate summaries!"; } @@ -233,8 +240,7 @@ void CrateStorage::createViews() { uint CrateStorage::countCrates() const { FwdSqlQuery query(m_database, - QStringLiteral("SELECT COUNT(*) FROM %1") - .arg(CRATE_TABLE)); + QStringLiteral("SELECT COUNT(*) FROM %1").arg(CRATE_TABLE)); if (query.execPrepared() && query.next()) { uint result = query.fieldValue(0).toUInt(); DEBUG_ASSERT(!query.next()); @@ -253,13 +259,11 @@ bool CrateStorage::readCrateById(CrateId id, Crate* pCrate) const { CrateSelectResult crates(std::move(query)); if ((pCrate != nullptr) ? crates.populateNext(pCrate) : crates.next()) { VERIFY_OR_DEBUG_ASSERT(!crates.next()) { - kLogger.warning() - << "Ambiguous crate id:" << id; + kLogger.warning() << "Ambiguous crate id:" << id; } return true; } else { - kLogger.warning() - << "Crate not found by id:" << id; + kLogger.warning() << "Crate not found by id:" << id; } } return false; @@ -274,15 +278,12 @@ bool CrateStorage::readCrateByName(const QString& name, Crate* pCrate) const { CrateSelectResult crates(std::move(query)); if ((pCrate != nullptr) ? crates.populateNext(pCrate) : crates.next()) { VERIFY_OR_DEBUG_ASSERT(!crates.next()) { - kLogger.warning() - << "Ambiguous crate name:" << name; + kLogger.warning() << "Ambiguous crate name:" << name; } return true; } else { if (kLogger.debugEnabled()) { - kLogger.debug() - << "Crate not found by name:" - << name; + kLogger.debug() << "Crate not found by name:" << name; } } } @@ -327,12 +328,10 @@ CrateSelectResult CrateStorage::selectCratesByIds( FwdSqlQuery query(m_database, mixxx::DbConnection::collateLexicographically( - QStringLiteral( - "SELECT * FROM %1 " - "WHERE %2 %3 (%4) " - "ORDER BY %5") - .arg( - CRATE_TABLE, + QStringLiteral("SELECT * FROM %1 " + "WHERE %2 %3 (%4) " + "ORDER BY %5") + .arg(CRATE_TABLE, CRATETABLE_ID, subselectPrefix, subselectForCrateIds, @@ -348,8 +347,11 @@ CrateSelectResult CrateStorage::selectCratesByIds( CrateSelectResult CrateStorage::selectAutoDjCrates(bool autoDjSource) const { FwdSqlQuery query(m_database, mixxx::DbConnection::collateLexicographically( - QStringLiteral("SELECT * FROM %1 WHERE %2=:autoDjSource ORDER BY %3") - .arg(CRATE_TABLE, CRATETABLE_AUTODJ_SOURCE, CRATETABLE_NAME))); + QStringLiteral("SELECT * FROM %1 WHERE %2=:autoDjSource " + "ORDER BY %3") + .arg(CRATE_TABLE, + CRATETABLE_AUTODJ_SOURCE, + CRATETABLE_NAME))); query.bindValue(":autoDjSource", autoDjSource); if (query.execPrepared()) { return CrateSelectResult(std::move(query)); @@ -370,22 +372,23 @@ CrateSummarySelectResult CrateStorage::selectCrateSummaries() const { } } -bool CrateStorage::readCrateSummaryById(CrateId id, CrateSummary* pCrateSummary) const { +bool CrateStorage::readCrateSummaryById( + CrateId id, CrateSummary* pCrateSummary) const { FwdSqlQuery query(m_database, QStringLiteral("SELECT * FROM %1 WHERE %2=:id") .arg(CRATE_SUMMARY_VIEW, CRATETABLE_ID)); query.bindValue(":id", id); if (query.execPrepared()) { CrateSummarySelectResult crateSummaries(std::move(query)); - if ((pCrateSummary != nullptr) ? crateSummaries.populateNext(pCrateSummary) : crateSummaries.next()) { + if ((pCrateSummary != nullptr) + ? crateSummaries.populateNext(pCrateSummary) + : crateSummaries.next()) { VERIFY_OR_DEBUG_ASSERT(!crateSummaries.next()) { - kLogger.warning() - << "Ambiguous crate id:" << id; + kLogger.warning() << "Ambiguous crate id:" << id; } return true; } else { - kLogger.warning() - << "Crate summary not found by id:" << id; + kLogger.warning() << "Crate summary not found by id:" << id; } } return false; @@ -406,22 +409,24 @@ uint CrateStorage::countCrateTracks(CrateId crateId) const { } //static -QString CrateStorage::formatSubselectQueryForCrateTrackIds( - CrateId crateId) { +QString CrateStorage::formatSubselectQueryForCrateTrackIds(CrateId crateId) { return QStringLiteral("SELECT %1 FROM %2 WHERE %3=%4") - .arg(CRATETRACKSTABLE_TRACKID, CRATE_TRACKS_TABLE, CRATETRACKSTABLE_CRATEID, crateId.toString()); + .arg(CRATETRACKSTABLE_TRACKID, + CRATE_TRACKS_TABLE, + CRATETRACKSTABLE_CRATEID, + crateId.toString()); } QString CrateStorage::formatQueryForTrackIdsByCrateNameLike( const QString& crateNameLike) const { FieldEscaper escaper(m_database); - QString escapedCrateNameLike = escaper.escapeString(kSqlLikeMatchAll + crateNameLike + kSqlLikeMatchAll); + QString escapedCrateNameLike = escaper.escapeString( + kSqlLikeMatchAll + crateNameLike + kSqlLikeMatchAll); return QString( "SELECT DISTINCT %1 FROM %2 " "JOIN %3 ON %4=%5 WHERE %6 LIKE %7 " "ORDER BY %1") - .arg( - CRATETRACKSTABLE_TRACKID, + .arg(CRATETRACKSTABLE_TRACKID, CRATE_TRACKS_TABLE, CRATE_TABLE, CRATETRACKSTABLE_CRATEID, @@ -432,14 +437,22 @@ QString CrateStorage::formatQueryForTrackIdsByCrateNameLike( //static QString CrateStorage::formatQueryForTrackIdsWithCrate() { - return QStringLiteral("SELECT DISTINCT %1 FROM %2 JOIN %3 ON %4=%5 ORDER BY %1") - .arg(CRATETRACKSTABLE_TRACKID, CRATE_TRACKS_TABLE, CRATE_TABLE, CRATETRACKSTABLE_CRATEID, CRATETABLE_ID); + return QStringLiteral( + "SELECT DISTINCT %1 FROM %2 JOIN %3 ON %4=%5 ORDER BY %1") + .arg(CRATETRACKSTABLE_TRACKID, + CRATE_TRACKS_TABLE, + CRATE_TABLE, + CRATETRACKSTABLE_CRATEID, + CRATETABLE_ID); } -CrateTrackSelectResult CrateStorage::selectCrateTracksSorted(CrateId crateId) const { +CrateTrackSelectResult CrateStorage::selectCrateTracksSorted( + CrateId crateId) const { FwdSqlQuery query(m_database, QStringLiteral("SELECT * FROM %1 WHERE %2=:crateId ORDER BY %3") - .arg(CRATE_TRACKS_TABLE, CRATETRACKSTABLE_CRATEID, CRATETRACKSTABLE_TRACKID)); + .arg(CRATE_TRACKS_TABLE, + CRATETRACKSTABLE_CRATEID, + CRATETRACKSTABLE_TRACKID)); query.bindValue(":crateId", crateId); if (query.execPrepared()) { return CrateTrackSelectResult(std::move(query)); @@ -448,10 +461,13 @@ CrateTrackSelectResult CrateStorage::selectCrateTracksSorted(CrateId crateId) co } } -CrateTrackSelectResult CrateStorage::selectTrackCratesSorted(TrackId trackId) const { +CrateTrackSelectResult CrateStorage::selectTrackCratesSorted( + TrackId trackId) const { FwdSqlQuery query(m_database, QStringLiteral("SELECT * FROM %1 WHERE %2=:trackId ORDER BY %3") - .arg(CRATE_TRACKS_TABLE, CRATETRACKSTABLE_TRACKID, CRATETRACKSTABLE_CRATEID)); + .arg(CRATE_TRACKS_TABLE, + CRATETRACKSTABLE_TRACKID, + CRATETRACKSTABLE_CRATEID)); query.bindValue(":trackId", trackId); if (query.execPrepared()) { return CrateTrackSelectResult(std::move(query)); @@ -460,13 +476,14 @@ CrateTrackSelectResult CrateStorage::selectTrackCratesSorted(TrackId trackId) co } } -CrateSummarySelectResult CrateStorage::selectCratesWithTrackCount(const QList& trackIds) const { +CrateSummarySelectResult CrateStorage::selectCratesWithTrackCount( + const QList& trackIds) const { FwdSqlQuery query(m_database, QStringLiteral("SELECT *, " - "(SELECT COUNT(*) FROM %1 WHERE %2.%3 = %1.%4 and %1.%5 in (%9)) AS %6, " + "(SELECT COUNT(*) FROM %1 WHERE %2.%3 = %1.%4 and " + "%1.%5 in (%9)) AS %6, " "0 as %7 FROM %2 ORDER BY %8") - .arg( - CRATE_TRACKS_TABLE, + .arg(CRATE_TRACKS_TABLE, CRATE_TABLE, CRATETABLE_ID, CRATETRACKSTABLE_CRATEID, @@ -483,21 +500,22 @@ CrateSummarySelectResult CrateStorage::selectCratesWithTrackCount(const QListinternalCollection()->getTrackSource()); + setTable(tableName, + LIBRARYTABLE_ID, + columns, + m_pTrackCollectionManager->internalCollection()->getTrackSource()); setSearch(""); setDefaultSort(fieldIndex("artist"), Qt::AscendingOrder); } @@ -61,9 +65,7 @@ bool CrateTableModel::addTrack(const QModelIndex& index, QString location) { TrackFile fileInfo(location); if (!fileInfo.checkFileExists()) { qDebug() << "CrateTableModel::addTrack:" - << "File" - << location - << "not found"; + << "File" << location << "not found"; return false; } @@ -76,19 +78,16 @@ bool CrateTableModel::addTrack(const QModelIndex& index, QString location) { TrackRef::fromFileInfo(fileInfo)); if (!pTrack) { qDebug() << "CrateTableModel::addTrack:" - << "Failed to add track" - << location - << "to library"; + << "Failed to add track" << location << "to library"; return false; } QList trackIds; trackIds.append(pTrack->getId()); - if (!m_pTrackCollectionManager->internalCollection()->addCrateTracks(m_selectedCrate, trackIds)) { + if (!m_pTrackCollectionManager->internalCollection()->addCrateTracks( + m_selectedCrate, trackIds)) { qDebug() << "CrateTableModel::addTrack:" - << "Failed to add track" - << location - << "to crate" + << "Failed to add track" << location << "to crate" << m_selectedCrate; return false; } @@ -99,21 +98,18 @@ bool CrateTableModel::addTrack(const QModelIndex& index, QString location) { } TrackModel::CapabilitiesFlags CrateTableModel::getCapabilities() const { - CapabilitiesFlags caps = - TRACKMODELCAPS_RECEIVEDROPS | - TRACKMODELCAPS_ADDTOPLAYLIST | - TRACKMODELCAPS_ADDTOCRATE | - TRACKMODELCAPS_ADDTOAUTODJ | - TRACKMODELCAPS_EDITMETADATA | - TRACKMODELCAPS_LOADTODECK | - TRACKMODELCAPS_LOADTOSAMPLER | - TRACKMODELCAPS_LOADTOPREVIEWDECK | - TRACKMODELCAPS_REMOVE_CRATE | + CapabilitiesFlags caps = TRACKMODELCAPS_RECEIVEDROPS | + TRACKMODELCAPS_ADDTOPLAYLIST | TRACKMODELCAPS_ADDTOCRATE | + TRACKMODELCAPS_ADDTOAUTODJ | TRACKMODELCAPS_EDITMETADATA | + TRACKMODELCAPS_LOADTODECK | TRACKMODELCAPS_LOADTOSAMPLER | + TRACKMODELCAPS_LOADTOPREVIEWDECK | TRACKMODELCAPS_REMOVE_CRATE | TRACKMODELCAPS_RESETPLAYED; if (m_selectedCrate.isValid()) { Crate crate; - if (m_pTrackCollectionManager->internalCollection()->crates().readCrateById(m_selectedCrate, &crate)) { + if (m_pTrackCollectionManager->internalCollection() + ->crates() + .readCrateById(m_selectedCrate, &crate)) { if (crate.isLocked()) { caps |= TRACKMODELCAPS_LOCKED; } @@ -125,17 +121,17 @@ TrackModel::CapabilitiesFlags CrateTableModel::getCapabilities() const { return caps; } -int CrateTableModel::addTracks(const QModelIndex& index, - const QList& locations) { +int CrateTableModel::addTracks( + const QModelIndex& index, const QList& locations) { Q_UNUSED(index); // If a track is dropped but it isn't in the library, then add it because // the user probably dropped a file from outside Mixxx into this crate. - QList trackIds = m_pTrackCollectionManager->internalCollection()->resolveTrackIdsFromLocations( - locations); - if (!m_pTrackCollectionManager->internalCollection()->addCrateTracks(m_selectedCrate, trackIds)) { + QList trackIds = m_pTrackCollectionManager->internalCollection() + ->resolveTrackIdsFromLocations(locations); + if (!m_pTrackCollectionManager->internalCollection()->addCrateTracks( + m_selectedCrate, trackIds)) { qWarning() << "CrateTableModel::addTracks could not add" - << locations.size() - << "tracks to crate" << m_selectedCrate; + << locations.size() << "tracks to crate" << m_selectedCrate; return 0; } @@ -152,7 +148,9 @@ void CrateTableModel::removeTracks(const QModelIndexList& indices) { } Crate crate; - if (!m_pTrackCollectionManager->internalCollection()->crates().readCrateById(m_selectedCrate, &crate)) { + if (!m_pTrackCollectionManager->internalCollection() + ->crates() + .readCrateById(m_selectedCrate, &crate)) { qWarning() << "Failed to read create" << m_selectedCrate; return; } @@ -166,7 +164,8 @@ void CrateTableModel::removeTracks(const QModelIndexList& indices) { for (const QModelIndex& index : indices) { trackIds.append(getTrackId(index)); } - if (!m_pTrackCollectionManager->internalCollection()->removeCrateTracks(crate.getId(), trackIds)) { + if (!m_pTrackCollectionManager->internalCollection()->removeCrateTracks( + crate.getId(), trackIds)) { qWarning() << "Failed to remove tracks from crate" << crate; return; } diff --git a/src/library/trackset/playlistfeature.cpp b/src/library/trackset/playlistfeature.cpp index 189376b4496..20c7db3bacd 100644 --- a/src/library/trackset/playlistfeature.cpp +++ b/src/library/trackset/playlistfeature.cpp @@ -26,19 +26,19 @@ QString createPlaylistLabel( QString name, int count, int duration) { - return QStringLiteral("%1 (%2) %3").arg(name, QString::number(count), mixxx::Duration::formatTime(duration, mixxx::Duration::Precision::SECONDS)); + return QStringLiteral("%1 (%2) %3") + .arg(name, + QString::number(count), + mixxx::Duration::formatTime( + duration, mixxx::Duration::Precision::SECONDS)); } } // anonymous namespace -PlaylistFeature::PlaylistFeature( - Library* pLibrary, - UserSettingsPointer pConfig) - : BasePlaylistFeature( - pLibrary, +PlaylistFeature::PlaylistFeature(Library* pLibrary, UserSettingsPointer pConfig) + : BasePlaylistFeature(pLibrary, pConfig, - new PlaylistTableModel( - nullptr, + new PlaylistTableModel(nullptr, pLibrary->trackCollections(), "mixxx.db.model.playlist"), QStringLiteral("PLAYLISTHOME")), @@ -71,7 +71,8 @@ void PlaylistFeature::onRightClick(const QPoint& globalPos) { menu.exec(globalPos); } -void PlaylistFeature::onRightClickChild(const QPoint& globalPos, QModelIndex index) { +void PlaylistFeature::onRightClickChild( + const QPoint& globalPos, QModelIndex index) { //Save the model index so we can get it in the action slots... m_lastRightClickedIndex = index; int playlistId = playlistIdFromIndex(index); @@ -102,7 +103,8 @@ void PlaylistFeature::onRightClickChild(const QPoint& globalPos, QModelIndex ind menu.exec(globalPos); } -bool PlaylistFeature::dropAcceptChild(const QModelIndex& index, QList urls, QObject* pSource) { +bool PlaylistFeature::dropAcceptChild( + const QModelIndex& index, QList urls, QObject* pSource) { int playlistId = playlistIdFromIndex(index); VERIFY_OR_DEBUG_ASSERT(playlistId >= 0) { return false; @@ -112,8 +114,9 @@ bool PlaylistFeature::dropAcceptChild(const QModelIndex& index, QList urls // playlist. // pSource != nullptr it is a drop from inside Mixxx and indicates all // tracks already in the DB - QList trackIds = m_pLibrary->trackCollections()->internalCollection()->resolveTrackIdsFromUrls(urls, - !pSource); + QList trackIds = m_pLibrary->trackCollections() + ->internalCollection() + ->resolveTrackIdsFromUrls(urls, !pSource); if (!trackIds.size()) { return false; } @@ -132,7 +135,8 @@ bool PlaylistFeature::dragMoveAcceptChild(const QModelIndex& index, QUrl url) { } QList PlaylistFeature::createPlaylistLabels() { - QSqlDatabase database = m_pLibrary->trackCollections()->internalCollection()->database(); + QSqlDatabase database = + m_pLibrary->trackCollections()->internalCollection()->database(); QList playlistLabels; QString queryString = QString( @@ -141,10 +145,13 @@ QList PlaylistFeature::createPlaylistLabels() { " Playlists.id AS id, " " Playlists.name AS name, " " LOWER(Playlists.name) AS sort_name, " - " COUNT(case library.mixxx_deleted when 0 then 1 else null end) AS count, " - " SUM(case library.mixxx_deleted when 0 then library.duration else 0 end) AS durationSeconds " + " COUNT(case library.mixxx_deleted when 0 then 1 else null end) " + "AS count, " + " SUM(case library.mixxx_deleted when 0 then library.duration " + "else 0 end) AS durationSeconds " "FROM Playlists " - "LEFT JOIN PlaylistTracks ON PlaylistTracks.playlist_id = Playlists.id " + "LEFT JOIN PlaylistTracks ON PlaylistTracks.playlist_id = " + "Playlists.id " "LEFT JOIN library ON PlaylistTracks.track_id = library.id " "WHERE Playlists.hidden = 0 " "GROUP BY Playlists.id"); @@ -169,18 +176,19 @@ QList PlaylistFeature::createPlaylistLabels() { int durationColumn = record.indexOf("durationSeconds"); for (int row = 0; row < playlistTableModel.rowCount(); ++row) { - int id = playlistTableModel.data( - playlistTableModel.index(row, idColumn)) - .toInt(); - QString name = playlistTableModel.data( - playlistTableModel.index(row, nameColumn)) + int id = + playlistTableModel.data(playlistTableModel.index(row, idColumn)) + .toInt(); + QString name = playlistTableModel + .data(playlistTableModel.index(row, nameColumn)) .toString(); - int count = playlistTableModel.data( - playlistTableModel.index(row, countColumn)) + int count = playlistTableModel + .data(playlistTableModel.index(row, countColumn)) .toInt(); - int duration = playlistTableModel.data( - playlistTableModel.index(row, durationColumn)) - .toInt(); + int duration = + playlistTableModel + .data(playlistTableModel.index(row, durationColumn)) + .toInt(); BasePlaylistFeature::IdAndLabel idAndLabel; idAndLabel.id = id; idAndLabel.label = createPlaylistLabel(name, count, duration); @@ -191,7 +199,8 @@ QList PlaylistFeature::createPlaylistLabels() { QString PlaylistFeature::fetchPlaylistLabel(int playlistId) { // Setup the sidebar playlist model - QSqlDatabase database = m_pLibrary->trackCollections()->internalCollection()->database(); + QSqlDatabase database = + m_pLibrary->trackCollections()->internalCollection()->database(); QSqlTableModel playlistTableModel(this, database); playlistTableModel.setTable("PlaylistsCountsDurations"); QString filter = "id=" + QString::number(playlistId); @@ -207,15 +216,16 @@ QString PlaylistFeature::fetchPlaylistLabel(int playlistId) { DEBUG_ASSERT(playlistTableModel.rowCount() <= 1); if (playlistTableModel.rowCount() > 0) { - QString name = playlistTableModel.data( - playlistTableModel.index(0, nameColumn)) - .toString(); - int count = playlistTableModel.data( - playlistTableModel.index(0, countColumn)) + QString name = + playlistTableModel.data(playlistTableModel.index(0, nameColumn)) + .toString(); + int count = playlistTableModel + .data(playlistTableModel.index(0, countColumn)) .toInt(); - int duration = playlistTableModel.data( - playlistTableModel.index(0, durationColumn)) - .toInt(); + int duration = + playlistTableModel + .data(playlistTableModel.index(0, durationColumn)) + .toInt(); return createPlaylistLabel(name, count, duration); } return QString(); @@ -223,7 +233,8 @@ QString PlaylistFeature::fetchPlaylistLabel(int playlistId) { void PlaylistFeature::decorateChild(TreeItem* item, int playlistId) { if (m_playlistDao.isPlaylistLocked(playlistId)) { - item->setIcon(QIcon(":/images/library/ic_library_locked_tracklist.svg")); + item->setIcon( + QIcon(":/images/library/ic_library_locked_tracklist.svg")); } else { item->setIcon(QIcon()); } @@ -241,7 +252,8 @@ void PlaylistFeature::slotPlaylistTableChanged(int playlistId) { void PlaylistFeature::slotPlaylistContentChanged(QSet playlistIds) { for (const auto playlistId : qAsConst(playlistIds)) { - enum PlaylistDAO::HiddenType type = m_playlistDao.getHiddenType(playlistId); + enum PlaylistDAO::HiddenType type = + m_playlistDao.getHiddenType(playlistId); if (type == PlaylistDAO::PLHT_NOT_HIDDEN || type == PlaylistDAO::PLHT_UNKNOWN) { // In case of a deleted Playlist updateChildModel(playlistId); @@ -250,8 +262,7 @@ void PlaylistFeature::slotPlaylistContentChanged(QSet playlistIds) { } void PlaylistFeature::slotPlaylistTableRenamed( - int playlistId, - QString newName) { + int playlistId, QString newName) { Q_UNUSED(newName); //qDebug() << "slotPlaylistTableChanged() playlistId:" << playlistId; enum PlaylistDAO::HiddenType type = m_playlistDao.getHiddenType(playlistId); @@ -267,10 +278,20 @@ void PlaylistFeature::slotPlaylistTableRenamed( QString PlaylistFeature::getRootViewHtml() const { QString playlistsTitle = tr("Playlists"); - QString playlistsSummary = tr("Playlists are ordered lists of songs that allow you to plan your DJ sets."); - QString playlistsSummary2 = tr("Some DJs construct playlists before they perform live, but others prefer to build them on-the-fly."); - QString playlistsSummary3 = tr("When using a playlist during a live DJ set, remember to always pay close attention to how your audience reacts to the music you've chosen to play."); - QString playlistsSummary4 = tr("It may be necessary to skip some songs in your prepared playlist or add some different songs in order to maintain the energy of your audience."); + QString playlistsSummary = + tr("Playlists are ordered lists of songs that allow you to plan " + "your DJ sets."); + QString playlistsSummary2 = + tr("Some DJs construct playlists before they perform live, but " + "others prefer to build them on-the-fly."); + QString playlistsSummary3 = + tr("When using a playlist during a live DJ set, remember to always " + "pay close attention to how your audience reacts to the music " + "you've chosen to play."); + QString playlistsSummary4 = + tr("It may be necessary to skip some songs in your prepared " + "playlist or add some different songs in order to maintain the " + "energy of your audience."); QString createPlaylistLink = tr("Create New Playlist"); QString html; diff --git a/src/library/trackset/setlogfeature.cpp b/src/library/trackset/setlogfeature.cpp index a8ff3e658dc..ae8afc46a68 100644 --- a/src/library/trackset/setlogfeature.cpp +++ b/src/library/trackset/setlogfeature.cpp @@ -27,7 +27,7 @@ SetlogFeature::SetlogFeature( nullptr, pLibrary->trackCollections(), "mixxx.db.model.setlog", - /*keep deleted tracks*/true), + /*keep deleted tracks*/ true), QStringLiteral("SETLOGHOME")), m_playlistId(-1), m_libraryWidget(nullptr), @@ -139,11 +139,12 @@ void SetlogFeature::onRightClickChild(const QPoint& globalPos, QModelIndex index QList SetlogFeature::createPlaylistLabels() { QList playlistLabels; // Setup the sidebar playlist model - QSqlTableModel playlistTableModel(this, m_pLibrary->trackCollections()->internalCollection()->database()); + QSqlTableModel playlistTableModel(this, + m_pLibrary->trackCollections()->internalCollection()->database()); playlistTableModel.setTable("Playlists"); playlistTableModel.setFilter("hidden=2"); // PLHT_SET_LOG - playlistTableModel.setSort(playlistTableModel.fieldIndex("id"), - Qt::AscendingOrder); + playlistTableModel.setSort( + playlistTableModel.fieldIndex("id"), Qt::AscendingOrder); playlistTableModel.select(); while (playlistTableModel.canFetchMore()) { playlistTableModel.fetchMore(); @@ -153,11 +154,11 @@ QList SetlogFeature::createPlaylistLabels() { int idColumn = record.indexOf("id"); for (int row = 0; row < playlistTableModel.rowCount(); ++row) { - int id = playlistTableModel.data( - playlistTableModel.index(row, idColumn)) - .toInt(); - QString name = playlistTableModel.data( - playlistTableModel.index(row, nameColumn)) + int id = + playlistTableModel.data(playlistTableModel.index(row, idColumn)) + .toInt(); + QString name = playlistTableModel + .data(playlistTableModel.index(row, nameColumn)) .toString(); BasePlaylistFeature::IdAndLabel idAndLabel; idAndLabel.id = id; @@ -169,7 +170,8 @@ QList SetlogFeature::createPlaylistLabels() { QString SetlogFeature::fetchPlaylistLabel(int playlistId) { // Setup the sidebar playlist model - QSqlTableModel playlistTableModel(this, m_pLibrary->trackCollections()->internalCollection()->database()); + QSqlTableModel playlistTableModel(this, + m_pLibrary->trackCollections()->internalCollection()->database()); playlistTableModel.setTable("Playlists"); QString filter = "id=" + QString::number(playlistId); playlistTableModel.setFilter(filter); @@ -182,8 +184,7 @@ QString SetlogFeature::fetchPlaylistLabel(int playlistId) { DEBUG_ASSERT(playlistTableModel.rowCount() <= 1); if (playlistTableModel.rowCount() > 0) { - return playlistTableModel.data( - playlistTableModel.index(0, nameColumn)) + return playlistTableModel.data(playlistTableModel.index(0, nameColumn)) .toString(); } return QString(); @@ -216,12 +217,13 @@ void SetlogFeature::slotGetNewPlaylist() { } //qDebug() << "Creating session history playlist name:" << set_log_name; - m_playlistId = m_playlistDao.createPlaylist(set_log_name, - PlaylistDAO::PLHT_SET_LOG); + m_playlistId = m_playlistDao.createPlaylist( + set_log_name, PlaylistDAO::PLHT_SET_LOG); if (m_playlistId == -1) { qDebug() << "Setlog playlist Creation Failed"; - qDebug() << "An unknown error occurred while creating playlist: " << set_log_name; + qDebug() << "An unknown error occurred while creating playlist: " + << set_log_name; } slotPlaylistTableChanged(m_playlistId); // For moving selection @@ -239,12 +241,14 @@ void SetlogFeature::slotJoinWithPrevious() { bool locked = m_playlistDao.isPlaylistLocked(currentPlaylistId); if (locked) { - qDebug() << "Skipping playlist deletion because playlist" << currentPlaylistId << "is locked."; + qDebug() << "Skipping playlist deletion because playlist" + << currentPlaylistId << "is locked."; return; } // Add every track from right-clicked playlist to that with the next smaller ID - int previousPlaylistId = m_playlistDao.getPreviousPlaylist(currentPlaylistId, PlaylistDAO::PLHT_SET_LOG); + int previousPlaylistId = m_playlistDao.getPreviousPlaylist( + currentPlaylistId, PlaylistDAO::PLHT_SET_LOG); if (previousPlaylistId >= 0) { m_pPlaylistTableModel->setTableModel(previousPlaylistId); @@ -256,7 +260,8 @@ void SetlogFeature::slotJoinWithPrevious() { for (int i = 0; i < rows; ++i) { QModelIndex index = m_pPlaylistTableModel->index(i, 0); if (index.isValid()) { - TrackPointer track = m_pPlaylistTableModel->getTrack(index); + TrackPointer track = + m_pPlaylistTableModel->getTrack(index); // Do not update the play count, just set played status. PlayCounter playCounter(track->getPlayCounter()); playCounter.setPlayed(); @@ -267,10 +272,14 @@ void SetlogFeature::slotJoinWithPrevious() { // Change current setlog m_playlistId = previousPlaylistId; } - qDebug() << "slotJoinWithPrevious() current:" << currentPlaylistId << " previous:" << previousPlaylistId; - if (m_playlistDao.copyPlaylistTracks(currentPlaylistId, previousPlaylistId)) { + qDebug() << "slotJoinWithPrevious() current:" + << currentPlaylistId + << " previous:" << previousPlaylistId; + if (m_playlistDao.copyPlaylistTracks( + currentPlaylistId, previousPlaylistId)) { m_playlistDao.deletePlaylist(currentPlaylistId); - slotPlaylistTableChanged(previousPlaylistId); // For moving selection + slotPlaylistTableChanged( + previousPlaylistId); // For moving selection emit showTrackModel(m_pPlaylistTableModel); } } @@ -317,7 +326,8 @@ void SetlogFeature::slotPlayingTrackChanged(TrackPointer currentPlayingTrack) { if (m_pPlaylistTableModel->getPlaylist() == m_playlistId) { // View needs a refresh - WTrackTableView* view = dynamic_cast(m_libraryWidget->getActiveView()); + WTrackTableView* view = dynamic_cast( + m_libraryWidget->getActiveView()); if (view != nullptr) { // We have a active view on the history. The user may have some // important active selection. For example putting track into crates @@ -331,8 +341,8 @@ void SetlogFeature::slotPlayingTrackChanged(TrackPointer currentPlayingTrack) { } } else { // TODO(XXX): Care whether the append succeeded. - m_playlistDao.appendTrackToPlaylist(currentPlayingTrackId, - m_playlistId); + m_playlistDao.appendTrackToPlaylist( + currentPlayingTrackId, m_playlistId); } } @@ -348,7 +358,8 @@ void SetlogFeature::slotPlaylistTableChanged(int playlistId) { void SetlogFeature::slotPlaylistContentChanged(QSet playlistIds) { for (const auto playlistId : qAsConst(playlistIds)) { - enum PlaylistDAO::HiddenType type = m_playlistDao.getHiddenType(playlistId); + enum PlaylistDAO::HiddenType type = + m_playlistDao.getHiddenType(playlistId); if (type == PlaylistDAO::PLHT_SET_LOG || type == PlaylistDAO::PLHT_UNKNOWN) { // In case of a deleted Playlist updateChildModel(playlistId); @@ -356,9 +367,7 @@ void SetlogFeature::slotPlaylistContentChanged(QSet playlistIds) { } } -void SetlogFeature::slotPlaylistTableRenamed( - int playlistId, - QString newName) { +void SetlogFeature::slotPlaylistTableRenamed(int playlistId, QString newName) { Q_UNUSED(newName); //qDebug() << "slotPlaylistTableChanged() playlistId:" << playlistId; enum PlaylistDAO::HiddenType type = m_playlistDao.getHiddenType(playlistId); @@ -374,10 +383,20 @@ void SetlogFeature::slotPlaylistTableRenamed( QString SetlogFeature::getRootViewHtml() const { QString playlistsTitle = tr("History"); - QString playlistsSummary = tr("The history section automatically keeps a list of tracks you play in your DJ sets."); - QString playlistsSummary2 = tr("This is handy for remembering what worked in your DJ sets, posting set-lists, or reporting your plays to licensing organizations."); - QString playlistsSummary3 = tr("Every time you start Mixxx, a new history section is created. You can export it as a playlist in various formats or play it again with Auto DJ."); - QString playlistsSummary4 = tr("You can join the current history session with a previous one by right-clicking and selecting \"Join with previous\"."); + QString playlistsSummary = + tr("The history section automatically keeps a list of tracks you " + "play in your DJ sets."); + QString playlistsSummary2 = + tr("This is handy for remembering what worked in your DJ sets, " + "posting set-lists, or reporting your plays to licensing " + "organizations."); + QString playlistsSummary3 = + tr("Every time you start Mixxx, a new history section is created. " + "You can export it as a playlist in various formats or play it " + "again with Auto DJ."); + QString playlistsSummary4 = + tr("You can join the current history session with a previous one " + "by right-clicking and selecting \"Join with previous\"."); QString html; html.append(QStringLiteral("

%1

").arg(playlistsTitle)); diff --git a/src/library/trackset/tracksettablemodel.h b/src/library/trackset/tracksettablemodel.h index bb569e6e93c..649d33ef325 100644 --- a/src/library/trackset/tracksettablemodel.h +++ b/src/library/trackset/tracksettablemodel.h @@ -6,7 +6,9 @@ class TrackSetTableModel : public BaseSqlTableModel { Q_OBJECT public: - TrackSetTableModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager, const char* settingsNamespace); + TrackSetTableModel(QObject* parent, + TrackCollectionManager* pTrackCollectionManager, + const char* settingsNamespace); bool isColumnInternal(int column) override; }; diff --git a/src/mixxxapplication.cpp b/src/mixxxapplication.cpp index ff043aff2f8..80fe8a56bdc 100644 --- a/src/mixxxapplication.cpp +++ b/src/mixxxapplication.cpp @@ -1,9 +1,9 @@ -#include -#include -#include - #include "mixxxapplication.h" +#include +#include +#include + #include "audio/types.h" #include "control/controlproxy.h" #include "library/trackset/crate/crateid.h" diff --git a/src/test/cratestorage_test.cpp b/src/test/cratestorage_test.cpp index 5336665ab5f..a9ca08af664 100644 --- a/src/test/cratestorage_test.cpp +++ b/src/test/cratestorage_test.cpp @@ -1,7 +1,6 @@ -#include "test/librarytest.h" - #include "library/trackset/crate/cratestorage.h" +#include "test/librarytest.h" class CrateStorageTest : public LibraryTest { protected: diff --git a/src/widget/wtrackmenu.cpp b/src/widget/wtrackmenu.cpp index c9dea770318..f5c075015cc 100644 --- a/src/widget/wtrackmenu.cpp +++ b/src/widget/wtrackmenu.cpp @@ -7,7 +7,6 @@ #include "control/controlobject.h" #include "control/controlproxy.h" #include "library/coverartutils.h" -#include "library/trackset/crate/cratefeaturehelper.h" #include "library/dao/trackdao.h" #include "library/dao/trackschema.h" #include "library/dlgtagfetcher.h" @@ -19,6 +18,7 @@ #include "library/trackcollection.h" #include "library/trackcollectionmanager.h" #include "library/trackmodel.h" +#include "library/trackset/crate/cratefeaturehelper.h" #include "mixer/playermanager.h" #include "preferences/colorpalettesettings.h" #include "sources/soundsourceproxy.h"