diff options
Diffstat (limited to 'src/library/crate/cratefeature.cpp')
-rw-r--r-- | src/library/crate/cratefeature.cpp | 114 |
1 files changed, 76 insertions, 38 deletions
diff --git a/src/library/crate/cratefeature.cpp b/src/library/crate/cratefeature.cpp index bcc5cd83fc..d6d52dd32c 100644 --- a/src/library/crate/cratefeature.cpp +++ b/src/library/crate/cratefeature.cpp @@ -63,69 +63,105 @@ CrateFeature::~CrateFeature() { void CrateFeature::initActions() { m_pCreateCrateAction = make_parented<QAction>(tr("Create New Crate"), this); - connect(m_pCreateCrateAction.get(), SIGNAL(triggered()), - this, SLOT(slotCreateCrate())); + connect(m_pCreateCrateAction.get(), + &QAction::triggered, + this, + &CrateFeature::slotCreateCrate); m_pDeleteCrateAction = make_parented<QAction>(tr("Remove"), this); - connect(m_pDeleteCrateAction.get(), SIGNAL(triggered()), - this, SLOT(slotDeleteCrate())); + connect(m_pDeleteCrateAction.get(), + &QAction::triggered, + this, + &CrateFeature::slotDeleteCrate); m_pRenameCrateAction = make_parented<QAction>(tr("Rename"), this); - connect(m_pRenameCrateAction.get(), SIGNAL(triggered()), - this, SLOT(slotRenameCrate())); + connect(m_pRenameCrateAction.get(), + &QAction::triggered, + this, + &CrateFeature::slotRenameCrate); m_pLockCrateAction = make_parented<QAction>(tr("Lock"), this); - connect(m_pLockCrateAction.get(), SIGNAL(triggered()), - this, SLOT(slotToggleCrateLock())); + connect(m_pLockCrateAction.get(), + &QAction::triggered, + this, + &CrateFeature::slotToggleCrateLock); m_pImportPlaylistAction = make_parented<QAction>(tr("Import Crate"), this); - connect(m_pImportPlaylistAction.get(), SIGNAL(triggered()), - this, SLOT(slotImportPlaylist())); + connect(m_pImportPlaylistAction.get(), + &QAction::triggered, + this, + &CrateFeature::slotImportPlaylist); m_pCreateImportPlaylistAction = make_parented<QAction>(tr("Import Crate"), this); - connect(m_pCreateImportPlaylistAction.get(), SIGNAL(triggered()), - this, SLOT(slotCreateImportCrate())); + connect(m_pCreateImportPlaylistAction.get(), + &QAction::triggered, + this, + &CrateFeature::slotCreateImportCrate); m_pExportPlaylistAction = make_parented<QAction>(tr("Export Crate"), this); - connect(m_pExportPlaylistAction.get(), SIGNAL(triggered()), - this, SLOT(slotExportPlaylist())); + connect(m_pExportPlaylistAction.get(), + &QAction::triggered, + this, + &CrateFeature::slotExportPlaylist); m_pExportTrackFilesAction = make_parented<QAction>(tr("Export Track Files"), this); - connect(m_pExportTrackFilesAction.get(), SIGNAL(triggered()), - this, SLOT(slotExportTrackFiles())); + connect(m_pExportTrackFilesAction.get(), + &QAction::triggered, + this, + &CrateFeature::slotExportTrackFiles); m_pDuplicateCrateAction = make_parented<QAction>(tr("Duplicate"), this); - connect(m_pDuplicateCrateAction.get(), SIGNAL(triggered()), - this, SLOT(slotDuplicateCrate())); + connect(m_pDuplicateCrateAction.get(), + &QAction::triggered, + this, + &CrateFeature::slotDuplicateCrate); m_pAnalyzeCrateAction = make_parented<QAction>(tr("Analyze entire Crate"), this); - connect(m_pAnalyzeCrateAction.get(), SIGNAL(triggered()), - this, SLOT(slotAnalyzeCrate())); + connect(m_pAnalyzeCrateAction.get(), + &QAction::triggered, + this, + &CrateFeature::slotAnalyzeCrate); m_pAutoDjTrackSourceAction = make_parented<QAction>(tr("Auto DJ Track Source"), this); m_pAutoDjTrackSourceAction->setCheckable(true); - connect(m_pAutoDjTrackSourceAction.get(), SIGNAL(changed()), - this, SLOT(slotAutoDjTrackSourceChanged())); + connect(m_pAutoDjTrackSourceAction.get(), + &QAction::changed, + this, + &CrateFeature::slotAutoDjTrackSourceChanged); } void CrateFeature::connectLibrary(Library* pLibrary) { - connect(pLibrary, SIGNAL(trackSelected(TrackPointer)), - this, SLOT(slotTrackSelected(TrackPointer))); - connect(pLibrary, SIGNAL(switchToView(const QString&)), - this, SLOT(slotResetSelectedTrack())); + connect(pLibrary, + &Library::trackSelected, + this, + &CrateFeature::slotTrackSelected); + connect(pLibrary, + &Library::switchToView, + this, + &CrateFeature::slotResetSelectedTrack); } void CrateFeature::connectTrackCollection() { - connect(m_pTrackCollection, SIGNAL(crateInserted(CrateId)), - this, SLOT(slotCrateTableChanged(CrateId))); - connect(m_pTrackCollection, SIGNAL(crateUpdated(CrateId)), - this, SLOT(slotCrateTableChanged(CrateId))); - connect(m_pTrackCollection, SIGNAL(crateDeleted(CrateId)), - this, SLOT(slotCrateTableChanged(CrateId))); - connect(m_pTrackCollection, SIGNAL(crateTracksChanged(CrateId, QList<TrackId>, QList<TrackId>)), - this, SLOT(slotCrateContentChanged(CrateId))); - connect(m_pTrackCollection, SIGNAL(crateSummaryChanged(QSet<CrateId>)), - this, SLOT(slotUpdateCrateLabels(QSet<CrateId>))); + connect(m_pTrackCollection, + &TrackCollection::crateInserted, + this, + &CrateFeature::slotCrateTableChanged); + connect(m_pTrackCollection, + &TrackCollection::crateUpdated, + this, + &CrateFeature::slotCrateTableChanged); + connect(m_pTrackCollection, + &TrackCollection::crateDeleted, + this, + &CrateFeature::slotCrateTableChanged); + connect(m_pTrackCollection, + &TrackCollection::crateTracksChanged, + this, + &CrateFeature::slotCrateContentChanged); + connect(m_pTrackCollection, + &TrackCollection::crateSummaryChanged, + this, + &CrateFeature::slotUpdateCrateLabels); } QVariant CrateFeature::title() { @@ -243,8 +279,10 @@ void CrateFeature::bindWidget(WLibrary* libraryWidget, WLibraryTextBrowser* edit = new WLibraryTextBrowser(libraryWidget); edit->setHtml(formatRootViewHtml()); edit->setOpenLinks(false); - connect(edit, SIGNAL(anchorClicked(const QUrl)), - this, SLOT(htmlLinkClicked(const QUrl))); + connect(edit, + &WLibraryTextBrowser::anchorClicked, + this, + &CrateFeature::htmlLinkClicked); libraryWidget->registerView("CRATEHOME", edit); } |