diff --git a/src/core/globalshortcuts.cpp b/src/core/globalshortcuts.cpp index 8a8b6e75a..b4623ce8f 100644 --- a/src/core/globalshortcuts.cpp +++ b/src/core/globalshortcuts.cpp @@ -119,7 +119,7 @@ void GlobalShortcuts::AddRatingShortcut(const QString& id, const QString& name, const QKeySequence& default_key) { Shortcut shortcut = AddShortcut(id, name, default_key); connect(shortcut.action, &QAction::triggered, - [this, rating]() { RateCurrentSong(rating); }); + [this, rating]() { emit RateCurrentSong(rating); }); } GlobalShortcuts::Shortcut GlobalShortcuts::AddShortcut( diff --git a/src/devices/devicemanager.cpp b/src/devices/devicemanager.cpp index 148acb921..75fc1fa01 100644 --- a/src/devices/devicemanager.cpp +++ b/src/devices/devicemanager.cpp @@ -681,7 +681,7 @@ void DeviceManager::Forget(QModelIndex idx) { info->LoadIcon(info->BestBackend()->lister_->DeviceIcons(id), info->friendly_name_); - dataChanged(idx, idx); + emit dataChanged(idx, idx); } } diff --git a/src/devices/udisks2lister.cpp b/src/devices/udisks2lister.cpp index 11de7d160..fd3cfbceb 100644 --- a/src/devices/udisks2lister.cpp +++ b/src/devices/udisks2lister.cpp @@ -132,7 +132,7 @@ void Udisks2Lister::UnmountDevice(const QString& id) { } device_data_.remove(id); - DeviceRemoved(id); + emit DeviceRemoved(id); } } @@ -251,7 +251,7 @@ void Udisks2Lister::RemoveDevice(const QDBusObjectPath& device_path) { qLog(Debug) << "UDisks2 device removed: " << device_path.path(); device_data_.remove(id); - DeviceRemoved(id); + emit DeviceRemoved(id); } QList Udisks2Lister::GetMountedPartitionsFromDBusArgument( @@ -297,7 +297,7 @@ void Udisks2Lister::HandleFinishedMountJob( << " | Partition = " << partition_data.dbus_path; QWriteLocker locker(&device_data_lock_); device_data_[partition_data.unique_id()] = partition_data; - DeviceAdded(partition_data.unique_id()); + emit DeviceAdded(partition_data.unique_id()); } void Udisks2Lister::HandleFinishedUnmountJob( @@ -320,7 +320,7 @@ void Udisks2Lister::HandleFinishedUnmountJob( qLog(Debug) << "Partition " << partition_data.dbus_path << " has no more mount points, removing it from device list"; device_data_.remove(id); - DeviceRemoved(id); + emit DeviceRemoved(id); } } diff --git a/src/internet/digitally/digitallyimportedurlhandler.cpp b/src/internet/digitally/digitallyimportedurlhandler.cpp index 261866c4d..3f3bb7d8d 100644 --- a/src/internet/digitally/digitallyimportedurlhandler.cpp +++ b/src/internet/digitally/digitallyimportedurlhandler.cpp @@ -57,7 +57,7 @@ UrlHandler::LoadResult DigitallyImportedUrlHandler::StartLoading( } if (!service_->is_premium_account()) { - service_->StreamError(tr("A premium account is required")); + emit service_->StreamError(tr("A premium account is required")); return LoadResult(url, LoadResult::Error); } @@ -91,7 +91,7 @@ void DigitallyImportedUrlHandler::LoadPlaylistFinished(QIODevice* device) { // Failed to get playlist? if (songs.count() == 0) { - service_->StreamError(tr("Error loading di.fm playlist")); + emit service_->StreamError(tr("Error loading di.fm playlist")); emit AsyncLoadComplete(LoadResult(last_original_url_, LoadResult::Error)); return; } diff --git a/src/library/libraryview.cpp b/src/library/libraryview.cpp index 2153fee3d..3eeed6a0b 100644 --- a/src/library/libraryview.cpp +++ b/src/library/libraryview.cpp @@ -283,16 +283,16 @@ bool LibraryView::RestoreLevelFocus(const QModelIndex& parent) { model()->data(current, LibraryModel::Role_Key).toString(); if (!last_selected_container_.isEmpty() && last_selected_container_ == text) { - emit expand(current); + expand(current); setCurrentIndex(current); return true; } else if (last_selected_path_.contains(text)) { - emit expand(current); + expand(current); // If a selected container or song were not found, we've got into a // wrong subtree // (happens with "unknown" all the time) if (!RestoreLevelFocus(current)) { - emit collapse(current); + collapse(current); } else { return true; } diff --git a/src/playlist/queue.cpp b/src/playlist/queue.cpp index 6e22ae222..87c85bf8e 100644 --- a/src/playlist/queue.cpp +++ b/src/playlist/queue.cpp @@ -242,7 +242,7 @@ void Queue::Clear() { } void Queue::Move(const QList& proxy_rows, int pos) { - layoutAboutToBeChanged(); + emit layoutAboutToBeChanged(); QList moved_items; // Take the items out of the list first, keeping track of whether the @@ -279,7 +279,7 @@ void Queue::Move(const QList& proxy_rows, int pos) { } } - layoutChanged(); + emit layoutChanged(); } void Queue::MoveUp(int row) { Move(QList() << row, row - 1); } @@ -400,7 +400,7 @@ void Queue::Remove(QList& proxy_rows) { std::stable_sort(proxy_rows.begin(), proxy_rows.end()); // reflects immediately changes in the playlist - layoutAboutToBeChanged(); + emit layoutAboutToBeChanged(); int removed_rows = 0; for (int row : proxy_rows) { @@ -412,5 +412,5 @@ void Queue::Remove(QList& proxy_rows) { removed_rows++; } - layoutChanged(); + emit layoutChanged(); } diff --git a/src/ripper/ripper.cpp b/src/ripper/ripper.cpp index a05f58413..2c9539d3c 100644 --- a/src/ripper/ripper.cpp +++ b/src/ripper/ripper.cpp @@ -107,7 +107,7 @@ void Ripper::Cancel() { } transcoder_->Cancel(); RemoveTemporaryDirectory(); - emit(Cancelled()); + emit Cancelled(); } void Ripper::TranscodingJobComplete(const QString& input, const QString& output, @@ -235,7 +235,7 @@ void Ripper::Rip() { it->transcoded_filename); } transcoder_->Start(); - emit(RippingComplete()); + emit RippingComplete(); } // The progress interval is [0, 200*AddedTracks()], where the first @@ -289,7 +289,7 @@ void Ripper::FileTagged(TagReaderReply* reply) { << "files"; if (files_tagged_ == tracks_.length()) { qLog(Debug) << "CD ripper finished."; - emit(Finished()); + emit Finished(); } reply->deleteLater(); diff --git a/src/transcoder/transcoder.cpp b/src/transcoder/transcoder.cpp index 49d9e3d4b..a495ebc08 100644 --- a/src/transcoder/transcoder.cpp +++ b/src/transcoder/transcoder.cpp @@ -146,18 +146,18 @@ GstElement* Transcoder::CreateElementForMimeType(const QString& element_type, GstElement* bin) { SuitableElement best = FindBestElementForMimeType(element_type, mime_type); if (best.name_.isEmpty()) { - LogLine(tr("Suitable element not found")); + emit LogLine(tr("Suitable element not found")); return nullptr; } - LogLine(QString("Using '%1' (rank %2)").arg(best.name_).arg(best.rank_)); + emit LogLine(QString("Using '%1' (rank %2)").arg(best.name_).arg(best.rank_)); if (best.name_ == "lamemp3enc") { // Special case: we need to add xingmux and id3v2mux to the pipeline when // using lamemp3enc because it doesn't write the VBR or ID3v2 headers // itself. - LogLine("Adding xingmux and id3v2mux to the pipeline"); + emit LogLine("Adding xingmux and id3v2mux to the pipeline"); // Create the bin GstElement* mp3bin = gst_bin_new("mp3bin"); @@ -461,16 +461,17 @@ bool Transcoder::StartJob(const Job& job) { if (!src || !decode || !convert || !sink) return false; if (!codec && !job.preset.codec_mimetype_.isEmpty()) { - LogLine(tr("Couldn't find an encoder for %1, check you have the correct " - "GStreamer plugins installed") - .arg(job.preset.codec_mimetype_)); + emit LogLine( + tr("Couldn't find an encoder for %1, check you have the correct " + "GStreamer plugins installed") + .arg(job.preset.codec_mimetype_)); return false; } if (!muxer && !job.preset.muxer_mimetype_.isEmpty()) { - LogLine(tr("Couldn't find a muxer for %1, check you have the correct " - "GStreamer plugins installed") - .arg(job.preset.muxer_mimetype_)); + emit LogLine(tr("Couldn't find a muxer for %1, check you have the correct " + "GStreamer plugins installed") + .arg(job.preset.muxer_mimetype_)); return false; } @@ -618,8 +619,8 @@ void Transcoder::SetElementProperties(const QString& name, GObject* object) { const QVariant value = s.value(property->name); if (value.isNull()) continue; - LogLine(QString("Setting %1 property: %2 = %3") - .arg(name, property->name, value.toString())); + emit LogLine(QString("Setting %1 property: %2 = %3") + .arg(name, property->name, value.toString())); switch (property->value_type) { case G_TYPE_DOUBLE: