Replace emit with Q_EMIT
This commit is contained in:
@@ -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(); }
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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_);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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_);
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ void TagReaderClient::Exit() {
|
||||
|
||||
Q_ASSERT(QThread::currentThread() == thread());
|
||||
moveToThread(original_thread_);
|
||||
emit ExitFinished();
|
||||
Q_EMIT ExitFinished();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user