Connection syntax migration (#637)
This commit is contained in:
@@ -39,8 +39,8 @@ TagFetcher::TagFetcher(QObject *parent)
|
||||
acoustid_client_(new AcoustidClient(this)),
|
||||
musicbrainz_client_(new MusicBrainzClient(this)) {
|
||||
|
||||
connect(acoustid_client_, SIGNAL(Finished(int, QStringList, QString)), SLOT(PuidsFound(int, QStringList, QString)));
|
||||
connect(musicbrainz_client_, SIGNAL(Finished(int, MusicBrainzClient::ResultList, QString)), SLOT(TagsFetched(int, MusicBrainzClient::ResultList, QString)));
|
||||
QObject::connect(acoustid_client_, &AcoustidClient::Finished, this, &TagFetcher::PuidsFound);
|
||||
QObject::connect(musicbrainz_client_, &MusicBrainzClient::Finished, this, &TagFetcher::TagsFetched);
|
||||
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void TagFetcher::StartFetch(const SongList &songs) {
|
||||
QFuture<QString> future = QtConcurrent::mapped(songs_, GetFingerprint);
|
||||
fingerprint_watcher_ = new QFutureWatcher<QString>(this);
|
||||
fingerprint_watcher_->setFuture(future);
|
||||
connect(fingerprint_watcher_, SIGNAL(resultReadyAt(int)), SLOT(FingerprintFound(int)));
|
||||
QObject::connect(fingerprint_watcher_, &QFutureWatcher<QString>::resultReadyAt, this, &TagFetcher::FingerprintFound);
|
||||
|
||||
for (const Song &song : songs) {
|
||||
emit Progress(song, tr("Fingerprinting song"));
|
||||
@@ -70,7 +70,7 @@ void TagFetcher::Cancel() {
|
||||
if (fingerprint_watcher_) {
|
||||
fingerprint_watcher_->cancel();
|
||||
|
||||
delete fingerprint_watcher_;
|
||||
fingerprint_watcher_->deleteLater();
|
||||
fingerprint_watcher_ = nullptr;
|
||||
}
|
||||
|
||||
@@ -83,9 +83,7 @@ void TagFetcher::Cancel() {
|
||||
void TagFetcher::FingerprintFound(const int index) {
|
||||
|
||||
QFutureWatcher<QString>* watcher = reinterpret_cast<QFutureWatcher<QString>*>(sender());
|
||||
if (!watcher || index >= songs_.count()) {
|
||||
return;
|
||||
}
|
||||
if (!watcher || index >= songs_.count()) return;
|
||||
|
||||
const QString fingerprint = watcher->resultAt(index);
|
||||
const Song &song = songs_[index];
|
||||
|
||||
Reference in New Issue
Block a user