summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorMichael M <mchtly@gmail.com>2017-09-15 08:51:08 -0700
committerMichael M <mchtly@gmail.com>2017-09-15 10:36:32 -0700
commit1e27e87d939ea19f0d2c05ceec05ee1e5802d401 (patch)
treedefa68f21297547214d8b56d45d18ec3cd00db15 /Source/Core
parent7cb8d6612c6df51073037b56ebc866f180aecd71 (diff)
QueueOnObject: accept pointers to member functions
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt2/MainWindow.cpp2
-rw-r--r--Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp2
-rw-r--r--Source/Core/DolphinQt2/QtUtils/QueueOnObject.h4
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 <typename F>
-static void QueueOnObject(QObject* obj, F&& func)
+template <typename T, typename F>
+static void QueueOnObject(T* obj, F&& func)
{
QObject src;
QObject::connect(&src, &QObject::destroyed, obj, std::forward<F>(func), Qt::QueuedConnection);