Use new connect syntax for QMetaObject::invokeMethod

This commit is contained in:
Jonas Kvinge 2023-05-03 20:08:51 +02:00
parent 301e6b194a
commit e511b2faf9
14 changed files with 27 additions and 27 deletions

View File

@ -228,7 +228,7 @@ void WorkerPool<HandlerType>::SetExecutableName(const QString &executable_name)
template<typename HandlerType>
void WorkerPool<HandlerType>::Start() {
QMetaObject::invokeMethod(this, "DoStart");
QMetaObject::invokeMethod(this, &WorkerPool<HandlerType>::DoStart);
}
template<typename HandlerType>
@ -423,7 +423,7 @@ WorkerPool<HandlerType>::SendMessageWithReply(MessageType *message) {
}
// Wake up the main thread
QMetaObject::invokeMethod(this, "SendQueuedMessages", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &WorkerPool<HandlerType>::SendQueuedMessages, Qt::QueuedConnection);
return reply;

View File

@ -89,7 +89,7 @@ void CollectionBackend::Close() {
}
void CollectionBackend::ExitAsync() {
QMetaObject::invokeMethod(this, "Exit", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &CollectionBackend::Exit, Qt::QueuedConnection);
}
void CollectionBackend::Exit() {
@ -115,19 +115,19 @@ void CollectionBackend::ReportErrors(const CollectionQuery &query) {
}
void CollectionBackend::LoadDirectoriesAsync() {
QMetaObject::invokeMethod(this, "LoadDirectories", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &CollectionBackend::LoadDirectories, Qt::QueuedConnection);
}
void CollectionBackend::UpdateTotalSongCountAsync() {
QMetaObject::invokeMethod(this, "UpdateTotalSongCount", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &CollectionBackend::UpdateTotalSongCount, Qt::QueuedConnection);
}
void CollectionBackend::UpdateTotalArtistCountAsync() {
QMetaObject::invokeMethod(this, "UpdateTotalArtistCount", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &CollectionBackend::UpdateTotalArtistCount, Qt::QueuedConnection);
}
void CollectionBackend::UpdateTotalAlbumCountAsync() {
QMetaObject::invokeMethod(this, "UpdateTotalAlbumCount", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &CollectionBackend::UpdateTotalAlbumCount, Qt::QueuedConnection);
}
void CollectionBackend::IncrementPlayCountAsync(const int id) {
@ -1825,7 +1825,7 @@ bool CollectionBackend::ResetPlayStatistics(const QStringList &id_str_list) {
void CollectionBackend::DeleteAllAsync() {
QMetaObject::invokeMethod(this, "DeleteAll", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &CollectionBackend::DeleteAll, Qt::QueuedConnection);
}

View File

@ -115,7 +115,7 @@ CollectionWatcher::CollectionWatcher(Song::Source source, QObject *parent)
}
void CollectionWatcher::ExitAsync() {
QMetaObject::invokeMethod(this, "Exit", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &CollectionWatcher::Exit, Qt::QueuedConnection);
}
void CollectionWatcher::Exit() {
@ -131,7 +131,7 @@ void CollectionWatcher::Exit() {
void CollectionWatcher::ReloadSettingsAsync() {
QMetaObject::invokeMethod(this, "ReloadSettings", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &CollectionWatcher::ReloadSettings, Qt::QueuedConnection);
}
@ -1118,13 +1118,13 @@ void CollectionWatcher::SetRescanPaused(bool pause) {
void CollectionWatcher::IncrementalScanAsync() {
QMetaObject::invokeMethod(this, "IncrementalScanNow", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &CollectionWatcher::IncrementalScanNow, Qt::QueuedConnection);
}
void CollectionWatcher::FullScanAsync() {
QMetaObject::invokeMethod(this, "FullScanNow", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &CollectionWatcher::FullScanNow, Qt::QueuedConnection);
}

View File

@ -91,7 +91,7 @@ Database::~Database() {
}
void Database::ExitAsync() {
QMetaObject::invokeMethod(this, "Exit", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &Database::Exit, Qt::QueuedConnection);
}
void Database::Exit() {

View File

@ -735,7 +735,7 @@ void SongLoader::StopTypefindAsync(const bool success) {
state_ = State::Finished;
success_ = success;
QMetaObject::invokeMethod(this, "StopTypefind", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &SongLoader::StopTypefind, Qt::QueuedConnection);
}
#endif
@ -746,7 +746,7 @@ void SongLoader::ScheduleTimeoutAsync() {
ScheduleTimeout();
}
else {
QMetaObject::invokeMethod(this, "ScheduleTimeout", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &SongLoader::ScheduleTimeout, Qt::QueuedConnection);
}
}

View File

@ -54,7 +54,7 @@ TagReaderClient::TagReaderClient(QObject *parent) : QObject(parent), worker_pool
void TagReaderClient::Start() { worker_pool_->Start(); }
void TagReaderClient::ExitAsync() {
QMetaObject::invokeMethod(this, "Exit", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &TagReaderClient::Exit, Qt::QueuedConnection);
}
void TagReaderClient::Exit() {

View File

@ -68,7 +68,7 @@ AlbumCoverLoader::AlbumCoverLoader(QObject *parent)
void AlbumCoverLoader::ExitAsync() {
stop_requested_ = true;
QMetaObject::invokeMethod(this, "Exit", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &AlbumCoverLoader::Exit, Qt::QueuedConnection);
}
@ -166,7 +166,7 @@ quint64 AlbumCoverLoader::EnqueueTask(TaskPtr task) {
tasks_.enqueue(task);
}
QMetaObject::invokeMethod(this, "ProcessTasks", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &AlbumCoverLoader::ProcessTasks, Qt::QueuedConnection);
return task->id;

View File

@ -58,7 +58,7 @@ void DeviceDatabaseBackend::Close() {
}
void DeviceDatabaseBackend::ExitAsync() {
QMetaObject::invokeMethod(this, "Exit", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &DeviceDatabaseBackend::Exit, Qt::QueuedConnection);
}
void DeviceDatabaseBackend::Exit() {

View File

@ -87,7 +87,7 @@ void DeviceLister::MountDevice(const QString &id, const int request_id) {
}
void DeviceLister::ExitAsync() {
QMetaObject::invokeMethod(this, "Exit", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &DeviceLister::Exit, Qt::QueuedConnection);
}
void DeviceLister::Exit() {

View File

@ -85,7 +85,7 @@ bool FilesystemDevice::Init() {
}
void FilesystemDevice::CloseAsync() {
QMetaObject::invokeMethod(this, "Close", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &FilesystemDevice::Close, Qt::QueuedConnection);
}
void FilesystemDevice::Close() {

View File

@ -160,7 +160,7 @@ void MoodbarLoader::MaybeTakeNextRequest() {
active_requests_ << url;
qLog(Info) << "Creating moodbar data for" << url.toLocalFile();
QMetaObject::invokeMethod(requests_[url], "Start", Qt::QueuedConnection);
QMetaObject::invokeMethod(requests_[url], &MoodbarPipeline::Start, Qt::QueuedConnection);
}

View File

@ -1490,7 +1490,7 @@ void Playlist::ScheduleSaveAsync() {
ScheduleSave();
}
else {
QMetaObject::invokeMethod(this, "ScheduleSave", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &Playlist::ScheduleSave, Qt::QueuedConnection);
}
}

View File

@ -73,7 +73,7 @@ void PlaylistBackend::Close() {
}
void PlaylistBackend::ExitAsync() {
QMetaObject::invokeMethod(this, "Exit", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &PlaylistBackend::Exit, Qt::QueuedConnection);
}
void PlaylistBackend::Exit() {

View File

@ -44,7 +44,7 @@ void RadioBackend::Close() {
}
void RadioBackend::ExitAsync() {
QMetaObject::invokeMethod(this, "Exit", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &RadioBackend::Exit, Qt::QueuedConnection);
}
void RadioBackend::Exit() {
@ -85,7 +85,7 @@ void RadioBackend::AddChannels(const RadioChannelList &channels) {
void RadioBackend::GetChannelsAsync() {
QMetaObject::invokeMethod(this, "GetChannels", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &RadioBackend::GetChannels, Qt::QueuedConnection);
}
@ -117,7 +117,7 @@ void RadioBackend::GetChannels() {
}
void RadioBackend::DeleteChannelsAsync() {
QMetaObject::invokeMethod(this, "DeleteChannels", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, &RadioBackend::DeleteChannels, Qt::QueuedConnection);
}
void RadioBackend::DeleteChannels() {