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