mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-21 03:54:57 +00:00
RunOnObject: accept pointers to member functions
This commit is contained in:
parent
1e27e87d93
commit
7f812a7a03
2 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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)(); });
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue