diff options
author | Daniel Schürmann <daschuer@mixxx.org> | 2020-05-23 04:18:42 +0200 |
---|---|---|
committer | Janek <xerusx@pm.me> | 2020-05-27 11:56:10 +0200 |
commit | 4f032f70ad43354ac9c72344e5b8a6c1031430f6 (patch) | |
tree | 64729e9f50e5ef1574361ff71d702eded4609e7e | |
parent | 9eb5ec673ba8a4569cb74fe654e5a30e0b38a2e1 (diff) |
clang-format
25 files changed, 453 insertions, 355 deletions
diff --git a/src/library/autodj/autodjfeature.cpp b/src/library/autodj/autodjfeature.cpp index f0cf78c324..659338d091 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 <QtDebug> -#include <QMetaObject> -#include <QMenu> - #include "library/autodj/autodjfeature.h" +#include <QMenu> +#include <QMetaObject> +#include <QtDebug> + #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 74db112863..5b23464d0d 100644 --- a/src/library/autodj/autodjfeature.h +++ b/src/library/autodj/autodjfeature.h @@ -5,22 +5,22 @@ #ifndef AUTODJFEATURE_H #define AUTODJFEATURE_H -#include <QObject> -#include <QStringListModel> -#include <QVariant> +#include <QAction> #include <QIcon> -#include <QUrl> #include <QList> #include <QModelIndex> +#include <QObject> #include <QPoint> -#include <QAction> #include <QPointer> +#include <QStringListModel> +#include <QUrl> +#include <QVariant> +#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 c579225ed7..d8242379c8 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<BaseTrackCache> 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 39111e2060..a57739a69f 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 1b13d71719..6f76a70c6d 100644 --- a/src/library/dao/autodjcratesdao.cpp +++ b/src/library/dao/autodjcratesdao.cpp @@ -1,16 +1,16 @@ +#include "library/dao/autodjcratesdao.h" + #include <QtDebug> #include <QtSql> -#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 74c4d2bd12..4697400885 100644 --- a/src/library/dao/autodjcratesdao.h +++ b/src/library/dao/autodjcratesdao.h @@ -4,8 +4,8 @@ #include <QObject> #include <QSqlDatabase> -#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 918bcc4dd5..bd37244fdf 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<int>& positions, const QHash<int, TrackId>& allIds) { +void PlaylistDAO::shuffleTracks(const int playlistId, + const QList<int>& positions, + const QHash<int, TrackId>& allIds) { ScopedTransaction transaction(m_database); QSqlQuery query(m_database); diff --git a/src/library/dao/trackdao.cpp b/src/library/dao/trackdao.cpp index 17688572b8..a2bde18e37 100644 --- a/src/library/dao/trackdao.cpp +++ b/src/library/dao/trackdao.cpp @@ -1,43 +1,42 @@ #include "library/dao/trackdao.h" -#include <QtDebug> +#include <QChar> #include <QDir> #include <QDirIterator> #include <QFileInfo> -#include <QtSql> #include <QImage> #include <QRegExp> -#include <QChar> +#include <QtDebug> +#include <QtSql> -#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 4132d92211..b46bde650e 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 1cccb1b6e5..926950fa27 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 61dd8e5a93..ede7bae4cb 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 f04fbe9e22..af176ed197 100644 --- a/src/library/searchquery.cpp +++ b/src/library/searchquery.cpp @@ -1,14 +1,13 @@ -#include <QtDebug> - #include "library/searchquery.h" -#include "library/queryutil.h" -#include "track/keyutils.h" +#include <QtDebug> + #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 b0f0aa5275..c6b522f509 100644 --- a/src/library/searchquery.h +++ b/src/library/searchquery.h @@ -1,20 +1,19 @@ #ifndef SEARCHQUERY_H #define SEARCHQUERY_H -#include <vector> -#include <utility> - #include <QList> -#include <QSqlDatabase> #include <QRegExp> +#include <QSqlDatabase> #include <QString> #include <QStringList> +#include <utility> +#include <vector> -#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 d9657e4012..db99eb8e35 100644 --- a/src/library/trackcollection.h +++ b/src/library/trackcollection.h @@ -5,14 +5,14 @@ #include <QSharedPointer> #include <QSqlDatabase> -#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 9ee1ccd69a..3660870225 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 adb114ebdb..15343261b1 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<PlaylistTableModel> 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<PlaylistTableModel> 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 8e34913682..85f11db9a4 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("<a style=\"color:#0496FF;\" href=\"create\">%1</a>") - .arg(createCrateLink)); + html.append( + QStringLiteral("<a style=\"color:#0496FF;\" href=\"create\">%1</a>") + .arg(createCrateLink)); return html; } @@ -187,8 +193,7 @@ std::unique_ptr<TreeItem> 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::updateTreeItemFor |