From 1e27e87d939ea19f0d2c05ceec05ee1e5802d401 Mon Sep 17 00:00:00 2001 From: Michael M Date: Fri, 15 Sep 2017 08:51:08 -0700 Subject: [PATCH] QueueOnObject: accept pointers to member functions --- Source/Core/DolphinQt2/MainWindow.cpp | 2 +- Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp | 2 +- Source/Core/DolphinQt2/QtUtils/QueueOnObject.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp index a55b5b94b2..ce710b6ce0 100644 --- a/Source/Core/DolphinQt2/MainWindow.cpp +++ b/Source/Core/DolphinQt2/MainWindow.cpp @@ -877,7 +877,7 @@ void MainWindow::OnImportNANDBackup() .arg((QDateTime::currentDateTime().toMSecsSinceEpoch() - beginning) / 1000)); }); }); - QueueOnObject(dialog, [dialog] { dialog->close(); }); + QueueOnObject(dialog, &QProgressDialog::close); }); dialog->exec(); diff --git a/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp b/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp index fed75b2eb1..afd00662ac 100644 --- a/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp +++ b/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp @@ -405,7 +405,7 @@ void NetPlayDialog::StopGame() void NetPlayDialog::Update() { - QueueOnObject(this, [this] { UpdateGUI(); }); + QueueOnObject(this, &NetPlayDialog::UpdateGUI); } void NetPlayDialog::DisplayMessage(const QString& msg, const std::string& color, int duration) diff --git a/Source/Core/DolphinQt2/QtUtils/QueueOnObject.h b/Source/Core/DolphinQt2/QtUtils/QueueOnObject.h index 6110bccb79..a50e757d55 100644 --- a/Source/Core/DolphinQt2/QtUtils/QueueOnObject.h +++ b/Source/Core/DolphinQt2/QtUtils/QueueOnObject.h @@ -12,8 +12,8 @@ // arbitrary code from non-GUI threads. For more information, see: // https://stackoverflow.com/questions/21646467/ -template -static void QueueOnObject(QObject* obj, F&& func) +template +static void QueueOnObject(T* obj, F&& func) { QObject src; QObject::connect(&src, &QObject::destroyed, obj, std::forward(func), Qt::QueuedConnection);