Replace emit with Q_EMIT

This commit is contained in:
Jonas Kvinge 2024-08-25 01:06:30 +02:00
parent cb0db8750f
commit 8da616491d
158 changed files with 891 additions and 891 deletions

View File

@ -41,7 +41,7 @@ void _MessageReplyBase::Abort() {
finished_ = true;
success_ = false;
emit Finished();
Q_EMIT Finished();
qLog(Debug) << "Releasing ID" << id() << "(aborted)";
semaphore_.release();

View File

@ -357,7 +357,7 @@ void WorkerPool<HandlerType>::ProcessError(QProcess::ProcessError error) {
// Failed to start errors are bad - it usually means the worker isn't installed.
// Don't restart the process, but tell our owner, who will probably want to do something fatal.
qLog(Error) << "Worker failed to start";
emit WorkerFailedToStart();
Q_EMIT WorkerFailedToStart();
break;
default:

View File

@ -130,7 +130,7 @@ void AnalyzerContainer::ShowPopupMenu() {
}
void AnalyzerContainer::wheelEvent(QWheelEvent *e) {
emit WheelEvent(e->angleDelta().y());
Q_EMIT WheelEvent(e->angleDelta().y());
}
void AnalyzerContainer::SetEngine(SharedPtr<EngineBase> engine) {

View File

@ -151,7 +151,7 @@ void SCollection::ExitReceived() {
QObject::disconnect(obj, nullptr, this, nullptr);
qLog(Debug) << obj << "successfully exited.";
wait_for_exit_.removeAll(obj);
if (wait_for_exit_.isEmpty()) emit ExitFinished();
if (wait_for_exit_.isEmpty()) Q_EMIT ExitFinished();
}

View File

@ -103,7 +103,7 @@ void CollectionBackend::Exit() {
Q_ASSERT(QThread::currentThread() == thread());
moveToThread(original_thread_);
emit ExitFinished();
Q_EMIT ExitFinished();
}
@ -114,8 +114,8 @@ void CollectionBackend::ReportErrors(const CollectionQuery &query) {
qLog(Error) << "Unable to execute collection SQL query:" << sql_error;
qLog(Error) << "Failed SQL query:" << query.lastQuery();
qLog(Error) << "Bound SQL values:" << query.boundValues();
emit Error(tr("Unable to execute collection SQL query: %1").arg(sql_error.text()));
emit Error(tr("Failed SQL query: %1").arg(query.lastQuery()));
Q_EMIT Error(tr("Unable to execute collection SQL query: %1").arg(sql_error.text()));
Q_EMIT Error(tr("Failed SQL query: %1").arg(query.lastQuery()));
}
}
@ -134,7 +134,7 @@ void CollectionBackend::GetAllSongs(const int id) {
q.prepare(QStringLiteral("SELECT %1 FROM %2").arg(Song::kRowIdColumnSpec, songs_table_));
if (!q.exec()) {
db_->ReportErrors(q);
emit GotSongs(SongList(), id);
Q_EMIT GotSongs(SongList(), id);
return;
}
@ -145,7 +145,7 @@ void CollectionBackend::GetAllSongs(const int id) {
songs << song;
}
emit GotSongs(songs, id);
Q_EMIT GotSongs(songs, id);
}
@ -189,7 +189,7 @@ void CollectionBackend::LoadDirectories() {
QSqlDatabase db(db_->Connect());
for (const CollectionDirectory &dir : dirs) {
emit DirectoryAdded(dir, SubdirsInDirectory(dir.id, db));
Q_EMIT DirectoryAdded(dir, SubdirsInDirectory(dir.id, db));
}
}
@ -317,7 +317,7 @@ void CollectionBackend::UpdateTotalSongCount() {
return;
}
emit TotalSongCountUpdated(q.value(0).toInt());
Q_EMIT TotalSongCountUpdated(q.value(0).toInt());
}
@ -337,7 +337,7 @@ void CollectionBackend::UpdateTotalArtistCount() {
return;
}
emit TotalArtistCountUpdated(q.value(0).toInt());
Q_EMIT TotalArtistCountUpdated(q.value(0).toInt());
}
@ -357,7 +357,7 @@ void CollectionBackend::UpdateTotalAlbumCount() {
return;
}
emit TotalAlbumCountUpdated(q.value(0).toInt());
Q_EMIT TotalAlbumCountUpdated(q.value(0).toInt());
}
@ -395,7 +395,7 @@ void CollectionBackend::AddDirectory(const QString &path) {
dir.path = path;
dir.id = q.lastInsertId().toInt();
emit DirectoryAdded(dir, CollectionSubdirectoryList());
Q_EMIT DirectoryAdded(dir, CollectionSubdirectoryList());
}
@ -437,7 +437,7 @@ void CollectionBackend::RemoveDirectory(const CollectionDirectory &dir) {
transaction.Commit();
emit DirectoryDeleted(dir);
Q_EMIT DirectoryDeleted(dir);
}
@ -717,8 +717,8 @@ void CollectionBackend::AddOrUpdateSongs(const SongList &songs) {
transaction.Commit();
if (!added_songs.isEmpty()) emit SongsAdded(added_songs);
if (!changed_songs.isEmpty()) emit SongsChanged(changed_songs);
if (!added_songs.isEmpty()) Q_EMIT SongsAdded(added_songs);
if (!changed_songs.isEmpty()) Q_EMIT SongsChanged(changed_songs);
UpdateTotalSongCountAsync();
UpdateTotalArtistCountAsync();
@ -819,9 +819,9 @@ void CollectionBackend::UpdateSongsBySongID(const SongMap &new_songs) {
transaction.Commit();
if (!deleted_songs.isEmpty()) emit SongsDeleted(deleted_songs);
if (!added_songs.isEmpty()) emit SongsAdded(added_songs);
if (!changed_songs.isEmpty()) emit SongsChanged(changed_songs);
if (!deleted_songs.isEmpty()) Q_EMIT SongsDeleted(deleted_songs);
if (!added_songs.isEmpty()) Q_EMIT SongsAdded(added_songs);
if (!changed_songs.isEmpty()) Q_EMIT SongsChanged(changed_songs);
UpdateTotalSongCountAsync();
UpdateTotalArtistCountAsync();
@ -867,7 +867,7 @@ void CollectionBackend::DeleteSongs(const SongList &songs) {
transaction.Commit();
emit SongsDeleted(songs);
Q_EMIT SongsDeleted(songs);
UpdateTotalSongCountAsync();
UpdateTotalArtistCountAsync();
@ -894,10 +894,10 @@ void CollectionBackend::MarkSongsUnavailable(const SongList &songs, const bool u
transaction.Commit();
if (unavailable) {
emit SongsDeleted(songs);
Q_EMIT SongsDeleted(songs);
}
else {
emit SongsAdded(songs);
Q_EMIT SongsAdded(songs);
}
UpdateTotalSongCountAsync();
@ -1410,7 +1410,7 @@ void CollectionBackend::CompilationsNeedUpdating() {
transaction.Commit();
if (!changed_songs.isEmpty()) {
emit SongsChanged(changed_songs);
Q_EMIT SongsChanged(changed_songs);
}
}
@ -1617,7 +1617,7 @@ void CollectionBackend::UpdateEmbeddedAlbumArt(const QString &effective_albumart
}
if (!songs.isEmpty()) {
emit SongsChanged(songs);
Q_EMIT SongsChanged(songs);
}
}
@ -1663,7 +1663,7 @@ void CollectionBackend::UpdateManualAlbumArt(const QString &effective_albumartis
}
if (!songs.isEmpty()) {
emit SongsChanged(songs);
Q_EMIT SongsChanged(songs);
}
}
@ -1708,7 +1708,7 @@ void CollectionBackend::UnsetAlbumArt(const QString &effective_albumartist, cons
}
if (!songs.isEmpty()) {
emit SongsChanged(songs);
Q_EMIT SongsChanged(songs);
}
}
@ -1754,7 +1754,7 @@ void CollectionBackend::ClearAlbumArt(const QString &effective_albumartist, cons
}
if (!songs.isEmpty()) {
emit SongsChanged(songs);
Q_EMIT SongsChanged(songs);
}
}
@ -1803,7 +1803,7 @@ void CollectionBackend::ForceCompilation(const QString &album, const QStringList
}
if (!songs.isEmpty()) {
emit SongsChanged(songs);
Q_EMIT SongsChanged(songs);
}
}
@ -1825,7 +1825,7 @@ void CollectionBackend::IncrementPlayCount(const int id) {
}
Song new_song = GetSongById(id, db);
emit SongsStatisticsChanged(SongList() << new_song);
Q_EMIT SongsStatisticsChanged(SongList() << new_song);
}
@ -1847,7 +1847,7 @@ void CollectionBackend::IncrementSkipCount(const int id, const float progress) {
}
Song new_song = GetSongById(id, db);
emit SongsStatisticsChanged(SongList() << new_song);
Q_EMIT SongsStatisticsChanged(SongList() << new_song);
}
@ -1872,7 +1872,7 @@ void CollectionBackend::ResetPlayStatistics(const QList<int> &id_list, const boo
const bool success = ResetPlayStatistics(id_str_list);
if (success) {
const SongList songs = GetSongsById(id_list);
emit SongsStatisticsChanged(songs, save_tags);
Q_EMIT SongsStatisticsChanged(songs, save_tags);
}
}
@ -1921,7 +1921,7 @@ void CollectionBackend::DeleteAll() {
t.Commit();
}
emit DatabaseReset();
Q_EMIT DatabaseReset();
}
@ -2014,7 +2014,7 @@ void CollectionBackend::UpdateLastPlayed(const QString &artist, const QString &a
}
}
emit SongsStatisticsChanged(SongList() << songs);
Q_EMIT SongsStatisticsChanged(SongList() << songs);
}
@ -2040,7 +2040,7 @@ void CollectionBackend::UpdatePlayCount(const QString &artist, const QString &ti
}
}
emit SongsStatisticsChanged(SongList() << songs, save_tags);
Q_EMIT SongsStatisticsChanged(SongList() << songs, save_tags);
}
@ -2075,7 +2075,7 @@ void CollectionBackend::UpdateSongsRating(const QList<int> &id_list, const float
SongList new_song_list = GetSongsById(id_str_list, db);
emit SongsRatingChanged(new_song_list, save_tags);
Q_EMIT SongsRatingChanged(new_song_list, save_tags);
}

View File

@ -479,12 +479,12 @@ void CollectionFilterWidget::keyReleaseEvent(QKeyEvent *e) {
switch (e->key()) {
case Qt::Key_Up:
emit UpPressed();
Q_EMIT UpPressed();
e->accept();
break;
case Qt::Key_Down:
emit DownPressed();
Q_EMIT DownPressed();
e->accept();
break;

View File

@ -266,7 +266,7 @@ void CollectionModel::SetGroupBy(const Grouping g, const std::optional<bool> sep
ScheduleReset();
emit GroupingChanged(g, options_current_.separate_albums_by_grouping);
Q_EMIT GroupingChanged(g, options_current_.separate_albums_by_grouping);
}
@ -622,7 +622,7 @@ void CollectionModel::UpdateSongsInternal(const SongList &songs) {
qLog(Debug) << "Song metadata and title for" << new_song.id() << new_song.PrettyTitleWithArtist() << "changed, informing model";
const QModelIndex idx = ItemToIndex(item);
if (!idx.isValid()) continue;
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}
else {
qLog(Debug) << "Song metadata for" << new_song.id() << new_song.PrettyTitleWithArtist() << "changed";
@ -633,7 +633,7 @@ void CollectionModel::UpdateSongsInternal(const SongList &songs) {
ClearItemPixmapCache(item);
const QModelIndex idx = ItemToIndex(item);
if (idx.isValid()) {
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}
}
@ -989,7 +989,7 @@ void CollectionModel::AlbumCoverLoaded(const quint64 id, const AlbumCoverLoaderR
const QModelIndex idx = ItemToIndex(item);
if (!idx.isValid()) return;
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}
@ -1532,21 +1532,21 @@ CollectionModel::GroupBy &CollectionModel::Grouping::operator[](const int i) {
void CollectionModel::TotalSongCountUpdatedSlot(const int count) {
total_song_count_ = count;
emit TotalSongCountUpdated(count);
Q_EMIT TotalSongCountUpdated(count);
}
void CollectionModel::TotalArtistCountUpdatedSlot(const int count) {
total_artist_count_ = count;
emit TotalArtistCountUpdated(count);
Q_EMIT TotalArtistCountUpdated(count);
}
void CollectionModel::TotalAlbumCountUpdatedSlot(const int count) {
total_album_count_ = count;
emit TotalAlbumCountUpdated(count);
Q_EMIT TotalAlbumCountUpdated(count);
}
@ -1566,7 +1566,7 @@ void CollectionModel::RowsInserted(const QModelIndex &parent, const int first, c
}
if (!songs.isEmpty()) {
emit SongsAdded(songs);
Q_EMIT SongsAdded(songs);
}
}
@ -1582,7 +1582,7 @@ void CollectionModel::RowsRemoved(const QModelIndex &parent, const int first, co
songs << item->metadata;
}
emit SongsRemoved(songs);
Q_EMIT SongsRemoved(songs);
}

View File

@ -273,7 +273,7 @@ void CollectionView::TotalSongCountUpdated(const int count) {
unsetCursor();
}
emit TotalSongCountUpdated_();
Q_EMIT TotalSongCountUpdated_();
}
@ -290,7 +290,7 @@ void CollectionView::TotalArtistCountUpdated(const int count) {
unsetCursor();
}
emit TotalArtistCountUpdated_();
Q_EMIT TotalArtistCountUpdated_();
}
@ -307,7 +307,7 @@ void CollectionView::TotalAlbumCountUpdated(const int count) {
unsetCursor();
}
emit TotalAlbumCountUpdated_();
Q_EMIT TotalAlbumCountUpdated_();
}
@ -348,7 +348,7 @@ void CollectionView::mouseReleaseEvent(QMouseEvent *e) {
QTreeView::mouseReleaseEvent(e);
if (total_song_count_ == 0) {
emit ShowConfigDialog();
Q_EMIT ShowConfigDialog();
}
}
@ -538,13 +538,13 @@ void CollectionView::Load() {
if (MimeData *mimedata = qobject_cast<MimeData*>(q_mimedata)) {
mimedata->clear_first_ = true;
}
emit AddToPlaylistSignal(q_mimedata);
Q_EMIT AddToPlaylistSignal(q_mimedata);
}
void CollectionView::AddToPlaylist() {
emit AddToPlaylistSignal(model()->mimeData(selectedIndexes()));
Q_EMIT AddToPlaylistSignal(model()->mimeData(selectedIndexes()));
}
@ -554,7 +554,7 @@ void CollectionView::AddToPlaylistEnqueue() {
if (MimeData *mimedata = qobject_cast<MimeData*>(q_mimedata)) {
mimedata->enqueue_now_ = true;
}
emit AddToPlaylistSignal(q_mimedata);
Q_EMIT AddToPlaylistSignal(q_mimedata);
}
@ -564,7 +564,7 @@ void CollectionView::AddToPlaylistEnqueueNext() {
if (MimeData *mimedata = qobject_cast<MimeData*>(q_mimedata)) {
mimedata->enqueue_next_now_ = true;
}
emit AddToPlaylistSignal(q_mimedata);
Q_EMIT AddToPlaylistSignal(q_mimedata);
}
@ -574,7 +574,7 @@ void CollectionView::OpenInNewPlaylist() {
if (MimeData *mimedata = qobject_cast<MimeData*>(q_mimedata)) {
mimedata->open_in_new_playlist_ = true;
}
emit AddToPlaylistSignal(q_mimedata);
Q_EMIT AddToPlaylistSignal(q_mimedata);
}
@ -731,7 +731,7 @@ void CollectionView::EditTracks() {
}
void CollectionView::EditTagError(const QString &message) {
emit Error(message);
Q_EMIT Error(message);
}
void CollectionView::RescanSongs() {
@ -773,7 +773,7 @@ void CollectionView::FilterReturnPressed() {
if (!currentIndex().isValid()) return;
emit doubleClicked(currentIndex());
Q_EMIT doubleClicked(currentIndex());
}
void CollectionView::ShowInBrowser() const {

View File

@ -138,7 +138,7 @@ void CollectionWatcher::Exit() {
Abort();
if (backend_) backend_->Close();
moveToThread(original_thread_);
emit ExitFinished();
Q_EMIT ExitFinished();
}
@ -264,7 +264,7 @@ CollectionWatcher::ScanTransaction::ScanTransaction(CollectionWatcher *watcher,
}
task_id_ = watcher_->task_manager_->StartTask(description);
emit watcher_->ScanStarted(task_id_);
Q_EMIT watcher_->ScanStarted(task_id_);
}
@ -297,35 +297,35 @@ void CollectionWatcher::ScanTransaction::CommitNewOrUpdatedSongs() {
if (!deleted_songs.isEmpty()) {
if (mark_songs_unavailable_ && watcher_->source() == Song::Source::Collection) {
emit watcher_->SongsUnavailable(deleted_songs);
Q_EMIT watcher_->SongsUnavailable(deleted_songs);
}
else {
emit watcher_->SongsDeleted(deleted_songs);
Q_EMIT watcher_->SongsDeleted(deleted_songs);
}
deleted_songs.clear();
}
if (!new_songs.isEmpty()) {
emit watcher_->NewOrUpdatedSongs(new_songs);
Q_EMIT watcher_->NewOrUpdatedSongs(new_songs);
new_songs.clear();
}
if (!touched_songs.isEmpty()) {
emit watcher_->SongsMTimeUpdated(touched_songs);
Q_EMIT watcher_->SongsMTimeUpdated(touched_songs);
touched_songs.clear();
}
if (!readded_songs.isEmpty()) {
emit watcher_->SongsReadded(readded_songs);
Q_EMIT watcher_->SongsReadded(readded_songs);
readded_songs.clear();
}
if (!new_subdirs.isEmpty()) {
emit watcher_->SubdirsDiscovered(new_subdirs);
Q_EMIT watcher_->SubdirsDiscovered(new_subdirs);
}
if (!touched_subdirs.isEmpty()) {
emit watcher_->SubdirsMTimeUpdated(touched_subdirs);
Q_EMIT watcher_->SubdirsMTimeUpdated(touched_subdirs);
touched_subdirs.clear();
}
@ -347,7 +347,7 @@ void CollectionWatcher::ScanTransaction::CommitNewOrUpdatedSongs() {
new_subdirs.clear();
if (incremental_ || ignores_mtime_) {
emit watcher_->UpdateLastSeen(dir_, expire_unavailable_songs_days_);
Q_EMIT watcher_->UpdateLastSeen(dir_, expire_unavailable_songs_days_);
}
}
@ -484,7 +484,7 @@ void CollectionWatcher::AddDirectory(const CollectionDirectory &dir, const Colle
}
}
emit CompilationsNeedUpdating();
Q_EMIT CompilationsNeedUpdating();
}
@ -1151,7 +1151,7 @@ void CollectionWatcher::RescanPathsNow() {
rescan_queue_.clear();
emit CompilationsNeedUpdating();
Q_EMIT CompilationsNeedUpdating();
}
@ -1291,7 +1291,7 @@ void CollectionWatcher::PerformScan(const bool incremental, const bool ignore_mt
last_scan_time_ = QDateTime::currentSecsSinceEpoch();
emit CompilationsNeedUpdating();
Q_EMIT CompilationsNeedUpdating();
}
@ -1372,6 +1372,6 @@ void CollectionWatcher::RescanSongs(const SongList &songs) {
}
}
emit CompilationsNeedUpdating();
Q_EMIT CompilationsNeedUpdating();
}

View File

@ -116,7 +116,7 @@ void GroupByDialog::Reset() {
void GroupByDialog::accept() {
emit Accepted(CollectionModel::Grouping(
Q_EMIT Accepted(CollectionModel::Grouping(
p_->mapping_.get<tag_index>().find(ui_->combobox_first->currentIndex())->group_by,
p_->mapping_.get<tag_index>().find(ui_->combobox_second->currentIndex())->group_by,
p_->mapping_.get<tag_index>().find(ui_->combobox_third->currentIndex())->group_by),

View File

@ -207,7 +207,7 @@ void SavedGroupingManager::Remove() {
}
UpdateModel();
emit UpdateGroupByActions();
Q_EMIT UpdateGroupByActions();
}

View File

@ -221,7 +221,7 @@ void ContextAlbum::FadeCurrentCover(const qreal value) {
void ContextAlbum::FadeCurrentCoverFinished() {
if (image_original_ == image_strawberry_) {
emit FadeStopFinished();
Q_EMIT FadeStopFinished();
}
}

View File

@ -456,7 +456,7 @@ void ContextView::SetSong() {
widget_album_->hide();
widget_album_changed = true;
}
if (widget_album_changed) emit AlbumEnabledChanged();
if (widget_album_changed) Q_EMIT AlbumEnabledChanged();
if (action_show_data_->isChecked()) {
widget_play_data_->show();

View File

@ -343,9 +343,9 @@ void Application::ExitReceived() {
}
void Application::AddError(const QString &message) { emit ErrorAdded(message); }
void Application::ReloadSettings() { emit SettingsChanged(); }
void Application::OpenSettingsDialogAtPage(SettingsDialog::Page page) { emit SettingsDialogRequested(page); }
void Application::AddError(const QString &message) { Q_EMIT ErrorAdded(message); }
void Application::ReloadSettings() { Q_EMIT SettingsChanged(); }
void Application::OpenSettingsDialogAtPage(SettingsDialog::Page page) { Q_EMIT SettingsDialogRequested(page); }
SharedPtr<TagReaderClient> Application::tag_reader_client() const { return p_->tag_reader_client_.ptr(); }
SharedPtr<Database> Application::database() const { return p_->database_.ptr(); }

View File

@ -105,7 +105,7 @@ void Database::Exit() {
Q_ASSERT(QThread::currentThread() == thread());
Close();
moveToThread(original_thread_);
emit ExitFinished();
Q_EMIT ExitFinished();
}
@ -482,8 +482,8 @@ void Database::ReportErrors(const SqlQuery &query) {
if (sql_error.isValid()) {
qLog(Error) << "Unable to execute SQL query:" << sql_error;
qLog(Error) << "Failed SQL query:" << query.LastQuery();
emit Error(tr("Unable to execute SQL query: %1").arg(sql_error.text()));
emit Error(tr("Failed SQL query: %1").arg(query.LastQuery()));
Q_EMIT Error(tr("Unable to execute SQL query: %1").arg(sql_error.text()));
Q_EMIT Error(tr("Failed SQL query: %1").arg(query.LastQuery()));
}
}

View File

@ -99,7 +99,7 @@ void DeleteFiles::ProcessSomeFiles() {
task_manager_->SetTaskFinished(task_id_);
emit Finished(songs_with_errors_);
Q_EMIT Finished(songs_with_errors_);
// Move back to the original thread so deleteLater() can get called in the main thread's event loop
moveToThread(original_thread_);

View File

@ -87,7 +87,7 @@ void LocalRedirectServer::incomingConnection(qintptr socket_descriptor) {
delete tcp_socket;
close();
error_ = QLatin1String("Unable to set socket descriptor");
emit Finished();
Q_EMIT Finished();
return;
}
socket_ = tcp_socket;
@ -114,7 +114,7 @@ void LocalRedirectServer::ReadyRead() {
socket_ = nullptr;
request_url_ = ParseUrlFromRequest(buffer_);
close();
emit Finished();
Q_EMIT Finished();
}
else {
QObject::connect(socket_, &QAbstractSocket::readyRead, this, &LocalRedirectServer::ReadyRead);

View File

@ -1624,7 +1624,7 @@ void MainWindow::ToggleHide() {
void MainWindow::StopAfterCurrent() {
app_->playlist_manager()->current()->StopAfter(app_->playlist_manager()->current()->current_row());
emit StopAfterToggled(app_->playlist_manager()->active()->stop_after_current());
Q_EMIT StopAfterToggled(app_->playlist_manager()->active()->stop_after_current());
}
void MainWindow::showEvent(QShowEvent *e) {
@ -2486,7 +2486,7 @@ void MainWindow::CommandlineOptionsReceived(const CommandlineOptions &options) {
const QList<QUrl> urls = options.urls();
for (const QUrl &url : urls) {
if (url.scheme() == QLatin1String("tidal") && url.host() == QLatin1String("login")) {
emit AuthorizationUrlReceived(url);
Q_EMIT AuthorizationUrlReceived(url);
return;
}
}
@ -2564,7 +2564,7 @@ bool MainWindow::LoadUrl(const QString &url) {
}
#ifdef HAVE_TIDAL
if (url.startsWith(QLatin1String("tidal://login"))) {
emit AuthorizationUrlReceived(QUrl(url));
Q_EMIT AuthorizationUrlReceived(QUrl(url));
return true;
}
#endif
@ -3132,7 +3132,7 @@ void MainWindow::AlbumCoverLoaded(const Song &song, const AlbumCoverLoaderResult
song_ = song;
album_cover_ = result.album_cover;
emit AlbumCoverReady(song, result.album_cover.image);
Q_EMIT AlbumCoverReady(song, result.album_cover.image);
const bool enable_change_art = song.is_collection_song() && !song.effective_albumartist().isEmpty() && !song.album().isEmpty();
album_cover_choice_controller_->show_cover_action()->setEnabled(result.success && result.type != AlbumCoverLoaderResult::Type::Unset);
@ -3160,7 +3160,7 @@ void MainWindow::GetCoverAutomatically() {
!song_.effective_album().isEmpty();
if (search) {
emit SearchCoverInProgress();
Q_EMIT SearchCoverInProgress();
album_cover_choice_controller_->SearchCoverAutomatically(song_);
}

View File

@ -232,7 +232,7 @@ void MergedProxyModel::SubModelResetSlot() {
endInsertRows();
}
emit SubModelReset(proxy_parent, submodel);
Q_EMIT SubModelReset(proxy_parent, submodel);
}
@ -516,7 +516,7 @@ QAbstractItemModel *MergedProxyModel::GetModel(const QModelIndex &source_index)
}
void MergedProxyModel::DataChanged(const QModelIndex &top_left, const QModelIndex &bottom_right) {
emit dataChanged(mapFromSource(top_left), mapFromSource(bottom_right));
Q_EMIT dataChanged(mapFromSource(top_left), mapFromSource(bottom_right));
}
void MergedProxyModel::LayoutAboutToBeChanged() {

View File

@ -289,7 +289,7 @@ QStringList Mpris2::SupportedMimeTypes() const {
}
void Mpris2::Raise() { emit RaiseMainWindow(); }
void Mpris2::Raise() { Q_EMIT RaiseMainWindow(); }
void Mpris2::Quit() { QCoreApplication::quit(); }
@ -643,7 +643,7 @@ void Mpris2::PlaylistChangedSlot(Playlist *playlist) {
mpris_playlist.id = MakePlaylistPath(playlist->id());
mpris_playlist.name = app_->playlist_manager()->GetPlaylistName(playlist->id());
emit PlaylistChanged(mpris_playlist);
Q_EMIT PlaylistChanged(mpris_playlist);
}

View File

@ -158,7 +158,7 @@ EngineBase::Type Player::CreateEngine(EngineBase::Type enginetype) {
qFatal("Failed to create engine!");
}
emit EngineChanged(use_enginetype);
Q_EMIT EngineChanged(use_enginetype);
return use_enginetype;
@ -361,7 +361,7 @@ void Player::HandleLoadResult(const UrlHandler::LoadResult &result) {
if (is_current) {
InvalidSongRequested(result.media_url_);
}
emit Error(result.error_);
Q_EMIT Error(result.error_);
break;
case UrlHandler::LoadResult::Type::NoMoreTracks:
@ -497,7 +497,7 @@ void Player::NextItem(const EngineBase::TrackChangeFlags change, const Playlist:
if (i == -1) {
app_->playlist_manager()->active()->set_current_row(i);
app_->playlist_manager()->active()->reset_last_played();
emit PlaylistFinished();
Q_EMIT PlaylistFinished();
Stop();
return;
}
@ -577,7 +577,7 @@ void Player::PlayPause(const quint64 offset_nanosec, const Playlist::AutoScroll
switch (engine_->state()) {
case EngineBase::State::Paused:
UnPause();
emit Resumed();
Q_EMIT Resumed();
break;
case EngineBase::State::Playing:{
@ -713,21 +713,21 @@ void Player::EngineStateChanged(const EngineBase::State state) {
case EngineBase::State::Paused:
pause_time_ = QDateTime::currentDateTime();
play_offset_nanosec_ = engine_->position_nanosec();
emit Paused();
Q_EMIT Paused();
break;
case EngineBase::State::Playing:
pause_time_ = QDateTime();
play_offset_nanosec_ = 0;
emit Playing();
Q_EMIT Playing();
break;
case EngineBase::State::Error:
emit Error();
Q_EMIT Error();
[[fallthrough]];
case EngineBase::State::Empty:
case EngineBase::State::Idle:
pause_time_ = QDateTime();
play_offset_nanosec_ = 0;
emit Stopped();
Q_EMIT Stopped();
break;
}
@ -747,7 +747,7 @@ void Player::SetVolumeFromSlider(const int value) {
if (volume != volume_) {
volume_ = volume;
engine_->SetVolume(volume);
emit VolumeChanged(volume);
Q_EMIT VolumeChanged(volume);
timer_save_volume_->start();
}
@ -758,7 +758,7 @@ void Player::SetVolumeFromEngine(const uint volume) {
const uint new_volume = qBound(0U, volume, 100U);
if (new_volume != volume_) {
volume_ = new_volume;
emit VolumeChanged(new_volume);
Q_EMIT VolumeChanged(new_volume);
timer_save_volume_->start();
}
@ -770,7 +770,7 @@ void Player::SetVolume(const uint volume) {
if (new_volume != volume_) {
volume_ = new_volume;
engine_->SetVolume(new_volume);
emit VolumeChanged(new_volume);
Q_EMIT VolumeChanged(new_volume);
timer_save_volume_->start();
}
@ -800,7 +800,7 @@ void Player::PlayAt(const int index, const bool pause, const quint64 offset_nano
play_offset_nanosec_ = offset_nanosec;
if (current_item_ && change & EngineBase::TrackChangeType::Manual && engine_->position_nanosec() != engine_->length_nanosec()) {
emit TrackSkipped(current_item_);
Q_EMIT TrackSkipped(current_item_);
}
if (current_item_ && app_->playlist_manager()->active()->has_item_at(index) && current_item_->Metadata().IsOnSameAlbum(app_->playlist_manager()->active()->item_at(index)->Metadata())) {
@ -859,7 +859,7 @@ void Player::SeekTo(const quint64 seconds) {
qLog(Debug) << "Track seeked to" << nanosec << "ns - updating scrobble point";
app_->playlist_manager()->active()->UpdateScrobblePoint(nanosec);
emit Seeked(nanosec / 1000);
Q_EMIT Seeked(nanosec / 1000);
if (seconds == 0) {
app_->playlist_manager()->active()->InformOfCurrentSongChange(false);
@ -963,11 +963,11 @@ void Player::PlayWithPause(const quint64 offset_nanosec) {
}
void Player::ShowOSD() {
if (current_item_) emit ForceShowOSD(current_item_->Metadata(), false);
if (current_item_) Q_EMIT ForceShowOSD(current_item_->Metadata(), false);
}
void Player::TogglePrettyOSD() {
if (current_item_) emit ForceShowOSD(current_item_->Metadata(), true);
if (current_item_) Q_EMIT ForceShowOSD(current_item_->Metadata(), true);
}
void Player::TrackAboutToEnd() {
@ -1009,7 +1009,7 @@ void Player::TrackAboutToEnd() {
const UrlHandler::LoadResult result = url_handler->StartLoading(url);
switch (result.type_) {
case UrlHandler::LoadResult::Type::Error:
emit Error(result.error_);
Q_EMIT Error(result.error_);
return;
case UrlHandler::LoadResult::Type::NoMoreTracks:
return;
@ -1042,12 +1042,12 @@ void Player::FatalError() {
}
void Player::ValidSongRequested(const QUrl &url) {
emit SongChangeRequestProcessed(url, true);
Q_EMIT SongChangeRequestProcessed(url, true);
}
void Player::InvalidSongRequested(const QUrl &url) {
if (greyout_) emit SongChangeRequestProcessed(url, false);
if (greyout_) Q_EMIT SongChangeRequestProcessed(url, false);
if (!continue_on_error_) {
FatalError();
@ -1110,5 +1110,5 @@ void Player::UrlHandlerDestroyed(QObject *object) {
}
void Player::HandleAuthentication() {
emit Authenticated();
Q_EMIT Authenticated();
}

View File

@ -113,11 +113,11 @@ void SystemTrayIcon::Clicked(const QSystemTrayIcon::ActivationReason reason) {
switch (reason) {
case QSystemTrayIcon::DoubleClick:
case QSystemTrayIcon::Trigger:
emit ShowHide();
Q_EMIT ShowHide();
break;
case QSystemTrayIcon::MiddleClick:
emit PlayPause();
Q_EMIT PlayPause();
break;
default:

View File

@ -132,7 +132,7 @@ void SimpleTreeModel<T>::EndDelete() {
template<typename T>
void SimpleTreeModel<T>::EmitDataChanged(T *item) {
QModelIndex index(ItemToIndex(item));
emit dataChanged(index, index);
Q_EMIT dataChanged(index, index);
}
#endif // SIMPLETREEMODEL_H

View File

@ -217,7 +217,7 @@ void SongLoader::AudioCDTracksLoadFinishedSlot(const SongList &songs, const QStr
songs_ = songs;
errors_ << error;
emit AudioCDTracksLoadFinished();
Q_EMIT AudioCDTracksLoadFinished();
}
@ -226,7 +226,7 @@ void SongLoader::AudioCDTracksTagsLoaded(const SongList &songs) {
CddaSongLoader *cdda_song_loader = qobject_cast<CddaSongLoader*>(sender());
cdda_song_loader->deleteLater();
songs_ = songs;
emit LoadAudioCDFinished(true);
Q_EMIT LoadAudioCDFinished(true);
}
#endif
@ -463,7 +463,7 @@ void SongLoader::StopTypefind() {
AddAsRawStream();
}
emit LoadRemoteFinished();
Q_EMIT LoadRemoteFinished();
}

View File

@ -62,7 +62,7 @@ void TagReaderClient::Exit() {
Q_ASSERT(QThread::currentThread() == thread());
moveToThread(original_thread_);
emit ExitFinished();
Q_EMIT ExitFinished();
}

View File

@ -46,7 +46,7 @@ int TaskManager::StartTask(const QString &name) {
tasks_[t.id] = t;
}
emit TasksChanged();
Q_EMIT TasksChanged();
return t.id;
}
@ -73,8 +73,8 @@ void TaskManager::SetTaskBlocksCollectionScans(const int id) {
tasks_[id].blocks_collection_scans = true;
}
emit TasksChanged();
emit PauseCollectionWatchers();
Q_EMIT TasksChanged();
Q_EMIT PauseCollectionWatchers();
}
@ -90,7 +90,7 @@ void TaskManager::SetTaskProgress(const int id, const quint64 progress, const qu
tasks_[id] = t;
}
emit TasksChanged();
Q_EMIT TasksChanged();
}
void TaskManager::IncreaseTaskProgress(const int id, const quint64 progress, const quint64 max) {
@ -105,7 +105,7 @@ void TaskManager::IncreaseTaskProgress(const int id, const quint64 progress, con
tasks_[id] = t;
}
emit TasksChanged();
Q_EMIT TasksChanged();
}
@ -130,8 +130,8 @@ void TaskManager::SetTaskFinished(const int id) {
tasks_.remove(id);
}
emit TasksChanged();
if (resume_collection_watchers) emit ResumeCollectionWatchers();
Q_EMIT TasksChanged();
if (resume_collection_watchers) Q_EMIT ResumeCollectionWatchers();
}

View File

@ -184,7 +184,7 @@ AlbumCoverImageResult AlbumCoverChoiceController::LoadImageFromFile(Song *song)
QFile file(cover_file);
if (!file.open(QIODevice::ReadOnly)) {
qLog(Error) << "Failed to open cover file" << cover_file << "for reading:" << file.errorString();
emit Error(tr("Failed to open cover file %1 for reading: %2").arg(cover_file, file.errorString()));
Q_EMIT Error(tr("Failed to open cover file %1 for reading: %2").arg(cover_file, file.errorString()));
return AlbumCoverImageResult();
}
AlbumCoverImageResult result;
@ -192,7 +192,7 @@ AlbumCoverImageResult AlbumCoverChoiceController::LoadImageFromFile(Song *song)
file.close();
if (result.image_data.isEmpty()) {
qLog(Error) << "Cover file" << cover_file << "is empty.";
emit Error(tr("Cover file %1 is empty.").arg(cover_file));
Q_EMIT Error(tr("Cover file %1 is empty.").arg(cover_file));
return AlbumCoverImageResult();
}
@ -264,13 +264,13 @@ void AlbumCoverChoiceController::SaveCoverToFileManual(const Song &song, const A
QFile file(save_filename);
if (!file.open(QIODevice::WriteOnly)) {
qLog(Error) << "Failed to open cover file" << save_filename << "for writing:" << file.errorString();
emit Error(tr("Failed to open cover file %1 for writing: %2").arg(save_filename, file.errorString()));
Q_EMIT Error(tr("Failed to open cover file %1 for writing: %2").arg(save_filename, file.errorString()));
file.close();
return;
}
if (file.write(result.image_data) <= 0) {
qLog(Error) << "Failed writing cover to file" << save_filename << file.errorString();
emit Error(tr("Failed writing cover to file %1: %2").arg(save_filename, file.errorString()));
Q_EMIT Error(tr("Failed writing cover to file %1: %2").arg(save_filename, file.errorString()));
file.close();
return;
}
@ -279,7 +279,7 @@ void AlbumCoverChoiceController::SaveCoverToFileManual(const Song &song, const A
else {
if (!result.image.save(save_filename)) {
qLog(Error) << "Failed writing cover to file" << save_filename;
emit Error(tr("Failed writing cover to file %1.").arg(save_filename));
Q_EMIT Error(tr("Failed writing cover to file %1.").arg(save_filename));
}
}
@ -381,7 +381,7 @@ bool AlbumCoverChoiceController::DeleteCover(Song *song, const bool unset) {
else {
success = false;
qLog(Error) << "Failed to delete cover file" << art_automatic << file.errorString();
emit Error(tr("Failed to delete cover file %1: %2").arg(art_automatic, file.errorString()));
Q_EMIT Error(tr("Failed to delete cover file %1: %2").arg(art_automatic, file.errorString()));
}
}
else song->clear_art_automatic();
@ -398,7 +398,7 @@ bool AlbumCoverChoiceController::DeleteCover(Song *song, const bool unset) {
else {
success = false;
qLog(Error) << "Failed to delete cover file" << art_manual << file.errorString();
emit Error(tr("Failed to delete cover file %1: %2").arg(art_manual, file.errorString()));
Q_EMIT Error(tr("Failed to delete cover file %1: %2").arg(art_manual, file.errorString()));
}
}
else song->clear_art_manual();
@ -539,7 +539,7 @@ void AlbumCoverChoiceController::AlbumCoverFetched(const quint64 id, const Album
SaveCoverAutomatic(&song, result);
}
emit AutomaticCoverSearchDone();
Q_EMIT AutomaticCoverSearchDone();
}
@ -683,13 +683,13 @@ QUrl AlbumCoverChoiceController::SaveCoverToFileAutomatic(const Song::Source sou
}
else {
qLog(Error) << "Failed to write cover to file" << file.fileName() << file.errorString();
emit Error(tr("Failed to write cover to file %1: %2").arg(file.fileName(), file.errorString()));
Q_EMIT Error(tr("Failed to write cover to file %1: %2").arg(file.fileName(), file.errorString()));
}
file.close();
}
else {
qLog(Error) << "Failed to open cover file" << file.fileName() << "for writing:" << file.errorString();
emit Error(tr("Failed to open cover file %1 for writing: %2").arg(file.fileName(), file.errorString()));
Q_EMIT Error(tr("Failed to open cover file %1 for writing: %2").arg(file.fileName(), file.errorString()));
}
}
else {
@ -830,7 +830,7 @@ void AlbumCoverChoiceController::SaveEmbeddedCoverFinished(TagReaderReply *reply
SaveArtEmbeddedToSong(&song, art_embedded);
}
else {
emit Error(tr("Could not save cover to file %1.").arg(song.url().toLocalFile()));
Q_EMIT Error(tr("Could not save cover to file %1.").arg(song.url().toLocalFile()));
}
}

View File

@ -83,7 +83,7 @@ void AlbumCoverExporter::AddJobsToPool() {
void AlbumCoverExporter::CoverExported() {
++exported_;
emit AlbumCoversExportUpdate(exported_, skipped_, all_);
Q_EMIT AlbumCoversExportUpdate(exported_, skipped_, all_);
AddJobsToPool();
}
@ -91,7 +91,7 @@ void AlbumCoverExporter::CoverExported() {
void AlbumCoverExporter::CoverSkipped() {
++skipped_;
emit AlbumCoversExportUpdate(exported_, skipped_, all_);
Q_EMIT AlbumCoversExportUpdate(exported_, skipped_, all_);
AddJobsToPool();
}

View File

@ -145,7 +145,7 @@ void AlbumCoverFetcher::SingleSearchFinished(const quint64 request_id, const Cov
AlbumCoverFetcherSearch *search = active_requests_.take(request_id);
search->deleteLater();
emit SearchFinished(request_id, results, search->statistics());
Q_EMIT SearchFinished(request_id, results, search->statistics());
}
@ -155,6 +155,6 @@ void AlbumCoverFetcher::SingleCoverFetched(const quint64 request_id, const Album
AlbumCoverFetcherSearch *search = active_requests_.take(request_id);
search->deleteLater();
emit AlbumCoverFetched(request_id, result, search->statistics());
Q_EMIT AlbumCoverFetched(request_id, result, search->statistics());
}

View File

@ -253,14 +253,14 @@ void AlbumCoverFetcherSearch::AllProvidersFinished() {
// If we only wanted to do the search then we're done
if (request_.search) {
emit SearchFinished(request_.id, results_);
Q_EMIT SearchFinished(request_.id, results_);
return;
}
// No results?
if (results_.isEmpty()) {
statistics_.missing_images_++;
emit AlbumCoverFetched(request_.id, AlbumCoverImageResult());
Q_EMIT AlbumCoverFetched(request_.id, AlbumCoverImageResult());
return;
}
@ -402,7 +402,7 @@ void AlbumCoverFetcherSearch::SendBestImage() {
statistics_.missing_images_++;
}
emit AlbumCoverFetched(request_.id, result);
Q_EMIT AlbumCoverFetched(request_.id, result);
}

View File

@ -72,7 +72,7 @@ void AlbumCoverLoader::Exit() {
Q_ASSERT(QThread::currentThread() == thread());
moveToThread(original_thread_);
emit ExitFinished();
Q_EMIT ExitFinished();
}
@ -231,7 +231,7 @@ void AlbumCoverLoader::FinishTask(TaskPtr task, const AlbumCoverLoaderResult::Ty
}
}
emit AlbumCoverLoaded(task->id, AlbumCoverLoaderResult(task->success, task->result_type, task->album_cover, image_scaled, task->art_manual_updated, task->art_automatic_updated));
Q_EMIT AlbumCoverLoaded(task->id, AlbumCoverLoaderResult(task->success, task->result_type, task->album_cover, image_scaled, task->art_manual_updated, task->art_automatic_updated));
}

View File

@ -932,7 +932,7 @@ void AlbumCoverManager::AlbumDoubleClicked(const QModelIndex &idx) {
}
void AlbumCoverManager::AddSelectedToPlaylist() {
emit AddToPlaylist(GetMimeDataForAlbums(ui_->albums->selectionModel()->selectedIndexes()));
Q_EMIT AddToPlaylist(GetMimeDataForAlbums(ui_->albums->selectionModel()->selectedIndexes()));
}
void AlbumCoverManager::LoadSelectedToPlaylist() {
@ -940,7 +940,7 @@ void AlbumCoverManager::LoadSelectedToPlaylist() {
SongMimeData *mimedata = GetMimeDataForAlbums(ui_->albums->selectionModel()->selectedIndexes());
if (mimedata) {
mimedata->clear_first_ = true;
emit AddToPlaylist(mimedata);
Q_EMIT AddToPlaylist(mimedata);
}
}
@ -1060,7 +1060,7 @@ void AlbumCoverManager::SaveEmbeddedCoverFinished(TagReaderReply *reply, AlbumIt
}
if (!reply->is_successful()) {
emit Error(tr("Could not save cover to file %1.").arg(url.toLocalFile()));
Q_EMIT Error(tr("Could not save cover to file %1.").arg(url.toLocalFile()));
return;
}

View File

@ -235,6 +235,6 @@ void CoverExportRunnable::ExportCover() {
}
void CoverExportRunnable::EmitCoverExported() { emit CoverExported(); }
void CoverExportRunnable::EmitCoverExported() { Q_EMIT CoverExported(); }
void CoverExportRunnable::EmitCoverSkipped() { emit CoverSkipped(); }
void CoverExportRunnable::EmitCoverSkipped() { Q_EMIT CoverSkipped(); }

View File

@ -126,7 +126,7 @@ void CurrentAlbumCoverLoader::AlbumCoverReady(const quint64 id, AlbumCoverLoader
last_song_.set_art_automatic(result.art_automatic_updated);
}
emit AlbumCoverLoaded(last_song_, result);
emit ThumbnailLoaded(last_song_, thumbnail_url, result.image_scaled);
Q_EMIT AlbumCoverLoaded(last_song_, result);
Q_EMIT ThumbnailLoaded(last_song_, thumbnail_url, result.image_scaled);
}

View File

@ -197,19 +197,19 @@ void DeezerCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id)
QByteArray data = GetReplyData(reply);
if (data.isEmpty()) {
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
QJsonValue value_data = ExtractData(data);
if (!value_data.isArray()) {
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
QJsonArray array_data = value_data.toArray();
if (array_data.isEmpty()) {
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
@ -298,12 +298,12 @@ void DeezerCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id)
}
if (results.isEmpty()) {
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
}
else {
CoverProviderSearchResults cover_results = results.values();
std::stable_sort(cover_results.begin(), cover_results.end(), AlbumCoverFetcherSearch::CoverProviderSearchResultCompareNumber);
emit SearchFinished(id, cover_results);
Q_EMIT SearchFinished(id, cover_results);
}
}

View File

@ -443,7 +443,7 @@ void DiscogsCoverProvider::HandleReleaseReply(QNetworkReply *reply, const int se
search->results.append(result);
}
emit SearchResults(search->id, search->results);
Q_EMIT SearchResults(search->id, search->results);
search->results.clear();
EndSearch(search, release.id);
@ -457,7 +457,7 @@ void DiscogsCoverProvider::EndSearch(SharedPtr<DiscogsCoverSearchContext> search
}
if (search->requests_release_.count() <= 0) {
requests_search_.remove(search->id);
emit SearchFinished(search->id, search->results);
Q_EMIT SearchFinished(search->id, search->results);
}
if (queue_release_requests_.isEmpty() && queue_search_requests_.isEmpty()) {

View File

@ -133,13 +133,13 @@ void LastFmCoverProvider::QueryFinished(QNetworkReply *reply, const int id, cons
QByteArray data = GetReplyData(reply);
if (data.isEmpty()) {
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
QJsonObject json_obj = ExtractJsonObj(data);
if (json_obj.isEmpty()) {
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
@ -151,25 +151,25 @@ void LastFmCoverProvider::QueryFinished(QNetworkReply *reply, const int id, cons
int error = json_obj[QLatin1String("error")].toInt();
QString message = json_obj[QLatin1String("message")].toString();
Error(QStringLiteral("Error: %1: %2").arg(QString::number(error), message));
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
else {
Error(QStringLiteral("Json reply is missing results."), json_obj);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
if (!value_results.isObject()) {
Error(QStringLiteral("Json results is not a object."), value_results);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
QJsonObject obj_results = value_results.toObject();
if (obj_results.isEmpty()) {
Error(QStringLiteral("Json results object is empty."), value_results);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
@ -181,7 +181,7 @@ void LastFmCoverProvider::QueryFinished(QNetworkReply *reply, const int id, cons
}
else {
Error(QStringLiteral("Json results object is missing albummatches."), obj_results);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
}
@ -191,35 +191,35 @@ void LastFmCoverProvider::QueryFinished(QNetworkReply *reply, const int id, cons
}
else {
Error(QStringLiteral("Json results object is missing trackmatches."), obj_results);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
}
if (!value_matches.isObject()) {
Error(QStringLiteral("Json albummatches or trackmatches is not an object."), value_matches);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
QJsonObject obj_matches = value_matches.toObject();
if (obj_matches.isEmpty()) {
Error(QStringLiteral("Json albummatches or trackmatches object is empty."), value_matches);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
QJsonValue value_type;
if (!obj_matches.contains(type)) {
Error(QStringLiteral("Json object is missing %1.").arg(type), obj_matches);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
value_type = obj_matches[type];
if (!value_type.isArray()) {
Error(QStringLiteral("Json album value in albummatches object is not an array."), value_type);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
const QJsonArray array_type = value_type.toArray();
@ -284,7 +284,7 @@ void LastFmCoverProvider::QueryFinished(QNetworkReply *reply, const int id, cons
cover_result.image_size = QSize(300, 300);
results << cover_result;
}
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
}

View File

@ -130,13 +130,13 @@ void MusicbrainzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
QByteArray data = GetReplyData(reply);
if (data.isEmpty()) {
emit SearchFinished(search_id, results);
Q_EMIT SearchFinished(search_id, results);
return;
}
QJsonObject json_obj = ExtractJsonObj(data);
if (json_obj.isEmpty()) {
emit SearchFinished(search_id, results);
Q_EMIT SearchFinished(search_id, results);
return;
}
@ -148,20 +148,20 @@ void MusicbrainzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
else {
Error(QStringLiteral("Json reply is missing releases."), json_obj);
}
emit SearchFinished(search_id, results);
Q_EMIT SearchFinished(search_id, results);
return;
}
QJsonValue value_releases = json_obj[QLatin1String("releases")];
if (!value_releases.isArray()) {
Error(QStringLiteral("Json releases is not an array."), value_releases);
emit SearchFinished(search_id, results);
Q_EMIT SearchFinished(search_id, results);
return;
}
const QJsonArray array_releases = value_releases.toArray();
if (array_releases.isEmpty()) {
emit SearchFinished(search_id, results);
Q_EMIT SearchFinished(search_id, results);
return;
}
@ -222,7 +222,7 @@ void MusicbrainzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
cover_result.image_url = url;
results.append(cover_result);
}
emit SearchFinished(search_id, results);
Q_EMIT SearchFinished(search_id, results);
}

View File

@ -91,26 +91,26 @@ void MusixmatchCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
if (reply->error() != QNetworkReply::NoError) {
Error(QStringLiteral("%1 (%2)").arg(reply->errorString()).arg(reply->error()));
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() != 200) {
Error(QStringLiteral("Received HTTP code %1").arg(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt()));
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
const QByteArray data = reply->readAll();
if (data.isEmpty()) {
Error(QStringLiteral("Empty reply received from server."));
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
const QString content = QString::fromUtf8(data);
const QString data_begin = QLatin1String("<script id=\"__NEXT_DATA__\" type=\"application/json\">");
const QString data_end = QLatin1String("</script>");
if (!content.contains(data_begin) || !content.contains(data_end)) {
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
qint64 begin_idx = content.indexOf(data_begin);
@ -124,13 +124,13 @@ void MusixmatchCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
}
if (content_json.isEmpty()) {
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
static const QRegularExpression regex_html_tag(QStringLiteral("<[^>]*>"));
if (content_json.contains(regex_html_tag)) { // Make sure it's not HTML code.
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
@ -139,60 +139,60 @@ void MusixmatchCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
if (error.error != QJsonParseError::NoError) {
Error(QStringLiteral("Failed to parse json data: %1").arg(error.errorString()));
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
if (json_doc.isEmpty()) {
Error(QStringLiteral("Received empty Json document."), data);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
if (!json_doc.isObject()) {
Error(QStringLiteral("Json document is not an object."), json_doc);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
QJsonObject obj_data = json_doc.object();
if (obj_data.isEmpty()) {
Error(QStringLiteral("Received empty Json object."), json_doc);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
if (!obj_data.contains(QLatin1String("props")) || !obj_data[QLatin1String("props")].isObject()) {
Error(QStringLiteral("Json reply is missing props."), obj_data);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
obj_data = obj_data[QLatin1String("props")].toObject();
if (!obj_data.contains(QLatin1String("pageProps")) || !obj_data[QLatin1String("pageProps")].isObject()) {
Error(QStringLiteral("Json props is missing pageProps."), obj_data);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
obj_data = obj_data[QLatin1String("pageProps")].toObject();
if (!obj_data.contains(QLatin1String("data")) || !obj_data[QLatin1String("data")].isObject()) {
Error(QStringLiteral("Json pageProps is missing data."), obj_data);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
obj_data = obj_data[QLatin1String("data")].toObject();
if (!obj_data.contains(QLatin1String("albumGet")) || !obj_data[QLatin1String("albumGet")].isObject()) {
Error(QStringLiteral("Json data is missing albumGet."), obj_data);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
obj_data = obj_data[QLatin1String("albumGet")].toObject();
if (!obj_data.contains(QLatin1String("data")) || !obj_data[QLatin1String("data")].isObject()) {
Error(QStringLiteral("Json albumGet reply is missing data."), obj_data);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
obj_data = obj_data[QLatin1String("data")].toObject();
@ -206,7 +206,7 @@ void MusixmatchCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
}
if (result.artist.compare(artist, Qt::CaseInsensitive) != 0 && result.album.compare(album, Qt::CaseInsensitive) != 0) {
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
@ -224,7 +224,7 @@ void MusixmatchCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
}
}
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
}

View File

@ -358,20 +358,20 @@ void OpenTidalCoverProvider::HandleSearchReply(QNetworkReply *reply, SearchReque
search_requests_queue_.prepend(search_request);
}
else {
emit SearchFinished(search_request->id, CoverProviderSearchResults());
Q_EMIT SearchFinished(search_request->id, CoverProviderSearchResults());
}
return;
}
if (!json_obj.contains(QLatin1String("albums")) || !json_obj[QLatin1String("albums")].isArray()) {
qLog(Debug) << "OpenTidal: Json object is missing albums.";
emit SearchFinished(search_request->id, CoverProviderSearchResults());
Q_EMIT SearchFinished(search_request->id, CoverProviderSearchResults());
return;
}
const QJsonArray array_albums = json_obj[QLatin1String("albums")].toArray();
if (array_albums.isEmpty()) {
emit SearchFinished(search_request->id, CoverProviderSearchResults());
Q_EMIT SearchFinished(search_request->id, CoverProviderSearchResults());
return;
}
@ -446,7 +446,7 @@ void OpenTidalCoverProvider::HandleSearchReply(QNetworkReply *reply, SearchReque
}
}
emit SearchFinished(search_request->id, results);
Q_EMIT SearchFinished(search_request->id, results);
}
@ -456,7 +456,7 @@ void OpenTidalCoverProvider::FinishAllSearches() {
while (!search_requests_queue_.isEmpty()) {
SearchRequestPtr search_request = search_requests_queue_.dequeue();
emit SearchFinished(search_request->id, CoverProviderSearchResults());
Q_EMIT SearchFinished(search_request->id, CoverProviderSearchResults());
}
}

View File

@ -168,13 +168,13 @@ void QobuzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id) {
QByteArray data = GetReplyData(reply);
if (data.isEmpty()) {
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
QJsonObject json_obj = ExtractJsonObj(data);
if (json_obj.isEmpty()) {
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
@ -187,27 +187,27 @@ void QobuzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id) {
}
else {
Error(QStringLiteral("Json reply is missing albums and tracks object."), json_obj);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
if (!value_type.isObject()) {
Error(QStringLiteral("Json albums or tracks is not a object."), value_type);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
QJsonObject obj_type = value_type.toObject();
if (!obj_type.contains(QLatin1String("items"))) {
Error(QStringLiteral("Json albums or tracks object does not contain items."), obj_type);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
QJsonValue value_items = obj_type[QLatin1String("items")];
if (!value_items.isArray()) {
Error(QStringLiteral("Json albums or track object items is not a array."), value_items);
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
return;
}
const QJsonArray array_items = value_items.toArray();
@ -273,7 +273,7 @@ void QobuzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id) {
results << cover_result;
}
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
}

View File

@ -178,32 +178,32 @@ void SpotifyCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id,
QByteArray data = GetReplyData(reply);
if (data.isEmpty()) {
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
QJsonObject json_obj = ExtractJsonObj(data);
if (json_obj.isEmpty()) {
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
if (!json_obj.contains(extract) || !json_obj[extract].isObject()) {
Error(QStringLiteral("Json object is missing %1 object.").arg(extract), json_obj);
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
json_obj = json_obj[extract].toObject();
if (!json_obj.contains(QLatin1String("items")) || !json_obj[QLatin1String("items")].isArray()) {
Error(QStringLiteral("%1 object is missing items array.").arg(extract), json_obj);
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
const QJsonArray array_items = json_obj[QLatin1String("items")].toArray();
if (array_items.isEmpty()) {
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
@ -252,7 +252,7 @@ void SpotifyCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id,
}
}
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
}

View File

@ -170,30 +170,30 @@ void TidalCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id) {
QByteArray data = GetReplyData(reply);
if (data.isEmpty()) {
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
QJsonObject json_obj = ExtractJsonObj(data);
if (json_obj.isEmpty()) {
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
if (!json_obj.contains(QLatin1String("items"))) {
Error(QStringLiteral("Json object is missing items."), json_obj);
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
QJsonValue value_items = json_obj[QLatin1String("items")];
if (!value_items.isArray()) {
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
const QJsonArray array_items = value_items.toArray();
if (array_items.isEmpty()) {
emit SearchFinished(id, CoverProviderSearchResults());
Q_EMIT SearchFinished(id, CoverProviderSearchResults());
return;
}
@ -261,7 +261,7 @@ void TidalCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id) {
}
}
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
}

View File

@ -65,7 +65,7 @@ void CddaDevice::Refresh() {
void CddaDevice::SongsLoaded(const SongList &songs) {
model_->Reset();
emit SongsDiscovered(songs);
Q_EMIT SongsDiscovered(songs);
song_count_ = songs.size();
}

View File

@ -129,7 +129,7 @@ bool CddaLister::Init() {
#endif
if (!devices_list_.contains(device)) {
devices_list_ << device;
emit DeviceAdded(device);
Q_EMIT DeviceAdded(device);
}
}

View File

@ -143,7 +143,7 @@ void CddaSongLoader::LoadSongs() {
song.set_track(track_number);
songs << song;
}
emit SongsLoaded(songs);
Q_EMIT SongsLoaded(songs);
gst_tag_register_musicbrainz_tags();
@ -189,7 +189,7 @@ void CddaSongLoader::LoadSongs() {
}
gst_message_unref(msg_toc);
}
emit SongsDurationLoaded(songs);
Q_EMIT SongsDurationLoaded(songs);
#ifdef HAVE_MUSICBRAINZ
// Handle TAG message: generate MusicBrainz DiscId
@ -241,7 +241,7 @@ void CddaSongLoader::AudioCDTagsLoaded(const QString &artist, const QString &alb
song.set_url(GetUrlFromTrack(track_number++));
songs << song;
}
emit SongsMetadataLoaded(songs);
Q_EMIT SongsMetadataLoaded(songs);
}
#endif
@ -264,6 +264,6 @@ bool CddaSongLoader::HasChanged() {
void CddaSongLoader::Error(const QString &error) {
qLog(Error) << error;
emit SongsDurationLoaded(SongList(), error);
Q_EMIT SongsDurationLoaded(SongList(), error);
}

View File

@ -104,7 +104,7 @@ void ConnectedDevice::InitBackendDirectory(const QString &mount_point, const boo
}
void ConnectedDevice::ConnectAsync() { emit DeviceConnectFinished(unique_id_, true); }
void ConnectedDevice::ConnectAsync() { Q_EMIT DeviceConnectFinished(unique_id_, true); }
void ConnectedDevice::Close() {
@ -115,7 +115,7 @@ void ConnectedDevice::Close() {
void ConnectedDevice::BackendCloseFinished() {
emit DeviceCloseFinished(unique_id_);
Q_EMIT DeviceCloseFinished(unique_id_);
}
@ -167,5 +167,5 @@ Song::FileType ConnectedDevice::GetTranscodeFormat() const {
void ConnectedDevice::BackendTotalSongCountUpdated(int count) {
song_count_ = count;
emit SongCountUpdated(count);
Q_EMIT SongCountUpdated(count);
}

View File

@ -71,7 +71,7 @@ void DeviceDatabaseBackend::Exit() {
Q_ASSERT(QThread::currentThread() == thread());
Close();
moveToThread(original_thread_);
emit ExitFinished();
Q_EMIT ExitFinished();
}

View File

@ -83,7 +83,7 @@ void DeviceLister::UnmountDeviceAsync(const QString &id) {
}
void DeviceLister::MountDevice(const QString &id, const int request_id) {
emit DeviceMounted(id, request_id, true);
Q_EMIT DeviceMounted(id, request_id, true);
}
void DeviceLister::ExitAsync() {
@ -96,7 +96,7 @@ void DeviceLister::Exit() {
if (thread_) {
moveToThread(original_thread_);
}
emit ExitFinished();
Q_EMIT ExitFinished();
}

View File

@ -202,7 +202,7 @@ void DeviceManager::BackendClosed() {
QObject::disconnect(obj, nullptr, this, nullptr);
qLog(Debug) << obj << "successfully closed.";
wait_for_exit_.removeAll(obj);
if (wait_for_exit_.isEmpty()) emit ExitFinished();
if (wait_for_exit_.isEmpty()) Q_EMIT ExitFinished();
}
@ -236,7 +236,7 @@ void DeviceManager::LoadAllDevices() {
for (const DeviceDatabaseBackend::Device &device : devices) {
DeviceInfo *info = new DeviceInfo(DeviceInfo::Type::Device, root_);
info->InitFromDb(device);
emit DeviceCreatedFromDB(info);
Q_EMIT DeviceCreatedFromDB(info);
}
// This is done in a concurrent thread so close the unique DB connection.
@ -260,7 +260,7 @@ void DeviceManager::AddDeviceFromDB(DeviceInfo *info) {
existing->icon_name_ = info->icon_name_;
existing->icon_ = info->icon_;
QModelIndex idx = ItemToIndex(existing);
if (idx.isValid()) emit dataChanged(idx, idx);
if (idx.isValid()) Q_EMIT dataChanged(idx, idx);
root_->Delete(info->row);
}
else {
@ -460,7 +460,7 @@ void DeviceManager::PhysicalDeviceAdded(const QString &id) {
}
}
QModelIndex idx = ItemToIndex(info);
if (idx.isValid()) emit dataChanged(idx, idx);
if (idx.isValid()) Q_EMIT dataChanged(idx, idx);
}
else {
// Check if we have another device with the same URL
@ -476,7 +476,7 @@ void DeviceManager::PhysicalDeviceAdded(const QString &id) {
info->LoadIcon(lister->DeviceIcons(id), info->friendly_name_);
}
QModelIndex idx = ItemToIndex(info);
if (idx.isValid()) emit dataChanged(idx, idx);
if (idx.isValid()) Q_EMIT dataChanged(idx, idx);
}
else {
// It's a completely new device
@ -518,9 +518,9 @@ void DeviceManager::PhysicalDeviceRemoved(const QString &id) {
info->device_->Close();
}
if (!info->device_) emit DeviceDisconnected(idx);
if (!info->device_) Q_EMIT DeviceDisconnected(idx);
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}
else {
// If this was the last lister for the device then remove it from the model
@ -661,7 +661,7 @@ SharedPtr<ConnectedDevice> DeviceManager::Connect(DeviceInfo *info) {
QModelIndex idx = ItemToIndex(info);
if (!idx.isValid()) return ret;
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
QObject::connect(&*info->device_, &ConnectedDevice::TaskStarted, this, &DeviceManager::DeviceTaskStarted);
QObject::connect(&*info->device_, &ConnectedDevice::SongCountUpdated, this, &DeviceManager::DeviceSongCountUpdated);
@ -681,7 +681,7 @@ void DeviceManager::DeviceConnectFinished(const QString &id, const bool success)
if (!idx.isValid()) return;
if (success) {
emit DeviceConnected(idx);
Q_EMIT DeviceConnected(idx);
}
else {
info->device_->Close();
@ -699,8 +699,8 @@ void DeviceManager::DeviceCloseFinished(const QString &id) {
QModelIndex idx = ItemToIndex(info);
if (!idx.isValid()) return;
emit DeviceDisconnected(idx);
emit dataChanged(idx, idx);
Q_EMIT DeviceDisconnected(idx);
Q_EMIT dataChanged(idx, idx);
if (info->unmount_ && info->BestBackend() && info->BestBackend()->lister_) {
info->BestBackend()->lister_->UnmountDeviceAsync(info->BestBackend()->unique_id_);
@ -799,7 +799,7 @@ void DeviceManager::RemoveFromDB(DeviceInfo *info, const QModelIndex &idx) {
info->friendly_name_ = info->BestBackend()->lister_->MakeFriendlyName(id);
info->LoadIcon(info->BestBackend()->lister_->DeviceIcons(id), info->friendly_name_);
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}
}
@ -816,7 +816,7 @@ void DeviceManager::SetDeviceOptions(const QModelIndex &idx, const QString &frie
info->transcode_mode_ = mode;
info->transcode_format_ = format;
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
if (info->database_id_ != -1) {
backend_->SetDeviceOptions(info->database_id_, friendly_name, icon_name, mode, format);
@ -836,7 +836,7 @@ void DeviceManager::DeviceTaskStarted(const int id) {
if (!index.isValid()) continue;
active_tasks_[id] = index;
info->task_percentage_ = 0;
emit dataChanged(index, index);
Q_EMIT dataChanged(index, index);
return;
}
}
@ -862,7 +862,7 @@ void DeviceManager::TasksChanged() {
info->task_percentage_ = 0;
}
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
finished_tasks.removeAll(idx);
}
@ -875,7 +875,7 @@ void DeviceManager::TasksChanged() {
if (!info) continue;
info->task_percentage_ = -1;
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
active_tasks_.remove(active_tasks_.key(idx));
}
@ -918,7 +918,7 @@ void DeviceManager::DeviceSongCountUpdated(const int count) {
QModelIndex idx = ItemToIndex(info);
if (!idx.isValid()) return;
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}

View File

@ -44,13 +44,13 @@ bool DeviceStateFilterModel::filterAcceptsRow(int row, const QModelIndex&) const
void DeviceStateFilterModel::ProxyRowCountChanged(const QModelIndex&, const int, const int) {
emit IsEmptyChanged(rowCount() == 0);
Q_EMIT IsEmptyChanged(rowCount() == 0);
}
void DeviceStateFilterModel::ProxyReset() {
emit IsEmptyChanged(rowCount() == 0);
Q_EMIT IsEmptyChanged(rowCount() == 0);
}

View File

@ -398,12 +398,12 @@ void DeviceView::Load() {
if (MimeData *mimedata = qobject_cast<MimeData*>(q_mimedata)) {
mimedata->clear_first_ = true;
}
emit AddToPlaylistSignal(q_mimedata);
Q_EMIT AddToPlaylistSignal(q_mimedata);
}
void DeviceView::AddToPlaylist() {
emit AddToPlaylistSignal(model()->mimeData(selectedIndexes()));
Q_EMIT AddToPlaylistSignal(model()->mimeData(selectedIndexes()));
}
void DeviceView::OpenInNewPlaylist() {
@ -412,7 +412,7 @@ void DeviceView::OpenInNewPlaylist() {
if (MimeData *mimedata = qobject_cast<MimeData*>(q_mimedata)) {
mimedata->open_in_new_playlist_ = true;
}
emit AddToPlaylistSignal(q_mimedata);
Q_EMIT AddToPlaylistSignal(q_mimedata);
}

View File

@ -113,7 +113,7 @@ void FilesystemDevice::ExitFinished() {
qLog(Debug) << obj << "successfully exited.";
wait_for_exit_.removeAll(obj);
if (wait_for_exit_.isEmpty()) {
emit DeviceCloseFinished(unique_id());
Q_EMIT DeviceCloseFinished(unique_id());
}
}

View File

@ -314,7 +314,7 @@ void GioLister::VolumeAdded(GVolume *volume) {
devices_[info.unique_id()] = info;
}
emit DeviceAdded(info.unique_id());
Q_EMIT DeviceAdded(info.unique_id());
}
@ -330,7 +330,7 @@ void GioLister::VolumeRemoved(GVolume *volume) {
devices_.remove(id);
}
emit DeviceRemoved(id);
Q_EMIT DeviceRemoved(id);
}
void GioLister::MountAdded(GMount *mount) {
@ -370,7 +370,7 @@ void GioLister::MountAdded(GMount *mount) {
// If the ID has changed (for example, after it's been mounted), we need
// to remove the old device.
devices_.remove(old_id);
emit DeviceRemoved(old_id);
Q_EMIT DeviceRemoved(old_id);
old_id = QString();
}
@ -378,10 +378,10 @@ void GioLister::MountAdded(GMount *mount) {
}
if (old_id.isEmpty()) {
emit DeviceAdded(info.unique_id());
Q_EMIT DeviceAdded(info.unique_id());
}
else {
emit DeviceChanged(old_id);
Q_EMIT DeviceChanged(old_id);
}
}
@ -409,7 +409,7 @@ void GioLister::MountChanged(GMount *mount) {
devices_[id] = new_info;
}
emit DeviceChanged(id);
Q_EMIT DeviceChanged(id);
}
@ -424,7 +424,7 @@ void GioLister::MountRemoved(GMount *mount) {
devices_.remove(id);
}
emit DeviceRemoved(id);
Q_EMIT DeviceRemoved(id);
}
@ -598,7 +598,7 @@ void GioLister::UpdateDeviceFreeSpace(const QString &id) {
g_object_unref(root);
}
emit DeviceChanged(id);
Q_EMIT DeviceChanged(id);
}
@ -613,19 +613,19 @@ void GioLister::MountDevice(const QString &id, const int request_id) {
QMutexLocker l(&mutex_);
if (!devices_.contains(id)) {
emit DeviceMounted(id, request_id, false);
Q_EMIT DeviceMounted(id, request_id, false);
return;
}
const DeviceInfo device_info = devices_.value(id);
if (device_info.mount_ptr) {
// Already mounted
emit DeviceMounted(id, request_id, true);
Q_EMIT DeviceMounted(id, request_id, true);
return;
}
g_volume_mount(device_info.volume_ptr, G_MOUNT_MOUNT_NONE, nullptr, nullptr, VolumeMountFinished, nullptr);
emit DeviceMounted(id, request_id, true);
Q_EMIT DeviceMounted(id, request_id, true);
}

View File

@ -129,7 +129,7 @@ void GPodDevice::LoadFinished(Itdb_iTunesDB *db, const bool success) {
ConnectedDevice::Close();
}
else {
emit DeviceConnectFinished(unique_id_, success);
Q_EMIT DeviceConnectFinished(unique_id_, success);
}
}

View File

@ -52,14 +52,14 @@ GPodLoader::~GPodLoader() = default;
void GPodLoader::LoadDatabase() {
int task_id = task_manager_->StartTask(tr("Loading iPod database"));
emit TaskStarted(task_id);
Q_EMIT TaskStarted(task_id);
Itdb_iTunesDB *db = TryLoad();
moveToThread(original_thread_);
task_manager_->SetTaskFinished(task_id);
emit LoadFinished(db, !abort_);
Q_EMIT LoadFinished(db, !abort_);
}
@ -74,11 +74,11 @@ Itdb_iTunesDB *GPodLoader::TryLoad() {
if (!db) {
if (error) {
qLog(Error) << "loading database failed:" << error->message;
emit Error(QString::fromUtf8(error->message));
Q_EMIT Error(QString::fromUtf8(error->message));
g_error_free(error);
}
else {
emit Error(tr("An error occurred loading the iTunes database"));
Q_EMIT Error(tr("An error occurred loading the iTunes database"));
}
return db;

View File

@ -124,7 +124,7 @@ void MtpDevice::LoadFinished(const bool success, MtpConnection *connection) {
ConnectedDevice::Close();
}
else {
emit DeviceConnectFinished(unique_id_, success);
Q_EMIT DeviceConnectFinished(unique_id_, success);
}
}

View File

@ -53,14 +53,14 @@ bool MtpLoader::Init() { return true; }
void MtpLoader::LoadDatabase() {
int task_id = task_manager_->StartTask(tr("Loading MTP device"));
emit TaskStarted(task_id);
Q_EMIT TaskStarted(task_id);
bool success = TryLoad();
moveToThread(original_thread_);
task_manager_->SetTaskFinished(task_id);
emit LoadFinished(success, connection_.release());
Q_EMIT LoadFinished(success, connection_.release());
}
@ -69,12 +69,12 @@ bool MtpLoader::TryLoad() {
connection_ = make_unique<MtpConnection>(url_);
if (!connection_) {
emit Error(tr("Error connecting MTP device %1").arg(url_.toString()));
Q_EMIT Error(tr("Error connecting MTP device %1").arg(url_.toString()));
return false;
}
if (!connection_->is_valid()) {
emit Error(tr("Error connecting MTP device %1: %2").arg(url_.toString(), connection_->error_text()));
Q_EMIT Error(tr("Error connecting MTP device %1: %2").arg(url_.toString(), connection_->error_text()));
return false;
}

View File

@ -176,7 +176,7 @@ void Udisks2Lister::UnmountDevice(const QString &id) {
}
device_data_.remove(id);
emit DeviceRemoved(id);
Q_EMIT DeviceRemoved(id);
}
}
@ -184,7 +184,7 @@ void Udisks2Lister::UnmountDevice(const QString &id) {
void Udisks2Lister::UpdateDeviceFreeSpace(const QString &id) {
QWriteLocker locker(&device_data_lock_);
device_data_[id].free_space = Utilities::FileSystemFreeSpace(device_data_.value(id).mount_paths.value(0));
emit DeviceChanged(id);
Q_EMIT DeviceChanged(id);
}
bool Udisks2Lister::Init() {
@ -212,7 +212,7 @@ bool Udisks2Lister::Init() {
const QStringList ids = device_data_.keys();
for (const QString &id : ids) {
emit DeviceAdded(id);
Q_EMIT DeviceAdded(id);
}
QObject::connect(&*udisks2_interface_, &OrgFreedesktopDBusObjectManagerInterface::InterfacesAdded, this, &Udisks2Lister::DBusInterfaceAdded);
@ -293,7 +293,7 @@ void Udisks2Lister::RemoveDevice(const QDBusObjectPath &device_path) {
qLog(Debug) << "UDisks2 device removed: " << device_path.path();
device_data_.remove(id);
emit DeviceRemoved(id);
Q_EMIT DeviceRemoved(id);
}
@ -342,7 +342,7 @@ void Udisks2Lister::HandleFinishedMountJob(const PartitionData &partition_data)
QWriteLocker locker(&device_data_lock_);
device_data_[partition_data.unique_id()] = partition_data;
emit DeviceAdded(partition_data.unique_id());
Q_EMIT DeviceAdded(partition_data.unique_id());
}
@ -362,7 +362,7 @@ void Udisks2Lister::HandleFinishedUnmountJob(const PartitionData &partition_data
if (!id.isEmpty()) {
qLog(Debug) << "Partition " << partition_data.dbus_path << " has no more mount points, removing it from device list";
device_data_.remove(id);
emit DeviceRemoved(id);
Q_EMIT DeviceRemoved(id);
}
}

View File

@ -1494,10 +1494,10 @@ void EditTagDialog::SongSaveTagsComplete(TagReaderReply *reply, const QString &f
}
else {
if (error.isEmpty()) {
emit Error(tr("Could not write metadata to %1").arg(filename));
Q_EMIT Error(tr("Could not write metadata to %1").arg(filename));
}
else {
emit Error(tr("Could not write metadata to %1: %2").arg(filename, error));
Q_EMIT Error(tr("Could not write metadata to %1: %2").arg(filename, error));
}
}

View File

@ -309,7 +309,7 @@ void TrackSelectionDialog::accept() {
const Song &new_metadata = tag_data.results_[tag_data.selected_result_];
emit SongChosen(tag_data.original_song_, new_metadata);
Q_EMIT SongChosen(tag_data.original_song_, new_metadata);
}
}

View File

@ -152,7 +152,7 @@ bool EngineBase::Play(const QUrl &media_url, const QUrl &stream_url, const bool
void EngineBase::UpdateVolume(const uint volume) {
volume_ = volume;
emit VolumeChanged(volume);
Q_EMIT VolumeChanged(volume);
}
@ -261,7 +261,7 @@ void EngineBase::EmitAboutToFinish() {
about_to_end_emitted_ = true;
emit TrackAboutToEnd();
Q_EMIT TrackAboutToEnd();
}

View File

@ -322,7 +322,7 @@ void GstEngine::Stop(const bool stop_after) {
BufferingFinished();
emit StateChanged(State::Empty);
Q_EMIT StateChanged(State::Empty);
}
@ -344,7 +344,7 @@ void GstEngine::Pause() {
}
else {
current_pipeline_->SetStateAsync(GST_STATE_PAUSED);
emit StateChanged(State::Paused);
Q_EMIT StateChanged(State::Paused);
StopTimers();
}
}
@ -367,7 +367,7 @@ void GstEngine::Unpause() {
current_pipeline_->SetStateAsync(GST_STATE_PLAYING);
emit StateChanged(State::Playing);
Q_EMIT StateChanged(State::Playing);
StartTimers();
}
@ -598,7 +598,7 @@ void GstEngine::EndOfStreamReached(const int pipeline_id, const bool has_next_tr
BufferingFinished();
}
emit TrackEnded();
Q_EMIT TrackEnded();
}
@ -612,7 +612,7 @@ void GstEngine::HandlePipelineError(const int pipeline_id, const int domain, con
current_pipeline_ = GstEnginePipelinePtr();
BufferingFinished();
emit StateChanged(State::Error);
Q_EMIT StateChanged(State::Error);
if (
(domain == static_cast<int>(GST_RESOURCE_ERROR) && (
@ -622,21 +622,21 @@ void GstEngine::HandlePipelineError(const int pipeline_id, const int domain, con
))
|| (domain == static_cast<int>(GST_STREAM_ERROR))
) {
emit InvalidSongRequested(stream_url_);
Q_EMIT InvalidSongRequested(stream_url_);
}
else {
emit FatalError();
Q_EMIT FatalError();
}
emit Error(message);
emit Error(debugstr);
Q_EMIT Error(message);
Q_EMIT Error(debugstr);
}
void GstEngine::NewMetaData(const int pipeline_id, const EngineMetadata &engine_metadata) {
if (!current_pipeline_|| current_pipeline_->id() != pipeline_id) return;
emit MetaData(engine_metadata);
Q_EMIT MetaData(engine_metadata);
}
@ -667,18 +667,18 @@ void GstEngine::FadeoutFinished(const int pipeline_id) {
fadeout_pipelines_.remove(pipeline_id);
FinishPipeline(pipeline);
emit FadeoutFinishedSignal();
Q_EMIT FadeoutFinishedSignal();
}
void GstEngine::FadeoutPauseFinished() {
fadeout_pause_pipeline_->SetStateAsync(GST_STATE_PAUSED);
emit StateChanged(State::Paused);
Q_EMIT StateChanged(State::Paused);
StopTimers();
has_faded_out_to_pause_ = true;
fadeout_pause_pipeline_ = GstEnginePipelinePtr();
emit FadeoutFinishedSignal();
Q_EMIT FadeoutFinishedSignal();
}
@ -731,10 +731,10 @@ void GstEngine::PlayDone(const GstStateChangeReturn ret, const bool pause, const
StartTimers();
}
emit StateChanged(pause ? State::Paused : State::Playing);
Q_EMIT StateChanged(pause ? State::Paused : State::Playing);
// We've successfully started playing a media stream with this url
emit ValidSongRequested(stream_url_);
Q_EMIT ValidSongRequested(stream_url_);
}
@ -901,9 +901,9 @@ GstEnginePipelinePtr GstEngine::CreatePipeline(const QUrl &media_url, const QUrl
QString error;
if (!ret->InitFromUrl(media_url, stream_url, gst_url, end_nanosec, ebur128_loudness_normalizing_gain_db, error)) {
ret.reset();
emit Error(error);
emit StateChanged(State::Error);
emit FatalError();
Q_EMIT Error(error);
Q_EMIT StateChanged(State::Error);
Q_EMIT FatalError();
}
return ret;
@ -1084,7 +1084,7 @@ void GstEngine::StreamDiscovered(GstDiscoverer*, GstDiscovererInfo *info, GError
qLog(Debug) << "Got stream info for" << discovered_url + ":" << Song::TextForFiletype(engine_metadata.filetype);
emit instance->MetaData(engine_metadata);
Q_EMIT instance->MetaData(engine_metadata);
}
else {

View File

@ -1086,7 +1086,7 @@ void GstEnginePipeline::SourceSetupCallback(GstElement *playbin, GstElement *sou
if (instance->buffering_) {
qLog(Debug) << "Buffering finished";
instance->buffering_ = false;
emit instance->BufferingFinished();
Q_EMIT instance->BufferingFinished();
instance->SetStateAsync(GST_STATE_PLAYING);
}
@ -1106,7 +1106,7 @@ void GstEnginePipeline::NotifyVolumeCallback(GstElement *element, GParamSpec *pa
const uint volume_percent = static_cast<uint>(qBound(0L, lround(instance->volume_internal_ / 0.01), 100L));
if (volume_percent != instance->volume_percent_) {
instance->volume_percent_ = volume_percent;
emit instance->VolumeChanged(volume_percent);
Q_EMIT instance->VolumeChanged(volume_percent);
}
}
@ -1336,11 +1336,11 @@ GstPadProbeReturn GstEnginePipeline::BufferProbeCallback(GstPad *pad, GstPadProb
// GstEngine will try to seek to the start of the new section, but we're already there so ignore it.
instance->ignore_next_seek_ = true;
emit instance->EndOfStreamReached(instance->id(), true);
Q_EMIT instance->EndOfStreamReached(instance->id(), true);
}
else {
// There's no next song
emit instance->EndOfStreamReached(instance->id(), false);
Q_EMIT instance->EndOfStreamReached(instance->id(), false);
}
}
@ -1362,7 +1362,7 @@ void GstEnginePipeline::AboutToFinishCallback(GstPlayBin *playbin, gpointer self
instance->SetNextUrl();
}
emit instance->AboutToFinish();
Q_EMIT instance->AboutToFinish();
}
@ -1374,7 +1374,7 @@ GstBusSyncReply GstEnginePipeline::BusSyncCallback(GstBus *bus, GstMessage *msg,
switch (GST_MESSAGE_TYPE(msg)) {
case GST_MESSAGE_EOS:
emit instance->EndOfStreamReached(instance->id(), false);
Q_EMIT instance->EndOfStreamReached(instance->id(), false);
break;
case GST_MESSAGE_TAG:
@ -1473,7 +1473,7 @@ void GstEnginePipeline::StreamStartMessageReceived() {
next_beginning_offset_nanosec_ = 0;
next_end_offset_nanosec_ = 0;
emit EndOfStreamReached(id(), true);
Q_EMIT EndOfStreamReached(id(), true);
}
}
@ -1549,7 +1549,7 @@ void GstEnginePipeline::ErrorMessageReceived(GstMessage *msg) {
}
#endif
emit Error(id(), static_cast<int>(domain), code, message, debugstr);
Q_EMIT Error(id(), static_cast<int>(domain), code, message, debugstr);
}
@ -1602,7 +1602,7 @@ void GstEnginePipeline::TagMessageReceived(GstMessage *msg) {
gst_tag_list_unref(taglist);
emit MetadataFound(id(), engine_metadata);
Q_EMIT MetadataFound(id(), engine_metadata);
}
@ -1716,7 +1716,7 @@ void GstEnginePipeline::BufferingMessageReceived(GstMessage *msg) {
if (percent < 100 && !buffering_) {
qLog(Debug) << "Buffering started";
buffering_ = true;
emit BufferingStarted();
Q_EMIT BufferingStarted();
if (current_state == GST_STATE_PLAYING) {
SetStateAsync(GST_STATE_PAUSED);
if (pending_state_ == GST_STATE_NULL) {
@ -1727,7 +1727,7 @@ void GstEnginePipeline::BufferingMessageReceived(GstMessage *msg) {
else if (percent == 100 && buffering_) {
qLog(Debug) << "Buffering finished";
buffering_ = false;
emit BufferingFinished();
Q_EMIT BufferingFinished();
if (pending_seek_nanosec_ != -1) {
SeekAsync(pending_seek_nanosec_);
pending_seek_nanosec_ = -1;
@ -1738,7 +1738,7 @@ void GstEnginePipeline::BufferingMessageReceived(GstMessage *msg) {
}
}
else if (buffering_) {
emit BufferingProgress(percent);
Q_EMIT BufferingProgress(percent);
}
}
@ -1800,10 +1800,10 @@ void GstEnginePipeline::SetStateAsyncFinished(const GstState state, const GstSta
case GST_STATE_CHANGE_ASYNC:
case GST_STATE_CHANGE_NO_PREROLL:
qLog(Debug) << "Pipeline" << id_ << "state successfully set to" << GstStateText(state);
emit SetStateFinished(state_change);
Q_EMIT SetStateFinished(state_change);
if (!finished_ && finish_requested_) {
finished_ = true;
emit Finished();
Q_EMIT Finished();
}
break;
case GST_STATE_CHANGE_FAILURE:
@ -2046,7 +2046,7 @@ void GstEnginePipeline::timerEvent(QTimerEvent *e) {
if (e->timerId() == fader_fudge_timer_.timerId()) {
fader_fudge_timer_.stop();
emit FaderFinished(id_);
Q_EMIT FaderFinished(id_);
return;
}

View File

@ -311,30 +311,30 @@ void VLCEngine::StateChangedCallback(const libvlc_event_t *e, void *data) {
const EngineBase::State state = engine->state_;
engine->state_ = EngineBase::State::Empty;
if (state == EngineBase::State::Playing) {
emit engine->StateChanged(engine->state_);
Q_EMIT engine->StateChanged(engine->state_);
}
break;
}
case libvlc_MediaPlayerEncounteredError:
engine->state_ = EngineBase::State::Error;
emit engine->StateChanged(engine->state_);
emit engine->FatalError();
Q_EMIT engine->StateChanged(engine->state_);
Q_EMIT engine->FatalError();
break;
case libvlc_MediaPlayerPlaying:
engine->state_ = EngineBase::State::Playing;
emit engine->StateChanged(engine->state_);
Q_EMIT engine->StateChanged(engine->state_);
break;
case libvlc_MediaPlayerPaused:
engine->state_ = EngineBase::State::Paused;
emit engine->StateChanged(engine->state_);
Q_EMIT engine->StateChanged(engine->state_);
break;
case libvlc_MediaPlayerEndReached:
engine->state_ = EngineBase::State::Idle;
emit engine->TrackEnded();
Q_EMIT engine->TrackEnded();
break;
}

View File

@ -291,24 +291,24 @@ void Equalizer::StereoBalancerEnabledChangedSlot(const bool enabled) {
if (!enabled) {
ui_->stereo_balance_slider->setValue(0);
emit StereoBalanceChanged(stereo_balance());
Q_EMIT StereoBalanceChanged(stereo_balance());
}
ui_->stereo_balance_slider->setEnabled(enabled);
emit StereoBalancerEnabledChanged(enabled);
Q_EMIT StereoBalancerEnabledChanged(enabled);
Save();
}
void Equalizer::StereoBalanceSliderChanged(const int) {
emit StereoBalanceChanged(stereo_balance());
Q_EMIT StereoBalanceChanged(stereo_balance());
Save();
}
void Equalizer::EqualizerEnabledChangedSlot(const bool enabled) {
emit EqualizerEnabledChanged(enabled);
Q_EMIT EqualizerEnabledChanged(enabled);
ui_->slider_container->setEnabled(enabled);
Save();
@ -317,7 +317,7 @@ void Equalizer::EqualizerEnabledChangedSlot(const bool enabled) {
void Equalizer::EqualizerParametersChangedSlot() {
if (loading_) return;
emit EqualizerParametersChanged(preamp_value(), gain_values());
Q_EMIT EqualizerParametersChanged(preamp_value(), gain_values());
}

View File

@ -57,7 +57,7 @@ void EqualizerSlider::OnValueChanged(const int value) {
float gain = (static_cast<int>(value) < 0) ? static_cast<float>(value) * static_cast<float>(0.24) : static_cast<float>(value) * static_cast<float>(0.12);
ui_->gain->setText(tr("%1 dB").arg(gain)); // Gain [dB]
emit ValueChanged(value);
Q_EMIT ValueChanged(value);
}

View File

@ -165,7 +165,7 @@ void GlobalShortcut::activateShortcut(const quint32 native_key, const quint32 na
GlobalShortcut *gshortcut = internal_shortcuts_.value(hash);
if (gshortcut && gshortcut != initialized_) {
emit gshortcut->activated();
Q_EMIT gshortcut->activated();
}
}

View File

@ -82,13 +82,13 @@ void ChartLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id,
if (reply->error() != QNetworkReply::NoError) {
Error(QStringLiteral("%1 (%2)").arg(reply->errorString()).arg(reply->error()));
emit SearchFinished(id);
Q_EMIT SearchFinished(id);
return;
}
if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() != 200) {
Error(QStringLiteral("Received HTTP code %1").arg(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt()));
emit SearchFinished(id);
Q_EMIT SearchFinished(id);
return;
}
@ -134,7 +134,7 @@ void ChartLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id,
qLog(Debug) << "ChartLyrics: Got lyrics for" << request.artist << request.title;
}
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
}

View File

@ -311,8 +311,8 @@ void GeniusLyricsProvider::AccessTokenRequestFinished(QNetworkReply *reply) {
qLog(Debug) << "Genius: Authentication was successful.";
emit AuthenticationComplete(true);
emit AuthenticationSuccess();
Q_EMIT AuthenticationComplete(true);
Q_EMIT AuthenticationSuccess();
}
@ -525,8 +525,8 @@ void GeniusLyricsProvider::AuthError(const QString &error, const QVariant &debug
for (const QString &e : std::as_const(login_errors_)) Error(e);
if (debug.isValid()) qLog(Debug) << debug;
emit AuthenticationFailure(login_errors_);
emit AuthenticationComplete(false, login_errors_);
Q_EMIT AuthenticationFailure(login_errors_);
Q_EMIT AuthenticationComplete(false, login_errors_);
login_errors_.clear();
@ -552,7 +552,7 @@ void GeniusLyricsProvider::EndSearch(GeniusLyricsSearchContextPtr search, const
else {
qLog(Debug) << "GeniusLyrics: Got lyrics for" << search->request.artist << search->request.title;
}
emit SearchFinished(search->id, search->results);
Q_EMIT SearchFinished(search->id, search->results);
}
}

View File

@ -92,34 +92,34 @@ void HtmlLyricsProvider::HandleLyricsReply(QNetworkReply *reply, const int id, c
else {
qLog(Error) << name_ << reply->errorString() << reply->error();
}
emit SearchFinished(id);
Q_EMIT SearchFinished(id);
return;
}
if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() != 200) {
qLog(Error) << name_ << "Received HTTP code" << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
emit SearchFinished(id);
Q_EMIT SearchFinished(id);
return;
}
QByteArray data = reply->readAll();
if (data.isEmpty()) {
qLog(Error) << name_ << "Empty reply received from server.";
emit SearchFinished(id);
Q_EMIT SearchFinished(id);
return;
}
const QString lyrics = ParseLyricsFromHTML(QString::fromUtf8(data), QRegularExpression(start_tag_), QRegularExpression(end_tag_), QRegularExpression(lyrics_start_), multiple_);
if (lyrics.isEmpty() || lyrics.contains(QLatin1String("we do not have the lyrics for"), Qt::CaseInsensitive)) {
qLog(Debug) << name_ << "No lyrics for" << request.artist << request.album << request.title;
emit SearchFinished(id);
Q_EMIT SearchFinished(id);
return;
}
qLog(Debug) << name_ << "Got lyrics for" << request.artist << request.album << request.title;
LyricsSearchResult result(lyrics);
emit SearchFinished(id, LyricsSearchResults() << result);
Q_EMIT SearchFinished(id, LyricsSearchResults() << result);
}

View File

@ -85,7 +85,7 @@ void LoloLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, c
failure_reason = QStringLiteral("%1 (%2)").arg(reply->errorString()).arg(reply->error());
if (reply->error() < 200) {
Error(failure_reason);
emit SearchFinished(id);
Q_EMIT SearchFinished(id);
return;
}
}
@ -140,7 +140,7 @@ void LoloLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, c
qLog(Debug) << "LoloLyrics: Got lyrics for" << request.artist << request.title;
}
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
}

View File

@ -213,6 +213,6 @@ void LyricFindLyricsProvider::EndSearch(const int id, const LyricsSearchRequest
qLog(Debug) << "LyricFind: Got lyrics for" << request.artist << request.title;
}
emit SearchFinished(id, results);
Q_EMIT SearchFinished(id, results);
}

View File

@ -117,7 +117,7 @@ void LyricsFetcher::SingleSearchFinished(const quint64 request_id, const LyricsS
LyricsFetcherSearch *search = active_requests_.take(request_id);
search->deleteLater();
emit SearchFinished(request_id, results);
Q_EMIT SearchFinished(request_id, results);
}
@ -127,6 +127,6 @@ void LyricsFetcher::SingleLyricsFetched(const quint64 request_id, const QString
LyricsFetcherSearch *search = active_requests_.take(request_id);
search->deleteLater();
emit LyricsFetched(request_id, provider, lyrics);
Q_EMIT LyricsFetched(request_id, provider, lyrics);
}

View File

@ -134,13 +134,13 @@ void LyricsFetcherSearch::AllProvidersFinished() {
if (!results_.isEmpty()) {
qLog(Debug) << "Using lyrics from" << results_.last().provider << "for" << request_.artist << request_.title << "with score" << results_.last().score;
emit LyricsFetched(id_, results_.constLast().provider, results_.constLast().lyrics);
Q_EMIT LyricsFetched(id_, results_.constLast().provider, results_.constLast().lyrics);
}
else {
emit LyricsFetched(id_, QString(), QString());
Q_EMIT LyricsFetched(id_, QString(), QString());
}
emit SearchFinished(id_, results_);
Q_EMIT SearchFinished(id_, results_);
}

View File

@ -437,7 +437,7 @@ void MusixmatchLyricsProvider::EndSearch(LyricsSearchContextPtr search, const QU
else {
qLog(Debug) << "MusixmatchLyrics: Got lyrics for" << search->request.artist << search->request.title;
}
emit SearchFinished(search->id, search->results);
Q_EMIT SearchFinished(search->id, search->results);
}
}

View File

@ -76,19 +76,19 @@ void OVHLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, co
QJsonObject json_obj = ExtractJsonObj(reply);
if (json_obj.isEmpty()) {
emit SearchFinished(id);
Q_EMIT SearchFinished(id);
return;
}
if (json_obj.contains(QLatin1String("error"))) {
Error(json_obj[QLatin1String("error")].toString());
qLog(Debug) << "OVHLyrics: No lyrics for" << request.artist << request.title;
emit SearchFinished(id);
Q_EMIT SearchFinished(id);
return;
}
if (!json_obj.contains(QLatin1String("lyrics"))) {
emit SearchFinished(id);
Q_EMIT SearchFinished(id);
return;
}
@ -97,12 +97,12 @@ void OVHLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, co
if (result.lyrics.isEmpty()) {
qLog(Debug) << "OVHLyrics: No lyrics for" << request.artist << request.title;
emit SearchFinished(id);
Q_EMIT SearchFinished(id);
}
else {
result.lyrics = Utilities::DecodeHtmlEntities(result.lyrics);
qLog(Debug) << "OVHLyrics: Got lyrics for" << request.artist << request.title;
emit SearchFinished(id, LyricsSearchResults() << result);
Q_EMIT SearchFinished(id, LyricsSearchResults() << result);
}
}

View File

@ -62,17 +62,17 @@ void MoodbarController::CurrentSongChanged(const Song &song) {
switch (result) {
case MoodbarLoader::Result::CannotLoad:
emit CurrentMoodbarDataChanged(QByteArray());
Q_EMIT CurrentMoodbarDataChanged(QByteArray());
break;
case MoodbarLoader::Result::Loaded:
emit CurrentMoodbarDataChanged(data);
Q_EMIT CurrentMoodbarDataChanged(data);
break;
case MoodbarLoader::Result::WillLoadAsync:
// Emit an empty array for now so the GUI reverts to a normal progress
// bar. Our slot will be called when the data is actually loaded.
emit CurrentMoodbarDataChanged(QByteArray());
Q_EMIT CurrentMoodbarDataChanged(QByteArray());
QObject::connect(pipeline, &MoodbarPipeline::Finished, this, [this, pipeline, song]() { AsyncLoadComplete(pipeline, song.url()); });
break;
@ -82,7 +82,7 @@ void MoodbarController::CurrentSongChanged(const Song &song) {
void MoodbarController::PlaybackStopped() {
if (enabled_) {
emit CurrentMoodbarDataChanged(QByteArray());
Q_EMIT CurrentMoodbarDataChanged(QByteArray());
}
}
@ -104,6 +104,6 @@ void MoodbarController::AsyncLoadComplete(MoodbarPipeline *pipeline, const QUrl
break;
}
emit CurrentMoodbarDataChanged(pipeline->data());
Q_EMIT CurrentMoodbarDataChanged(pipeline->data());
}

View File

@ -100,7 +100,7 @@ void MoodbarPipeline::Start() {
if (!decodebin || !convert_element_ || !spectrum || !fakesink) {
gst_object_unref(GST_OBJECT(pipeline_));
pipeline_ = nullptr;
emit Finished(false);
Q_EMIT Finished(false);
return;
}
@ -109,7 +109,7 @@ void MoodbarPipeline::Start() {
qLog(Error) << "Failed to link elements";
gst_object_unref(GST_OBJECT(pipeline_));
pipeline_ = nullptr;
emit Finished(false);
Q_EMIT Finished(false);
return;
}
@ -222,7 +222,7 @@ void MoodbarPipeline::Stop(const bool success) {
builder_.reset();
}
emit Finished(success);
Q_EMIT Finished(success);
}

View File

@ -137,7 +137,7 @@ void AcoustidClient::RequestFinished(QNetworkReply *reply, const int request_id)
else {
qLog(Error) << QStringLiteral("Acoustid: Received HTTP code %1").arg(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt());
}
emit Finished(request_id, QStringList());
Q_EMIT Finished(request_id, QStringList());
return;
}
@ -145,7 +145,7 @@ void AcoustidClient::RequestFinished(QNetworkReply *reply, const int request_id)
QJsonDocument json_document = QJsonDocument::fromJson(reply->readAll(), &error);
if (error.error != QJsonParseError::NoError) {
emit Finished(request_id, QStringList());
Q_EMIT Finished(request_id, QStringList());
return;
}
@ -153,7 +153,7 @@ void AcoustidClient::RequestFinished(QNetworkReply *reply, const int request_id)
QString status = json_object[QLatin1String("status")].toString();
if (status != QLatin1String("ok")) {
emit Finished(request_id, QStringList(), status);
Q_EMIT Finished(request_id, QStringList(), status);
return;
}
@ -188,6 +188,6 @@ void AcoustidClient::RequestFinished(QNetworkReply *reply, const int request_id)
id_list << is.id_;
}
emit Finished(request_id, id_list);
Q_EMIT Finished(request_id, id_list);
}

View File

@ -234,7 +234,7 @@ void MusicBrainzClient::RequestFinished(QNetworkReply *reply, const int id, cons
for (const PendingResults &result_list : std::as_const(result_list_list)) {
ret << result_list.results_;
}
emit Finished(id, UniqueResults(ret, UniqueResultsSortOption::KeepOriginalOrder), error);
Q_EMIT Finished(id, UniqueResults(ret, UniqueResultsSortOption::KeepOriginalOrder), error);
}
}
@ -252,7 +252,7 @@ void MusicBrainzClient::DiscIdRequestFinished(const QString &discid, QNetworkRep
QString error;
QByteArray data = GetReplyData(reply, error);
if (data.isEmpty()) {
emit DiscIdFinished(artist, album, ret, error);
Q_EMIT DiscIdFinished(artist, album, ret, error);
return;
}
@ -316,7 +316,7 @@ void MusicBrainzClient::DiscIdRequestFinished(const QString &discid, QNetworkRep
}
}
emit DiscIdFinished(artist, album, UniqueResults(ret, UniqueResultsSortOption::SortResults));
Q_EMIT DiscIdFinished(artist, album, UniqueResults(ret, UniqueResultsSortOption::SortResults));
}

View File

@ -67,7 +67,7 @@ void TagFetcher::StartFetch(const SongList &songs) {
if (have_fingerprints) {
for (int i = 0; i < songs_.count(); ++i) {
const Song song = songs_.value(i);
emit Progress(song, tr("Identifying song"));
Q_EMIT Progress(song, tr("Identifying song"));
acoustid_client_->Start(i, song.fingerprint(), static_cast<int>(song.length_nanosec() / kNsecPerMsec));
}
}
@ -77,7 +77,7 @@ void TagFetcher::StartFetch(const SongList &songs) {
QObject::connect(fingerprint_watcher_, &QFutureWatcher<QString>::resultReadyAt, this, &TagFetcher::FingerprintFound);
fingerprint_watcher_->setFuture(future);
for (const Song &song : std::as_const(songs_)) {
emit Progress(song, tr("Fingerprinting song"));
Q_EMIT Progress(song, tr("Fingerprinting song"));
}
}
@ -107,11 +107,11 @@ void TagFetcher::FingerprintFound(const int index) {
const Song song = songs_.value(index);
if (fingerprint.isEmpty()) {
emit ResultAvailable(song, SongList());
Q_EMIT ResultAvailable(song, SongList());
return;
}
emit Progress(song, tr("Identifying song"));
Q_EMIT Progress(song, tr("Identifying song"));
acoustid_client_->Start(index, fingerprint, static_cast<int>(song.length_nanosec() / kNsecPerMsec));
}
@ -125,11 +125,11 @@ void TagFetcher::PuidsFound(const int index, const QStringList &puid_list, const
const Song song = songs_.value(index);
if (puid_list.isEmpty()) {
emit ResultAvailable(song, SongList(), error);
Q_EMIT ResultAvailable(song, SongList(), error);
return;
}
emit Progress(song, tr("Downloading metadata"));
Q_EMIT Progress(song, tr("Downloading metadata"));
musicbrainz_client_->Start(index, puid_list);
}
@ -151,6 +151,6 @@ void TagFetcher::TagsFetched(const int index, const MusicBrainzClient::ResultLis
songs_guessed << song;
}
emit ResultAvailable(original_song, songs_guessed, error);
Q_EMIT ResultAvailable(original_song, songs_guessed, error);
}

View File

@ -155,7 +155,7 @@ void Organize::ProcessSomeFiles() {
task_manager_->SetTaskFinished(task_id_);
emit Finished(files_with_errors_, log_);
Q_EMIT Finished(files_with_errors_, log_);
// Move back to the original thread so deleteLater() can get called in the main thread's event loop
moveToThread(original_thread_);
@ -263,7 +263,7 @@ void Organize::ProcessSomeFiles() {
// Notify other aspects of system that song has been invalidated
QString root = destination_->LocalPath();
QFileInfo new_file = QFileInfo(root + QLatin1Char('/') + task.song_info_.new_filename_);
emit SongPathChanged(song, new_file, destination_->collection_directory_id());
Q_EMIT SongPathChanged(song, new_file, destination_->collection_directory_id());
}
}
else {

View File

@ -538,7 +538,7 @@ void OSDPretty::mouseReleaseEvent(QMouseEvent *) {
popup_screen_ = current_screen();
popup_screen_name_ = current_screen()->name();
popup_pos_ = current_pos();
emit PositionChanged();
Q_EMIT PositionChanged();
}
}

View File

@ -398,7 +398,7 @@ QVariant Playlist::data(const QModelIndex &idx, const int role) const {
#ifdef HAVE_MOODBAR
void Playlist::MoodbarUpdated(const QModelIndex &idx) {
emit dataChanged(idx.sibling(idx.row(), static_cast<int>(Column::Mood)), idx.sibling(idx.row(), static_cast<int>(Column::Mood)));
Q_EMIT dataChanged(idx.sibling(idx.row(), static_cast<int>(Column::Mood)), idx.sibling(idx.row(), static_cast<int>(Column::Mood)));
}
#endif
@ -436,10 +436,10 @@ void Playlist::SongSaveComplete(TagReaderReply *reply, const QPersistentModelInd
}
else {
if (reply->request_message().write_file_response().has_error()) {
emit Error(tr("Could not write metadata to %1: %2").arg(QString::fromStdString(reply->request_message().write_file_request().filename()), QString::fromStdString(reply->request_message().write_file_response().error())));
Q_EMIT Error(tr("Could not write metadata to %1: %2").arg(QString::fromStdString(reply->request_message().write_file_request().filename()), QString::fromStdString(reply->request_message().write_file_response().error())));
}
else {
emit Error(tr("Could not write metadata to %1").arg(QString::fromStdString(reply->request_message().write_file_request().filename())));
Q_EMIT Error(tr("Could not write metadata to %1").arg(QString::fromStdString(reply->request_message().write_file_request().filename())));
}
}
}
@ -473,14 +473,14 @@ void Playlist::ItemReloadComplete(const QPersistentModelIndex &idx, const Song &
ItemChanged(idx.row(), ChangedColumns(old_metadata, item->Metadata()));
if (idx.row() == current_row()) {
if (MinorMetadataChange(old_metadata, item->Metadata())) {
emit CurrentSongMetadataChanged(item->Metadata());
Q_EMIT CurrentSongMetadataChanged(item->Metadata());
}
else {
emit CurrentSongChanged(item->Metadata());
Q_EMIT CurrentSongChanged(item->Metadata());
}
}
if (metadata_edit) {
emit EditingFinished(id_, idx);
Q_EMIT EditingFinished(id_, idx);
}
ScheduleSaveAsync();
}
@ -668,7 +668,7 @@ void Playlist::set_current_row(const int i, const AutoScroll autoscroll, const b
PlaylistItemPtr next_item = item_at(nextrow);
if (next_item) {
next_item->ClearTemporaryMetadata();
emit dataChanged(index(nextrow, 0), index(nextrow, ColumnCount - 1));
Q_EMIT dataChanged(index(nextrow, 0), index(nextrow, ColumnCount - 1));
}
}
@ -685,7 +685,7 @@ void Playlist::set_current_row(const int i, const AutoScroll autoscroll, const b
}
if (old_current_item_index.isValid()) {
emit dataChanged(old_current_item_index, old_current_item_index.sibling(old_current_item_index.row(), ColumnCount - 1));
Q_EMIT dataChanged(old_current_item_index, old_current_item_index.sibling(old_current_item_index.row(), ColumnCount - 1));
}
// Update the virtual index
@ -710,8 +710,8 @@ void Playlist::set_current_row(const int i, const AutoScroll autoscroll, const b
if (current_item_index_.isValid() && !is_stopping) {
InformOfCurrentSongChange(false);
emit dataChanged(index(current_item_index_.row(), 0), index(current_item_index_.row(), ColumnCount - 1));
emit MaybeAutoscroll(autoscroll);
Q_EMIT dataChanged(index(current_item_index_.row(), 0), index(current_item_index_.row(), ColumnCount - 1));
Q_EMIT MaybeAutoscroll(autoscroll);
}
// The structure of a dynamic playlist is as follows:
@ -925,7 +925,7 @@ void Playlist::TurnOnDynamicPlaylist(PlaylistGeneratorPtr gen) {
dynamic_playlist_ = gen;
ShuffleModeChanged(PlaylistSequence::ShuffleMode::Off);
emit DynamicModeChanged(true);
Q_EMIT DynamicModeChanged(true);
ScheduleSave();
@ -937,7 +937,7 @@ void Playlist::MoveItemWithoutUndo(const int source, const int dest) {
void Playlist::MoveItemsWithoutUndo(const QList<int> &source_rows, int pos) {
emit layoutAboutToBeChanged();
Q_EMIT layoutAboutToBeChanged();
PlaylistItemPtrList old_items = items_;
PlaylistItemPtrList moved_items;
@ -999,7 +999,7 @@ void Playlist::MoveItemsWithoutUndo(const QList<int> &source_rows, int pos) {
current_virtual_index_ = -1;
}
emit layoutChanged();
Q_EMIT layoutChanged();
ScheduleSave();
@ -1007,7 +1007,7 @@ void Playlist::MoveItemsWithoutUndo(const QList<int> &source_rows, int pos) {
void Playlist::MoveItemsWithoutUndo(int start, const QList<int> &dest_rows) {
emit layoutAboutToBeChanged();
Q_EMIT layoutAboutToBeChanged();
PlaylistItemPtrList old_items = items_;
PlaylistItemPtrList moved_items;
@ -1072,7 +1072,7 @@ void Playlist::MoveItemsWithoutUndo(int start, const QList<int> &dest_rows) {
current_virtual_index_ = -1;
}
emit layoutChanged();
Q_EMIT layoutChanged();
ScheduleSave();
@ -1097,7 +1097,7 @@ void Playlist::InsertItems(const PlaylistItemPtrList &itemsIn, const int pos, co
undo_stack_->push(new PlaylistUndoCommands::InsertItems(this, items, pos, enqueue, enqueue_next));
}
if (play_now) emit PlayRequested(index(start, 0), AutoScroll::Maybe);
if (play_now) Q_EMIT PlayRequested(index(start, 0), AutoScroll::Maybe);
}
@ -1249,7 +1249,7 @@ void Playlist::UpdateItems(SongList songs) {
}
}
items_[i] = new_item;
emit dataChanged(index(i, 0), index(i, ColumnCount - 1));
Q_EMIT dataChanged(index(i, 0), index(i, ColumnCount - 1));
// Also update undo actions
for (int y = 0; y < undo_stack_->count(); y++) {
QUndoCommand *undo_action = const_cast<QUndoCommand*>(undo_stack_->command(i));
@ -1265,7 +1265,7 @@ void Playlist::UpdateItems(SongList songs) {
}
}
emit PlaylistChanged();
Q_EMIT PlaylistChanged();
ScheduleSave();
@ -1486,7 +1486,7 @@ void Playlist::sort(const int column_number, const Qt::SortOrder order) {
void Playlist::ReOrderWithoutUndo(const PlaylistItemPtrList &new_items) {
emit layoutAboutToBeChanged();
Q_EMIT layoutAboutToBeChanged();
PlaylistItemPtrList old_items = items_;
items_ = new_items;
@ -1518,9 +1518,9 @@ void Playlist::ReOrderWithoutUndo(const PlaylistItemPtrList &new_items) {
current_virtual_index_ = -1;
}
emit layoutChanged();
Q_EMIT layoutChanged();
emit PlaylistChanged();
Q_EMIT PlaylistChanged();
ScheduleSave();
@ -1539,7 +1539,7 @@ void Playlist::SetCurrentIsPaused(const bool paused) {
current_is_paused_ = paused;
if (current_item_index_.isValid()) {
emit dataChanged(index(current_item_index_.row(), 0), index(current_item_index_.row(), ColumnCount - 1));
Q_EMIT dataChanged(index(current_item_index_.row(), 0), index(current_item_index_.row(), ColumnCount - 1));
}
}
@ -1634,7 +1634,7 @@ void Playlist::ItemsLoaded() {
}
}
emit RestoreFinished();
Q_EMIT RestoreFinished();
Settings s;
s.beginGroup(kSettingsGroup);
@ -1650,7 +1650,7 @@ void Playlist::ItemsLoaded() {
#endif
}
emit PlaylistLoaded();
Q_EMIT PlaylistLoaded();
}
@ -1795,10 +1795,10 @@ void Playlist::StopAfter(const int row) {
}
if (old_stop_after.isValid()) {
emit dataChanged(old_stop_after, old_stop_after.sibling(old_stop_after.row(), ColumnCount - 1));
Q_EMIT dataChanged(old_stop_after, old_stop_after.sibling(old_stop_after.row(), ColumnCount - 1));
}
if (stop_after_.isValid()) {
emit dataChanged(stop_after_, stop_after_.sibling(stop_after_.row(), ColumnCount - 1));
Q_EMIT dataChanged(stop_after_, stop_after_.sibling(stop_after_.row(), ColumnCount - 1));
}
}
@ -2101,10 +2101,10 @@ void Playlist::TracksAboutToBeDequeued(const QModelIndex&, const int begin, cons
void Playlist::TracksDequeued() {
for (const QModelIndex &idx : std::as_const(temp_dequeue_change_indexes_)) {
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}
temp_dequeue_change_indexes_.clear();
emit QueueChanged();
Q_EMIT QueueChanged();
}
@ -2112,7 +2112,7 @@ void Playlist::TracksEnqueued(const QModelIndex&, const int begin, const int end
const QModelIndex &b = queue_->mapToSource(queue_->index(begin, static_cast<int>(Column::Title)));
const QModelIndex &e = queue_->mapToSource(queue_->index(end, static_cast<int>(Column::Title)));
emit dataChanged(b, e);
Q_EMIT dataChanged(b, e);
}
@ -2120,7 +2120,7 @@ void Playlist::QueueLayoutChanged() {
for (int i = 0; i < queue_->rowCount(); ++i) {
const QModelIndex &idx = queue_->mapToSource(queue_->index(i, static_cast<int>(Column::Title)));
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}
}
@ -2280,14 +2280,14 @@ void Playlist::ItemChanged(const int row, const Columns columns) {
const QModelIndex idx_column_first = index(row, 0);
const QModelIndex idx_column_last = index(row, ColumnCount - 1);
if (idx_column_first.isValid() && idx_column_last.isValid()) {
emit dataChanged(index(row, 0), index(row, ColumnCount - 1));
Q_EMIT dataChanged(index(row, 0), index(row, ColumnCount - 1));
}
}
else {
for (const Column &column : columns) {
const QModelIndex idx = index(row, static_cast<int>(column));
if (idx.isValid()) {
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}
}
}
@ -2302,10 +2302,10 @@ void Playlist::InformOfCurrentSongChange(const bool minor) {
}
if (minor) {
emit CurrentSongMetadataChanged(metadata);
Q_EMIT CurrentSongMetadataChanged(metadata);
}
else {
emit CurrentSongChanged(metadata);
Q_EMIT CurrentSongChanged(metadata);
}
}
@ -2465,7 +2465,7 @@ void Playlist::SkipTracks(const QModelIndexList &source_indexes) {
for (const QModelIndex &source_index : source_indexes) {
PlaylistItemPtr track_to_skip = item_at(source_index.row());
track_to_skip->SetShouldSkip(!((track_to_skip)->GetShouldSkip()));
emit dataChanged(source_index, source_index);
Q_EMIT dataChanged(source_index, source_index);
}
}
@ -2521,7 +2521,7 @@ void Playlist::TurnOffDynamicPlaylist() {
ShuffleModeChanged(ShuffleMode());
}
emit DynamicModeChanged(false);
Q_EMIT DynamicModeChanged(false);
ScheduleSave();

View File

@ -87,7 +87,7 @@ void PlaylistBackend::Exit() {
Q_ASSERT(QThread::currentThread() == thread());
moveToThread(original_thread_);
emit ExitFinished();
Q_EMIT ExitFinished();
}

View File

@ -204,7 +204,7 @@ void PlaylistContainer::SetViewModel(Playlist *playlist, const int scroll_positi
playlist->IgnoreSorting(false);
QObject::connect(view()->selectionModel(), &QItemSelectionModel::selectionChanged, this, &PlaylistContainer::SelectionChanged);
emit ViewSelectionModelChanged();
Q_EMIT ViewSelectionModelChanged();
// Update filter
ui_->search_field->setText(playlist->filter()->filter_string());
@ -236,7 +236,7 @@ void PlaylistContainer::SetViewModel(Playlist *playlist, const int scroll_positi
ui_->undo->setDefaultAction(undo_);
ui_->redo->setDefaultAction(redo_);
emit UndoRedoActionsChanged(undo_, redo_);
Q_EMIT UndoRedoActionsChanged(undo_, redo_);
}

View File

@ -161,7 +161,7 @@ void PlaylistHeader::SetColumnAlignment(QAction *action) {
void PlaylistHeader::ToggleVisible(const int section) {
SetSectionHidden(section, !isSectionHidden(section));
emit SectionVisibilityChanged(section, !isSectionHidden(section));
Q_EMIT SectionVisibilityChanged(section, !isSectionHidden(section));
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -169,7 +169,7 @@ void PlaylistHeader::enterEvent(QEnterEvent*) {
#else
void PlaylistHeader::enterEvent(QEvent*) {
#endif
emit MouseEntered();
Q_EMIT MouseEntered();
}
void PlaylistHeader::ResetColumns() {
@ -177,5 +177,5 @@ void PlaylistHeader::ResetColumns() {
}
void PlaylistHeader::ToggleRatingEditStatus() {
emit SectionRatingLockStatusChanged(action_rating_lock_->isChecked());
Q_EMIT SectionRatingLockStatusChanged(action_rating_lock_->isChecked());
}

View File

@ -105,7 +105,7 @@ void PlaylistListModel::AddRowItem(QStandardItem *item, const QString &parent_pa
playlists_by_id_[id] = item;
if (dropping_rows_) {
emit PlaylistPathChanged(id, parent_path);
Q_EMIT PlaylistPathChanged(id, parent_path);
}
break;
@ -227,7 +227,7 @@ bool PlaylistListModel::setData(const QModelIndex &idx, const QVariant &value, i
switch (idx.data(Role_Type).toInt()) {
case Type_Playlist:
emit PlaylistRenamed(idx.data(Role_PlaylistId).toInt(), value.toString());
Q_EMIT PlaylistRenamed(idx.data(Role_PlaylistId).toInt(), value.toString());
break;
case Type_Folder:
@ -247,7 +247,7 @@ void PlaylistListModel::UpdatePathsRecursive(const QModelIndex &parent) {
switch (parent.data(Role_Type).toInt()) {
case Type_Playlist:
emit PlaylistPathChanged(parent.data(Role_PlaylistId).toInt(), ItemPath(itemFromIndex(parent)));
Q_EMIT PlaylistPathChanged(parent.data(Role_PlaylistId).toInt(), ItemPath(itemFromIndex(parent)));
break;
case Type_Folder:

View File

@ -68,7 +68,7 @@ bool PlaylistListView::ItemsSelected() const {
}
void PlaylistListView::selectionChanged(const QItemSelection&, const QItemSelection&) {
emit ItemsSelectedChanged(selectionModel()->selectedRows().count() > 0);
Q_EMIT ItemsSelectedChanged(selectionModel()->selectedRows().count() > 0);
}
void PlaylistListView::dragEnterEvent(QDragEnterEvent *e) {
@ -121,7 +121,7 @@ void PlaylistListView::timerEvent(QTimerEvent *e) {
QTreeView::timerEvent(e);
if (e->timerId() == drag_hover_timer_.timerId()) {
drag_hover_timer_.stop();
emit doubleClicked(currentIndex());
Q_EMIT doubleClicked(currentIndex());
}
}
@ -132,7 +132,7 @@ void PlaylistListView::dropEvent(QDropEvent *e) {
if (drag_hover_timer_.isActive()) {
drag_hover_timer_.stop();
}
emit ItemMimeDataDroppedSignal(currentIndex(), e->mimeData());
Q_EMIT ItemMimeDataDroppedSignal(currentIndex(), e->mimeData());
}
else {
AutoExpandingTreeView::dropEvent(e);

View File

@ -112,7 +112,7 @@ void PlaylistManager::Init(SharedPtr<CollectionBackend> collection_backend, Shar
// If no playlist exists then make a new one
if (playlists_.isEmpty()) New(tr("Playlist"));
emit PlaylistManagerInitialized();
Q_EMIT PlaylistManagerInitialized();
}
@ -123,7 +123,7 @@ void PlaylistManager::PlaylistLoaded() {
QObject::disconnect(playlist, &Playlist::PlaylistLoaded, this, &PlaylistManager::PlaylistLoaded);
--playlists_loading_;
if (playlists_loading_ == 0) {
emit AllPlaylistsLoaded();
Q_EMIT AllPlaylistsLoaded();
}
}
@ -165,7 +165,7 @@ Playlist *PlaylistManager::AddPlaylist(const int id, const QString &name, const
playlists_[id] = Data(ret, name);
emit PlaylistAdded(id, name, favorite);
Q_EMIT PlaylistAdded(id, name, favorite);
if (current_ == -1) {
SetCurrentPlaylist(id);
@ -205,7 +205,7 @@ void PlaylistManager::Load(const QString &filename) {
int id = playlist_backend_->CreatePlaylist(fileinfo.completeBaseName(), QString());
if (id == -1) {
emit Error(tr("Couldn't create playlist"));
Q_EMIT Error(tr("Couldn't create playlist"));
return;
}
@ -292,7 +292,7 @@ void PlaylistManager::Rename(const int id, const QString &new_name) {
playlist_backend_->RenamePlaylist(id, new_name);
playlists_[id].name = new_name;
emit PlaylistRenamed(id, new_name);
Q_EMIT PlaylistRenamed(id, new_name);
}
@ -309,7 +309,7 @@ void PlaylistManager::Favorite(const int id, const bool favorite) {
// while it's not visible in the playlist tabbar either, because it has been closed: delete it.
playlist_backend_->RemovePlaylist(id);
}
emit PlaylistFavorited(id, favorite);
Q_EMIT PlaylistFavorited(id, favorite);
}
@ -332,11 +332,11 @@ bool PlaylistManager::Close(const int id) {
if (id == current_) SetCurrentPlaylist(next_id);
Data data = playlists_.take(id);
emit PlaylistClosed(id);
Q_EMIT PlaylistClosed(id);
if (!data.p->is_favorite()) {
playlist_backend_->RemovePlaylist(id);
emit PlaylistDeleted(id);
Q_EMIT PlaylistDeleted(id);
}
delete data.p;
@ -351,12 +351,12 @@ void PlaylistManager::Delete(const int id) {
}
playlist_backend_->RemovePlaylist(id);
emit PlaylistDeleted(id);
Q_EMIT PlaylistDeleted(id);
}
void PlaylistManager::OneOfPlaylistsChanged() {
emit PlaylistChanged(qobject_cast<Playlist*>(sender()));
Q_EMIT PlaylistChanged(qobject_cast<Playlist*>(sender()));
}
void PlaylistManager::SetCurrentPlaylist(const int id) {
@ -369,7 +369,7 @@ void PlaylistManager::SetCurrentPlaylist(const int id) {
}
current_ = id;
emit CurrentChanged(current(), playlists_[id].scroll_position);
Q_EMIT CurrentChanged(current(), playlists_[id].scroll_position);
UpdateSummaryText();
}
@ -383,7 +383,7 @@ void PlaylistManager::SetActivePlaylist(const int id) {
active_ = id;
emit ActiveChanged(active());
Q_EMIT ActiveChanged(active());
}
@ -458,7 +458,7 @@ void PlaylistManager::UpdateSummaryText() {
summary += QLatin1String(" - [ ") + Utilities::WordyTimeNanosec(nanoseconds) + QLatin1String(" ]");
}
emit SummaryTextChanged(summary);
Q_EMIT SummaryTextChanged(summary);
}

View File

@ -181,7 +181,7 @@ void PlaylistSequence::SetRepeatMode(const RepeatMode mode) {
if (mode != repeat_mode_) {
repeat_mode_ = mode;
emit RepeatModeChanged(mode);
Q_EMIT RepeatModeChanged(mode);
}
Save();
@ -201,7 +201,7 @@ void PlaylistSequence::SetShuffleMode(const ShuffleMode mode) {
if (mode != shuffle_mode_) {
shuffle_mode_ = mode;
emit ShuffleModeChanged(mode);
Q_EMIT ShuffleModeChanged(mode);
}
Save();

View File

@ -183,12 +183,12 @@ void PlaylistTabBar::RenameSlot() {
if (new_name.isEmpty() || new_name == old_name) return;
emit Rename(playlist_id, new_name);
Q_EMIT Rename(playlist_id, new_name);
}
void PlaylistTabBar::RenameInline() {
emit Rename(tabData(menu_index_).toInt(), rename_editor_->text());
Q_EMIT Rename(tabData(menu_index_).toInt(), rename_editor_->text());
HideEditor();
}
@ -267,7 +267,7 @@ void PlaylistTabBar::CloseSlot() {
// Close the playlist. If the playlist is not a favorite playlist, it will be deleted, as it will not be visible after being closed.
// Otherwise, the tab is closed but the playlist still exists and can be resurrected from the "Playlists" tab.
emit Close(playlist_id);
Q_EMIT Close(playlist_id);
// Select the nearest tab.
if (menu_index_ > 1) {
@ -291,7 +291,7 @@ void PlaylistTabBar::SaveSlot() {
if (menu_index_ == -1) return;
emit Save(tabData(menu_index_).toInt());
Q_EMIT Save(tabData(menu_index_).toInt());
}
@ -341,7 +341,7 @@ void PlaylistTabBar::set_text_by_id(const int id, const QString &text) {
}
void PlaylistTabBar::CurrentIndexChanged(const int index) {
if (!suppress_current_changed_) emit CurrentIdChanged(tabData(index).toInt());
if (!suppress_current_changed_) Q_EMIT CurrentIdChanged(tabData(index).toInt());
}
void PlaylistTabBar::InsertTab(const int id, const int index, const QString &text, const bool favorite) {
@ -363,7 +363,7 @@ void PlaylistTabBar::InsertTab(const int id, const int index, const QString &tex
// If we are still starting up, we don't need to do this, as the tab ordering after startup will be the same as was already in the db.
if (initialized_) {
if (currentIndex() == index) emit CurrentIdChanged(id);
if (currentIndex() == index) Q_EMIT CurrentIdChanged(id);
// Update playlist tab order/visibility
TabMoved();
@ -378,7 +378,7 @@ void PlaylistTabBar::TabMoved() {
for (int i = 0; i < count(); ++i) {
ids << tabData(i).toInt();
}
emit PlaylistOrderChanged(ids);
Q_EMIT PlaylistOrderChanged(ids);
}

View File

@ -411,7 +411,7 @@ void PlaylistView::RestoreHeaderState() {
header_state_restored_ = true;
emit ColumnAlignmentChanged(column_alignment_);
Q_EMIT ColumnAlignmentChanged(column_alignment_);
}
@ -671,23 +671,23 @@ void PlaylistView::keyPressEvent(QKeyEvent *event) {
CopyCurrentSongToClipboard();
}
else if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
if (currentIndex().isValid()) emit PlayItem(currentIndex(), Playlist::AutoScroll::Never);
if (currentIndex().isValid()) Q_EMIT PlayItem(currentIndex(), Playlist::AutoScroll::Never);
event->accept();
}
else if (event->modifiers() != Qt::ControlModifier && event->key() == Qt::Key_Space) {
emit PlayPause();
Q_EMIT PlayPause();
event->accept();
}
else if (event->key() == Qt::Key_Left) {
emit SeekBackward();
Q_EMIT SeekBackward();
event->accept();
}
else if (event->key() == Qt::Key_Right) {
emit SeekForward();
Q_EMIT SeekForward();
event->accept();
}
else if (event->modifiers() == Qt::NoModifier && ((event->key() >= Qt::Key_Exclam && event->key() <= Qt::Key_Z) || event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Escape)) {
emit FocusOnFilterSignal(event);
Q_EMIT FocusOnFilterSignal(event);
event->accept();
}
else {
@ -697,7 +697,7 @@ void PlaylistView::keyPressEvent(QKeyEvent *event) {
}
void PlaylistView::contextMenuEvent(QContextMenuEvent *e) {
emit RightClicked(e->globalPos(), indexAt(e->pos()));
Q_EMIT RightClicked(e->globalPos(), indexAt(e->pos()));
e->accept();
}
@ -1271,7 +1271,7 @@ void PlaylistView::ReloadSettings() {
}
setProperty("default_background_enabled", background_image_type_ == AppearanceSettingsPage::BackgroundImageType::Default);
setProperty("strawbs_background_enabled", background_image_type_ == AppearanceSettingsPage::BackgroundImageType::Strawbs);
emit BackgroundPropertyChanged();
Q_EMIT BackgroundPropertyChanged();
force_background_redraw_ = true;
}
@ -1365,7 +1365,7 @@ void PlaylistView::SetColumnAlignment(const int section, const Qt::Alignment ali
if (section < 0) return;
column_alignment_[section] = alignment;
emit ColumnAlignmentChanged(column_alignment_);
Q_EMIT ColumnAlignmentChanged(column_alignment_);
SaveSettings();
}

View File

@ -177,7 +177,7 @@ class PlaylistView : public QTreeView {
void set_background_image_type(AppearanceSettingsPage::BackgroundImageType bg) {
background_image_type_ = bg;
emit BackgroundPropertyChanged(); // clazy:exclude=incorrect-emit
Q_EMIT BackgroundPropertyChanged(); // clazy:exclude=incorrect-emit
}
// Save image as the background_image_ after applying some modifications (opacity, ...).
// Should be used instead of modifying background_image_ directly

View File

@ -76,7 +76,7 @@ void SongLoaderInserter::Load(Playlist *destination, int row, bool play_now, boo
else {
const QStringList errors = loader->errors();
for (const QString &error : errors) {
emit Error(error);
Q_EMIT Error(error);
}
}
delete loader;
@ -114,11 +114,11 @@ void SongLoaderInserter::LoadAudioCD(Playlist *destination, int row, bool play_n
SongLoader::Result ret = loader->LoadAudioCD();
if (ret == SongLoader::Result::Error) {
if (loader->errors().isEmpty())
emit Error(tr("Error while loading audio CD."));
Q_EMIT Error(tr("Error while loading audio CD."));
else {
const QStringList errors = loader->errors();
for (const QString &error : errors) {
emit Error(error);
Q_EMIT Error(error);
}
}
delete loader;
@ -135,7 +135,7 @@ void SongLoaderInserter::AudioCDTracksLoadFinished(SongLoader *loader) {
if (songs_.isEmpty()) {
const QStringList errors = loader->errors();
for (const QString &error : errors) {
emit Error(error);
Q_EMIT Error(error);
}
}
else {
@ -184,7 +184,7 @@ void SongLoaderInserter::AsyncLoad() {
if (res == SongLoader::Result::Error) {
const QStringList errors = loader->errors();
for (const QString &error : errors) {
emit Error(error);
Q_EMIT Error(error);
}
continue;
}
@ -200,7 +200,7 @@ void SongLoaderInserter::AsyncLoad() {
}
task_manager_->SetTaskFinished(async_load_id);
emit PreloadFinished();
Q_EMIT PreloadFinished();
// Songs are inserted in playlist, now load them completely.
async_progress = 0;
@ -219,7 +219,7 @@ void SongLoaderInserter::AsyncLoad() {
task_manager_->SetTaskFinished(async_load_id);
// Replace the partially-loaded items by the new ones, fully loaded.
emit EffectiveLoadFinished(songs);
Q_EMIT EffectiveLoadFinished(songs);
deleteLater();

View File

@ -394,7 +394,7 @@ void CueParser::Save(const SongList &songs, QIODevice *device, const QDir &dir,
Q_UNUSED(dir);
Q_UNUSED(path_type);
emit Error(tr("Saving CUE files is not supported."));
Q_EMIT Error(tr("Saving CUE files is not supported."));
// TODO

View File

@ -60,7 +60,7 @@ void ParserBase::LoadSong(const QString &filename_or_url, const qint64 beginning
}
else {
qLog(Error) << "Don't know how to handle" << url;
emit Error(tr("Don't know how to handle %1").arg(filename_or_url));
Q_EMIT Error(tr("Don't know how to handle %1").arg(filename_or_url));
return;
}
}

View File

@ -182,14 +182,14 @@ SongList PlaylistParser::LoadFromFile(const QString &filename) const {
ParserBase *parser = ParserForExtension(Type::Load, fileinfo.suffix());
if (!parser) {
qLog(Error) << "Unknown filetype:" << filename;
emit Error(tr("Unknown filetype: %1").arg(filename));
Q_EMIT Error(tr("Unknown filetype: %1").arg(filename));
return SongList();
}
// Open the file
QFile file(filename);
if (!file.open(QIODevice::ReadOnly)) {
emit Error(tr("Could not open file %1").arg(filename));
Q_EMIT Error(tr("Could not open file %1").arg(filename));
return SongList();
}
@ -219,7 +219,7 @@ void PlaylistParser::Save(const SongList &songs, const QString &filename, const
if (!dir.exists()) {
qLog(Error) << "Directory" << dir.path() << "does not exist";
emit Error(tr("Directory %1 does not exist.").arg(dir.path()));
Q_EMIT Error(tr("Directory %1 does not exist.").arg(dir.path()));
return;
}
@ -227,7 +227,7 @@ void PlaylistParser::Save(const SongList &songs, const QString &filename, const
ParserBase *parser = ParserForExtension(Type::Save, fileinfo.suffix());
if (!parser) {
qLog(Error) << "Unknown filetype" << filename;
emit Error(tr("Unknown filetype: %1").arg(filename));
Q_EMIT Error(tr("Unknown filetype: %1").arg(filename));
return;
}
@ -242,7 +242,7 @@ void PlaylistParser::Save(const SongList &songs, const QString &filename, const
QFile file(fileinfo.absoluteFilePath());
if (!file.open(QIODevice::WriteOnly)) {
qLog(Error) << "Failed to open" << filename << "for writing.";
emit Error(tr("Failed to open %1 for writing.").arg(filename));
Q_EMIT Error(tr("Failed to open %1 for writing.").arg(filename));
return;
}

View File

@ -167,13 +167,13 @@ void QobuzFavoriteRequest::AddFavoritesReply(QNetworkReply *reply, const Favorit
switch (type) {
case FavoriteType::Artists:
emit ArtistsAdded(songs);
Q_EMIT ArtistsAdded(songs);
break;
case FavoriteType::Albums:
emit AlbumsAdded(songs);
Q_EMIT AlbumsAdded(songs);
break;
case FavoriteType::Songs:
emit SongsAdded(songs);
Q_EMIT SongsAdded(songs);
break;
}
@ -261,13 +261,13 @@ void QobuzFavoriteRequest::RemoveFavoritesReply(QNetworkReply *reply, const Favo
switch (type) {
case FavoriteType::Artists:
emit ArtistsRemoved(songs);
Q_EMIT ArtistsRemoved(songs);
break;
case FavoriteType::Albums:
emit AlbumsRemoved(songs);
Q_EMIT AlbumsRemoved(songs);
break;
case FavoriteType::Songs:
emit SongsRemoved(songs);
Q_EMIT SongsRemoved(songs);
break;
}

Some files were not shown because too many files have changed in this diff Show More