Use static QMetaObject::invokeMethod

This commit is contained in:
Jonas Kvinge
2021-09-09 21:53:14 +02:00
parent d35d3aabc3
commit 24a3ac9811
17 changed files with 53 additions and 53 deletions

View File

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

View File

@@ -2117,7 +2117,7 @@ void MainWindow::SongSaveComplete(TagReaderReply *reply, const QPersistentModelI
if (reply->is_successful() && idx.isValid()) {
app_->playlist_manager()->current()->ReloadItems(QList<int>() << idx.row());
}
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
QMetaObject::invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
}

View File

@@ -714,7 +714,7 @@ void SongLoader::StopTypefindAsync(bool success) {
state_ = Finished;
success_ = success;
metaObject()->invokeMethod(this, "StopTypefind", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, "StopTypefind", Qt::QueuedConnection);
}
#endif
@@ -726,7 +726,7 @@ void SongLoader::ScheduleTimeoutAsync() {
ScheduleTimeout();
}
else {
metaObject()->invokeMethod(this, "ScheduleTimeout", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, "ScheduleTimeout", Qt::QueuedConnection);
}
}

View File

@@ -55,7 +55,7 @@ TagReaderClient::TagReaderClient(QObject *parent) : QObject(parent), worker_pool
void TagReaderClient::Start() { worker_pool_->Start(); }
void TagReaderClient::ExitAsync() {
metaObject()->invokeMethod(this, "Exit", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, "Exit", Qt::QueuedConnection);
}
void TagReaderClient::Exit() {
@@ -137,7 +137,7 @@ void TagReaderClient::ReadFileBlocking(const QString &filename, Song *song) {
if (reply->WaitForFinished()) {
song->InitFromProtobuf(reply->message().read_file_response().metadata());
}
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
QMetaObject::invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
}
@@ -151,7 +151,7 @@ bool TagReaderClient::SaveFileBlocking(const QString &filename, const Song &meta
if (reply->WaitForFinished()) {
ret = reply->message().save_file_response().success();
}
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
QMetaObject::invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
return ret;
@@ -167,7 +167,7 @@ bool TagReaderClient::IsMediaFileBlocking(const QString &filename) {
if (reply->WaitForFinished()) {
ret = reply->message().is_media_file_response().success();
}
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
QMetaObject::invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
return ret;
@@ -184,7 +184,7 @@ QByteArray TagReaderClient::LoadEmbeddedArtBlocking(const QString &filename) {
const std::string &data_str = reply->message().load_embedded_art_response().data();
ret = QByteArray(data_str.data(), data_str.size());
}
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
QMetaObject::invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
return ret;
@@ -201,7 +201,7 @@ QImage TagReaderClient::LoadEmbeddedArtAsImageBlocking(const QString &filename)
const std::string &data_str = reply->message().load_embedded_art_response().data();
ret.loadFromData(QByteArray(data_str.data(), data_str.size()));
}
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
QMetaObject::invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
return ret;
@@ -217,7 +217,7 @@ bool TagReaderClient::SaveEmbeddedArtBlocking(const QString &filename, const QBy
if (reply->WaitForFinished()) {
ret = reply->message().save_embedded_art_response().success();
}
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
QMetaObject::invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
return ret;