summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2019-09-29 14:26:06 +0200
committerGitHub <noreply@github.com>2019-09-29 14:26:06 +0200
commit95388238416f4c4042c8d2f60d39a04e9b5c8278 (patch)
tree985ddc0a6a6f1ec06cff33e6c9d4165a2b66704f
parente83391331111f987d7dfee3f2885ac574ddd6f46 (diff)
parent85999453769063e2399a536a1f8bd815d879efd8 (diff)
Merge pull request #2292 from ferranpujolcamins/new-signals-slots-syntax-library
New signals slots syntax in library
-rw-r--r--src/library/analysisfeature.cpp42
-rw-r--r--src/library/autodj/autodjfeature.cpp85
-rw-r--r--src/library/autodj/dlgautodj.cpp95
-rw-r--r--src/library/baseexternallibraryfeature.cpp18
-rw-r--r--src/library/baseplaylistfeature.cpp130
-rw-r--r--src/library/basesqltablemodel.cpp37
-rw-r--r--src/library/basetrackcache.h2
-rw-r--r--src/library/browse/browsefeature.cpp52
-rw-r--r--src/library/browse/browsefeature.h9
-rw-r--r--src/library/browse/browsetablemodel.cpp25
-rw-r--r--src/library/coverartcache.cpp5
-rw-r--r--src/library/coverartdelegate.cpp32
-rw-r--r--src/library/coverartdelegate.h10
-rw-r--r--src/library/crate/cratefeature.cpp114
-rw-r--r--src/library/dao/autodjcratesdao.cpp65
-rw-r--r--src/library/dao/trackdao.cpp18
-rw-r--r--src/library/dlganalysis.cpp66
-rw-r--r--src/library/dlgcoverartfullsize.cpp36
-rw-r--r--src/library/dlghidden.cpp58
-rw-r--r--src/library/dlgmissing.cpp25
-rw-r--r--src/library/dlgtrackinfo.cpp181
-rw-r--r--src/library/export/trackexportdlg.cpp20
-rw-r--r--src/library/itunes/itunesfeature.cpp5
-rw-r--r--src/library/library.cpp184
-rw-r--r--src/library/librarycontrol.cpp191
-rw-r--r--src/library/librarycontrol.h8
-rw-r--r--src/library/mixxxlibraryfeature.cpp48
-rw-r--r--src/library/playlisttablemodel.cpp6
-rw-r--r--src/library/previewbuttondelegate.cpp26
-rw-r--r--src/library/previewbuttondelegate.h3
-rw-r--r--src/library/recording/dlgrecording.cpp56
-rw-r--r--src/library/recording/recordingfeature.cpp30
-rw-r--r--src/library/rhythmbox/rhythmboxfeature.cpp6
-rw-r--r--src/library/scanner/libraryscanner.cpp120
-rw-r--r--src/library/scanner/libraryscannerdlg.cpp9
-rw-r--r--src/library/setlogfeature.cpp17
-rw-r--r--src/library/sidebarmodel.cpp68
-rw-r--r--src/library/songdownloader.cpp31
-rw-r--r--src/library/stardelegate.cpp9
-rw-r--r--src/library/traktor/traktorfeature.cpp6
-rw-r--r--src/widget/wlibrarytableview.cpp1
-rw-r--r--src/widget/wlibrarytableview.h4
42 files changed, 1278 insertions, 675 deletions
diff --git a/src/library/analysisfeature.cpp b/src/library/analysisfeature.cpp
index 779eed475d..2eeff2b019 100644
--- a/src/library/analysisfeature.cpp
+++ b/src/library/analysisfeature.cpp
@@ -86,20 +86,34 @@ void AnalysisFeature::bindWidget(WLibrary* libraryWidget,
m_pAnalysisView = new DlgAnalysis(libraryWidget,
m_pConfig,
m_library);
- connect(m_pAnalysisView, SIGNAL(loadTrack(TrackPointer)),
- this, SIGNAL(loadTrack(TrackPointer)));
- connect(m_pAnalysisView, SIGNAL(loadTrackToPlayer(TrackPointer, QString)),
- this, SIGNAL(loadTrackToPlayer(TrackPointer, QString)));
- connect(m_pAnalysisView, SIGNAL(analyzeTracks(QList<TrackId>)),
- this, SLOT(analyzeTracks(QList<TrackId>)));
- connect(m_pAnalysisView, SIGNAL(stopAnalysis()),
- this, SLOT(stopAnalysis()));
-
- connect(m_pAnalysisView, SIGNAL(trackSelected(TrackPointer)),
- this, SIGNAL(trackSelected(TrackPointer)));
-
- connect(this, SIGNAL(analysisActive(bool)),
- m_pAnalysisView, SLOT(slotAnalysisActive(bool)));
+ connect(m_pAnalysisView,
+ &DlgAnalysis::loadTrack,
+ this,
+ &AnalysisFeature::loadTrack);
+ connect(m_pAnalysisView,
+ &DlgAnalysis::loadTrackToPlayer,
+ this,
+ [=](TrackPointer track, QString group) {
+ emit loadTrackToPlayer(track, group, false);
+ });
+ connect(m_pAnalysisView,
+ &DlgAnalysis::analyzeTracks,
+ this,
+ &AnalysisFeature::analyzeTracks);
+ connect(m_pAnalysisView,
+ &DlgAnalysis::stopAnalysis,
+ this,
+ &AnalysisFeature::stopAnalysis);
+
+ connect(m_pAnalysisView,
+ &DlgAnalysis::trackSelected,
+ this,
+ &AnalysisFeature::trackSelected);
+
+ connect(this,
+ &AnalysisFeature::analysisActive,
+ m_pAnalysisView,
+ &DlgAnalysis::slotAnalysisActive);
m_pAnalysisView->installEventFilter(keyboard);
diff --git a/src/library/autodj/autodjfeature.cpp b/src/library/autodj/autodjfeature.cpp
index 3ec62d7d6b..9bba9e0221 100644
--- a/src/library/autodj/autodjfeature.cpp
+++ b/src/library/autodj/autodjfeature.cpp
@@ -8,18 +8,19 @@
#include "library/autodj/autodjfeature.h"
+#include "controllers/keyboard/keyboardeventfilter.h"
+#include "library/autodj/autodjprocessor.h"
+#include "library/autodj/dlgautodj.h"
+#include "library/crate/cratestorage.h"
#include "library/library.h"
#include "library/parser.h"
-#include "mixer/playermanager.h"
-#include "library/autodj/autodjprocessor.h"
#include "library/trackcollection.h"
-#include "library/autodj/dlgautodj.h"
#include "library/treeitem.h"
-#include "library/crate/cratestorage.h"
-#include "widget/wlibrary.h"
-#include "controllers/keyboard/keyboardeventfilter.h"
+#include "mixer/playermanager.h"
#include "sources/soundsourceproxy.h"
+#include "util/compatibility.h"
#include "util/dnd.h"
+#include "widget/wlibrary.h"
const QString AutoDJFeature::m_sAutoDJViewName = QString("Auto DJ");
@@ -58,8 +59,10 @@ AutoDJFeature::AutoDJFeature(Library* pLibrary,
qRegisterMetaType<AutoDJProcessor::AutoDJState>("AutoDJState");
m_pAutoDJProcessor = new AutoDJProcessor(
this, m_pConfig, pPlayerManager, m_iAutoDJPlaylistId, m_pTrackCollection);
- connect(m_pAutoDJProcessor, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)),
- this, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)));
+ connect(m_pAutoDJProcessor,
+ &AutoDJProcessor::loadTrackToPlayer,
+ this,
+ &AutoDJFeature::loadTrackToPlayer);
m_playlistDao.setAutoDJProcessor(m_pAutoDJProcessor);
// Create the "Crates" tree-item under the root item.
@@ -73,20 +76,30 @@ AutoDJFeature::AutoDJFeature(Library* pLibrary,
m_childModel.setRootItem(std::move(pRootItem));
// Be notified when the status of crates changes.
- connect(m_pTrackCollection, SIGNAL(crateInserted(CrateId)),
- this, SLOT(slotCrateChanged(CrateId)));
- connect(m_pTrackCollection, SIGNAL(crateUpdated(CrateId)),
- this, SLOT(slotCrateChanged(CrateId)));
- connect(m_pTrackCollection, SIGNAL(crateDeleted(CrateId)),
- this, SLOT(slotCrateChanged(CrateId)));
+ connect(m_pTrackCollection,
+ &TrackCollection::crateInserted,
+ this,
+ &AutoDJFeature::slotCrateChanged);
+ connect(m_pTrackCollection,
+ &TrackCollection::crateUpdated,
+ this,
+ &AutoDJFeature::slotCrateChanged);
+ connect(m_pTrackCollection,
+ &TrackCollection::crateDeleted,
+ this,
+ &AutoDJFeature::slotCrateChanged);
// Create context-menu items to allow crates to be added to, and removed
// from, the auto-DJ queue.
- connect(&m_crateMapper, SIGNAL(mapped(int)),
- this, SLOT(slotAddCrateToAutoDj(int)));
+ connect(&m_crateMapper,
+ QOverload<int>::of(&QSignalMapper::mapped),
+ this,
+ &AutoDJFeature::slotAddCrateToAutoDj);
m_pRemoveCrateFromAutoDj = new QAction(tr("Remove Crate as Track Source"), this);
- connect(m_pRemoveCrateFromAutoDj, SIGNAL(triggered()),
- this, SLOT(slotRemoveCrateFromAutoDj()));
+ connect(m_pRemoveCrateFromAutoDj,
+ &QAction::triggered,
+ this,
+ &AutoDJFeature::slotRemoveCrateFromAutoDj);
}
AutoDJFeature::~AutoDJFeature() {
@@ -111,19 +124,29 @@ void AutoDJFeature::bindWidget(WLibrary* libraryWidget,
m_pTrackCollection,
keyboard);
libraryWidget->registerView(m_sAutoDJViewName, m_pAutoDJView);
- connect(m_pAutoDJView, SIGNAL(loadTrack(TrackPointer)),
- this, SIGNAL(loadTrack(TrackPointer)));
- connect(m_pAutoDJView, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)),
- this, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)));
-
- connect(m_pAutoDJView, SIGNAL(trackSelected(TrackPointer)),
- this, SIGNAL(trackSelected(TrackPointer)));
+ connect(m_pAutoDJView,
+ &DlgAutoDJ::loadTrack,
+ this,
+ &AutoDJFeature::loadTrack);
+ connect(m_pAutoDJView,
+ &DlgAutoDJ::loadTrackToPlayer,
+ this,
+ &AutoDJFeature::loadTrackToPlayer);
+
+ connect(m_pAutoDJView,
+ &DlgAutoDJ::trackSelected,
+ this,
+ &AutoDJFeature::trackSelected);
// Be informed when the user wants to add another random track.
- connect(m_pAutoDJProcessor,SIGNAL(randomTrackRequested(int)),
- this,SLOT(slotRandomQueue(int)));
- connect(m_pAutoDJView, SIGNAL(addRandomButton(bool)),
- this, SLOT(slotAddRandomTrack()));
+ connect(m_pAutoDJProcessor,
+ &AutoDJProcessor::randomTrackRequested,
+ this,
+ &AutoDJFeature::slotRandomQueue);
+ connect(m_pAutoDJView,
+ &DlgAutoDJ::addRandomButton,
+ this,
+ &AutoDJFeature::slotAddRandomTrack);
}
TreeItemModel* AutoDJFeature::getChildModel() {
@@ -280,7 +303,9 @@ void AutoDJFeature::onRightClickChild(const QPoint& globalPos,
while (nonAutoDjCrates.populateNext(&crate)) {
auto pAction = std::make_unique<QAction>(crate.getName(), &crateMenu);
m_crateMapper.setMapping(pAction.get(), crate.getId().value());
- connect(pAction.get(), SIGNAL(triggered()), &m_crateMapper, SLOT(map()));
+ connect(pAction.get(),
+ &QAction::triggered,
+ [=](bool) { m_crateMapper.map(); });
crateMenu.addAction(pAction.get());
pAction.release();
}
diff --git a/src/library/autodj/dlgautodj.cpp b/src/library/autodj/dlgautodj.cpp
index 311bbf6d38..d03de12e68 100644
--- a/src/library/autodj/dlgautodj.cpp
+++ b/src/library/autodj/dlgautodj.cpp
@@ -3,9 +3,10 @@
#include "library/autodj/dlgautodj.h"
#include "library/playlisttablemodel.h"
-#include "widget/wtracktableview.h"
#include "util/assert.h"
+#include "util/compatibility.h"
#include "util/duration.h"
+#include "widget/wtracktableview.h"
DlgAutoDJ::DlgAutoDJ(QWidget* parent,
UserSettingsPointer pConfig,
@@ -23,21 +24,35 @@ DlgAutoDJ::DlgAutoDJ(QWidget* parent,
setupUi(this);
m_pTrackTableView->installEventFilter(pKeyboard);
- connect(m_pTrackTableView, SIGNAL(loadTrack(TrackPointer)),
- this, SIGNAL(loadTrack(TrackPointer)));
- connect(m_pTrackTableView, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)),
- this, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)));
- connect(m_pTrackTableView, SIGNAL(trackSelected(TrackPointer)),
- this, SIGNAL(trackSelected(TrackPointer)));
- connect(m_pTrackTableView, SIGNAL(trackSelected(TrackPointer)),
- this, SLOT(updateSelectionInfo()));
-
- connect(pLibrary, SIGNAL(setTrackTableFont(QFont)),
- m_pTrackTableView, SLOT(setTrackTableFont(QFont)));
- connect(pLibrary, SIGNAL(setTrackTableRowHeight(int)),
- m_pTrackTableView, SLOT(setTrackTableRowHeight(int)));
- connect(pLibrary, SIGNAL(setSelectedClick(bool)),
- m_pTrackTableView, SLOT(setSelectedClick(bool)));
+ connect(m_pTrackTableView,
+ &WTrackTableView::loadTrack,
+ this,
+ &DlgAutoDJ::loadTrack);
+ connect(m_pTrackTableView,
+ &WTrackTableView::loadTrackToPlayer,
+ this,
+ &DlgAutoDJ::loadTrackToPlayer);
+ connect(m_pTrackTableView,
+ &WTrackTableView::trackSelected,
+ this,
+ &DlgAutoDJ::trackSelected);
+ connect(m_pTrackTableView,
+ &WTrackTableView::trackSelected,
+ this,
+ &DlgAutoDJ::updateSelectionInfo);
+
+ connect(pLibrary,
+ &Library::setTrackTableFont,
+ m_pTrackTableView,
+ &WTrackTableView::setTrackTableFont);
+ connect(pLibrary,
+ &Library::setTrackTableRowHeight,
+ m_pTrackTableView,
+ &WTrackTableView::setTrackTableRowHeight);
+ connect(pLibrary,
+ &Library::setSelectedClick,
+ m_pTrackTableView,
+ &WTrackTableView::setSelectedClick);
QBoxLayout* box = dynamic_cast<QBoxLayout*>(layout());
VERIFY_OR_DEBUG_ASSERT(box) { //Assumes the form layout is a QVBox/QHBoxLayout!
@@ -56,32 +71,48 @@ DlgAutoDJ::DlgAutoDJ(QWidget* parent,
// Do not set this because it disables auto-scrolling
//m_pTrackTableView->setDragDropMode(QAbstractItemView::InternalMove);
- connect(pushButtonShuffle, SIGNAL(clicked(bool)),
- this, SLOT(shufflePlaylistButton(bool)));
+ connect(pushButtonShuffle,
+ &QPushButton::clicked,
+ this,
+ &DlgAutoDJ::shufflePlaylistButton);
- connect(pushButtonSkipNext, SIGNAL(clicked(bool)),
- this, SLOT(skipNextButton(bool)));
+ connect(pushButtonSkipNext,
+ &QPushButton::clicked,
+ this,
+ &DlgAutoDJ::skipNextButton);
- connect(pushButtonAddRandom, SIGNAL(clicked(bool)),
- this, SIGNAL(addRandomButton(bool)));
+ connect(pushButtonAddRandom,
+ &QPushButton::clicked,
+ this,
+ &DlgAutoDJ::addRandomButton);
- connect(pushButtonFadeNow, SIGNAL(clicked(bool)),
- this, SLOT(fadeNowButton(bool)));
+ connect(pushButtonFadeNow,
+ &QPushButton::clicked,
+ this,
+ &DlgAutoDJ::fadeNowButton);
- connect(spinBoxTransition, SIGNAL(valueChanged(int)),
- this, SLOT(transitionSliderChanged(int)));
+ connect(spinBoxTransition,
+ QOverload<int>::of(&QSpinBox::valueChanged),
+ this,
+ &DlgAutoDJ::transitionSliderChanged);
- connect(pushButtonAutoDJ, SIGNAL(toggled(bool)),
- this, SLOT(toggleAutoDJButton(bool)));
+ connect(pushButtonAutoDJ,
+ &QPushButton::toggled,
+ this,
+ &DlgAutoDJ::toggleAutoDJButton);
// Setup DlgAutoDJ UI based on the current AutoDJProcessor state. Keep in
// mind that AutoDJ may already be active when DlgAutoDJ is created (due to
// skin changes, etc.).
spinBoxTransition->setValue(m_pAutoDJProcessor->getTransitionTime());
- connect(m_pAutoDJProcessor, SIGNAL(transitionTimeChanged(int)),
- this, SLOT(transitionTimeChanged(int)));
- connect(m_pAutoDJProcessor, SIGNAL(autoDJStateChanged(AutoDJProcessor::AutoDJState)),
- this, SLOT(autoDJStateChanged(AutoDJProcessor::AutoDJState)));
+ connect(m_pAutoDJProcessor,
+ &AutoDJProcessor::transitionTimeChanged,
+ this,
+ &DlgAutoDJ::transitionTimeChanged);
+ connect(m_pAutoDJProcessor,
+ &AutoDJProcessor::autoDJStateChanged,
+ this,
+ &DlgAutoDJ::autoDJStateChanged);
autoDJStateChanged(m_pAutoDJProcessor->getState());
updateSelectionInfo();
diff --git a/src/library/baseexternallibraryfeature.cpp b/src/library/baseexternallibraryfeature.cpp
index b527c119d3..8eee4928bd 100644
--- a/src/library/baseexternallibraryfeature.cpp
+++ b/src/library/baseexternallibraryfeature.cpp
@@ -9,16 +9,22 @@ BaseExternalLibraryFeature::BaseExternalLibraryFeature(QObject* pParent,
: LibraryFeature(pParent),
m_pTrackCollection(pCollection) {
m_pAddToAutoDJAction = new QAction(tr("Add to Auto DJ Queue (bottom)"), this);
- connect(m_pAddToAutoDJAction, SIGNAL(triggered()),
- this, SLOT(slotAddToAutoDJ()));
+ connect(m_pAddToAutoDJAction,
+ &QAction::triggered,
+ this,
+ &BaseExternalLibraryFeature::slotAddToAutoDJ);
m_pAddToAutoDJTopAction = new QAction(tr("Add to Auto DJ Queue (top)"), this);
- connect(m_pAddToAutoDJTopAction, SIGNAL(triggered()),
- this, SLOT(slotAddToAutoDJTop()));
+ connect(m_pAddToAutoDJTopAction,
+ &QAction::triggered,
+ this,
+ &BaseExternalLibraryFeature::slotAddToAutoDJTop);
m_pImportAsMixxxPlaylistAction = new QAction(tr("Import Playlist"), this);
- connect(m_pImportAsMixxxPlaylistAction, SIGNAL(triggered()),
- this, SLOT(slotImportAsMixxxPlaylist()));
+ connect(m_pImportAsMixxxPlaylistAction,
+ &QAction::triggered,
+ this,
+ &BaseExternalLibraryFeature::slotImportAsMixxxPlaylist);
}
BaseExternalLibraryFeature::~BaseExternalLibraryFeature() {
diff --git a/src/library/baseplaylistfeature.cpp b/src/library/baseplaylistfeature.cpp
index 0c910be770..ba12a351d1 100644
--- a/src/library/baseplaylistfeature.cpp
+++ b/src/library/baseplaylistfeature.cpp
@@ -30,73 +30,111 @@ BasePlaylistFeature::BasePlaylistFeature(QObject* parent,
m_pPlaylistTableModel(NULL),
m_rootViewName(rootViewName) {
m_pCreatePlaylistAction = new QAction(tr("Create New Playlist"),this);
- connect(m_pCreatePlaylistAction, SIGNAL(triggered()),
- this, SLOT(slotCreatePlaylist()));
+ connect(m_pCreatePlaylistAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotCreatePlaylist);
m_pAddToAutoDJAction = new QAction(tr("Add to Auto DJ Queue (bottom)"), this);
- connect(m_pAddToAutoDJAction, SIGNAL(triggered()),
- this, SLOT(slotAddToAutoDJ()));
+ connect(m_pAddToAutoDJAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotAddToAutoDJ);
m_pAddToAutoDJTopAction = new QAction(tr("Add to Auto DJ Queue (top)"), this);
- connect(m_pAddToAutoDJTopAction, SIGNAL(triggered()),
- this, SLOT(slotAddToAutoDJTop()));
+ connect(m_pAddToAutoDJTopAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotAddToAutoDJTop);
m_pDeletePlaylistAction = new QAction(tr("Remove"),this);
- connect(m_pDeletePlaylistAction, SIGNAL(triggered()),
- this, SLOT(slotDeletePlaylist()));
+ connect(m_pDeletePlaylistAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotDeletePlaylist);
m_pRenamePlaylistAction = new QAction(tr("Rename"),this);
- connect(m_pRenamePlaylistAction, SIGNAL(triggered()),
- this, SLOT(slotRenamePlaylist()));
+ connect(m_pRenamePlaylistAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotRenamePlaylist);
m_pLockPlaylistAction = new QAction(tr("Lock"),this);
- connect(m_pLockPlaylistAction, SIGNAL(triggered()),
- this, SLOT(slotTogglePlaylistLock()));
+ connect(m_pLockPlaylistAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotTogglePlaylistLock);
m_pDuplicatePlaylistAction = new QAction(tr("Duplicate"), this);
- connect(m_pDuplicatePlaylistAction, SIGNAL(triggered()),
- this, SLOT(slotDuplicatePlaylist()));
+ connect(m_pDuplicatePlaylistAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotDuplicatePlaylist);
m_pImportPlaylistAction = new QAction(tr("Import Playlist"),this);
- connect(m_pImportPlaylistAction, SIGNAL(triggered()),
- this, SLOT(slotImportPlaylist()));
+ connect(m_pImportPlaylistAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotImportPlaylist);
m_pCreateImportPlaylistAction = new QAction(tr("Import Playlist"), this);
- connect(m_pCreateImportPlaylistAction, SIGNAL(triggered()),
- this, SLOT(slotCreateImportPlaylist()));
+ connect(m_pCreateImportPlaylistAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotCreateImportPlaylist);
m_pExportPlaylistAction = new QAction(tr("Export Playlist"), this);
- connect(m_pExportPlaylistAction, SIGNAL(triggered()),
- this, SLOT(slotExportPlaylist()));
+ connect(m_pExportPlaylistAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotExportPlaylist);
m_pExportTrackFilesAction = new QAction(tr("Export Track Files"), this);
- connect(m_pExportTrackFilesAction, SIGNAL(triggered()),
- this, SLOT(slotExportTrackFiles()));
+ connect(m_pExportTrackFilesAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotExportTrackFiles);
m_pAnalyzePlaylistAction = new QAction(tr("Analyze entire Playlist"), this);
- connect(m_pAnalyzePlaylistAction, SIGNAL(triggered()),
- this, SLOT(slotAnalyzePlaylist()));
-
- connect(&m_playlistDao, SIGNAL(added(int)),
- this, SLOT(slotPlaylistTableChanged(int)));
-
- connect(&m_playlistDao, SIGNAL(deleted(int)),
- this, SLOT(slotPlaylistTableChanged(int)));
-
- connect(&m_playlistDao, SIGNAL(renamed(int,QString)),
- this, SLOT(slotPlaylistTableRenamed(int,QString)));
-
- connect(&m_playlistDao, SIGNAL(changed(int)),
- this, SLOT(slotPlaylistContentChanged(int)));
-
- connect(&m_playlistDao, SIGNAL(lockChanged(int)),
- this, SLOT(slotPlaylistTableChanged(int)));
+ connect(m_pAnalyzePlaylistAction,
+ &QAction::triggered,
+ this,
+ &BasePlaylistFeature::slotAnalyzePlaylist);
+
+ connect(&m_playlistDao,
+ &PlaylistDAO::added,
+ this,
+ &BasePlaylistFeature::slotPlaylistTableChanged);
+
+ connect(&m_playlistDao,
+ &PlaylistDAO::deleted,
+ this,
+ &BasePlaylistFeature::slotPlaylistTableChanged);
+
+ connect(&m_playlistDao,
+ &PlaylistDAO::renamed,
+ this,
+ &BasePlaylistFeature::slotPlaylistTableRenamed);
+
+ connect(&m_playlistDao,
+ &PlaylistDAO::changed,
+ this,
+ &BasePlaylistFeature::slotPlaylistContentChanged);
+
+ connect(&m_playlistDao,
+ &PlaylistDAO::lockChanged,
+ this,
+ &BasePlaylistFeature::slotPlaylistTableChanged);
Library* pLibrary = static_cast<Library*>(parent);
- connect(pLibrary, SIGNAL(trackSelected(TrackPointer)),
- this, SLOT(slotTrackSelected(TrackPointer)));
- connect(pLibrary, SIGNAL(switchToView(const QString&)),
- this, SLOT(slotResetSelectedTrack()));
+ connect(pLibrary,
+ &Library::trackSelected,
+ this,
+ &BasePlaylistFeature::slotTrackSelected);
+ connect(pLibrary,
+ &Library::switchToView,
+ this,
+ &BasePlaylistFeature::slotResetSelectedTrack);
}
BasePlaylistFeature::~BasePlaylistFeature() {
@@ -599,8 +637,10 @@ void BasePlaylistFeature::bindWidget(WLibrary* libraryWidget,
WLibraryTextBrowser* edit = new WLibraryTextBrowser(libraryWidget);
edit->setHtml(getRootViewHtml());
edit->setOpenLinks(false);
- connect(edit, SIGNAL(anchorClicked(const QUrl)),
- this, SLOT(htmlLinkClicked(const QUrl)));
+ connect(edit,
+ &WLibraryTextBrowser::anchorClicked,
+ this,
+ &BasePlaylistFeature::htmlLinkClicked);
libraryWidget->registerView(m_rootViewName, edit);
}
diff --git a/src/library/basesqltablemodel.cpp b/src/library/basesqltablemodel.cpp
index ff3d5dd923..96270efa87 100644
--- a/src/library/basesqltablemodel.cpp
+++ b/src/library/basesqltablemodel.cpp
@@ -2,7 +2,6 @@
#include <QtDebug>
#include <QUrl>
-#include <QTableView>
#include "library/basesqltablemodel.h"
@@ -21,6 +20,7 @@
#include "util/duration.h"
#include "util/assert.h"
#include "util/performancetimer.h"
+#include "widget/wlibrarytableview.h"
static const bool sDebug = false;
@@ -44,10 +44,14 @@ BaseSqlTableModel::BaseSqlTableModel(QObject* pParent,
m_bInitialized(false),
m_currentSearch("") {
DEBUG_ASSERT(m_pTrackCollection);
- connect(&PlayerInfo::instance(), SIGNAL(trackLoaded(QString, TrackPointer)),
- this, SLOT(trackLoaded(QString, TrackPointer)));
- connect(&m_pTrackCollection->getTrackDAO(), SIGNAL(forceModelUpdate()),
- this, SLOT(select()));
+ connect(&PlayerInfo::instance(),
+ &PlayerInfo::trackLoaded,
+ this,
+ &BaseSqlTableModel::trackLoaded);
+ connect(&m_pTrackCollection->getTrackDAO(),
+ &TrackDAO::forceModelUpdate,
+ this,
+ &BaseSqlTableModel::select);
// TODO(rryan): This is a virtual function call from a constructor.
trackLoaded(m_previewDeckGroup, PlayerInfo::instance().getTrackInfo(m_previewDeckGroup));
}
@@ -412,8 +416,10 @@ void BaseSqlTableModel::setTable(const QString& tableName,
m_tableColumns = tableColumns;
if (m_trackSource) {
- disconnect(m_trackSource.data(), SIGNAL(tracksChanged(QSet<TrackId>)),
- this, SLOT(tracksChanged(QSet<TrackId>)));
+ disconnect(m_trackSource.data(),
+ &BaseTrackCache::tracksChanged,
+ this,
+ &BaseSqlTableModel::tracksChanged);
}
m_trackSource = trackSource;
if (m_trackSource) {
@@ -424,8 +430,11 @@ void BaseSqlTableModel::setTable(const QString& tableName,
// TODO: A better fix is to have cache and trackpointers defer saving
// and deleting, so those operations only take place at the top of
// the call stack.
- connect(m_trackSource.data(), SIGNAL(tracksChanged(QSet<TrackId>)),
- this, SLOT(tracksChanged(QSet<TrackId>)), Qt::QueuedConnection);
+ connect(m_trackSource.data(),
+ &BaseTrackCache::tracksChanged,
+ this,
+ &BaseSqlTableModel::tracksChanged,
+ Qt::QueuedConnection);
}
// Build a map from the column names to their indices, used by fieldIndex()
@@ -1104,7 +1113,7 @@ QMimeData* BaseSqlTableModel::mimeData(const QModelIndexList &indexes) const {
}
QAbstractItemDelegate* BaseSqlTableModel::delegateForColumn(const int i, QObject* pParent) {
- QTableView* pTableView = qobject_cast<QTableView*>(pParent);
+ auto* pTableView = qobject_cast<WLibraryTableView*>(pParent);
DEBUG_ASSERT(pTableView);
if (i == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_RATING)) {
@@ -1117,11 +1126,13 @@ QAbstractItemDelegate* BaseSqlTableModel::delegateForColumn(const int i, QObject
return new LocationDelegate(pTableView);
} else if (i == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COVERART)) {
CoverArtDelegate* pCoverDelegate = new CoverArtDelegate(pTableView);
- connect(pCoverDelegate, SIGNAL(coverReadyForCell(int, int)),
- this, SLOT(refreshCell(int, int)));
+ connect(pCoverDelegate,
+ &CoverArtDelegate::coverReadyForCell,
+ this,
+ &BaseSqlTableModel::refreshCell);
return pCoverDelegate;
}
- return NULL;
+ return nullptr;
}
void BaseSqlTableModel::refreshCell(int row, int column) {
diff --git a/src/library/basetrackcache.h b/src/library/basetrackcache.h
index a009618b28..1d77420d6b 100644
--- a/src/library/basetrackcache.h
+++ b/src/library/basetrackcache.h
@@ -79,7 +79,7 @@ class BaseTrackCache : public QObject {
signals:
void tracksChanged(QSet<Tr