summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorMichael M <mchtly@gmail.com>2017-09-15 09:08:09 -0700
committerMichael M <mchtly@gmail.com>2017-09-15 10:36:33 -0700
commit7f812a7a03d803e91c60c75102f4580196bbff28 (patch)
treec2e2b8094c91ec2c2020f7f997fea0a3e97075ee /Source
parent1e27e87d939ea19f0d2c05ceec05ee1e5802d401 (diff)
RunOnObject: accept pointers to member functions
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp2
-rw-r--r--Source/Core/DolphinQt2/QtUtils/RunOnObject.h6
2 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp b/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp
index afd00662ac..77a17486b5 100644
--- a/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp
+++ b/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp
@@ -524,7 +524,7 @@ void NetPlayDialog::OnTraversalError(TraversalClient::FailureReason error)
bool NetPlayDialog::IsRecording()
{
- return RunOnObject(this, [this] { return m_record_input_box->isChecked(); });
+ return RunOnObject(m_record_input_box, &QCheckBox::isChecked);
}
std::string NetPlayDialog::FindGame(const std::string& game)
diff --git a/Source/Core/DolphinQt2/QtUtils/RunOnObject.h b/Source/Core/DolphinQt2/QtUtils/RunOnObject.h
index d1ebcd22cc..bd0b2ca556 100644
--- a/Source/Core/DolphinQt2/QtUtils/RunOnObject.h
+++ b/Source/Core/DolphinQt2/QtUtils/RunOnObject.h
@@ -33,3 +33,9 @@ auto RunOnObject(QObject* object, F&& functor)
event.Wait();
return result;
}
+
+template <typename Base, typename Type, typename Receiver>
+auto RunOnObject(Receiver* obj, Type Base::*func)
+{
+ return RunOnObject(obj, [obj, func] { return (obj->*func)(); });
+}