mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-02 00:12:45 +00:00
QtUtils/RunOnObject: Make safe under object destruction
Co-Authored-By: cancel <cancel@cancel.fm>
This commit is contained in:
parent
f31f1a08fb
commit
268b424843
5 changed files with 61 additions and 13 deletions
|
@ -580,12 +580,15 @@ void NetPlayDialog::OnTraversalError(TraversalClient::FailureReason error)
|
|||
|
||||
bool NetPlayDialog::IsRecording()
|
||||
{
|
||||
return RunOnObject(m_record_input_box, &QCheckBox::isChecked);
|
||||
std::optional<bool> is_recording = RunOnObject(m_record_input_box, &QCheckBox::isChecked);
|
||||
if (is_recording)
|
||||
return *is_recording;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string NetPlayDialog::FindGame(const std::string& game)
|
||||
{
|
||||
return RunOnObject(this, [this, game] {
|
||||
std::optional<std::string> path = RunOnObject(this, [this, game] {
|
||||
for (int i = 0; i < m_game_list_model->rowCount(QModelIndex()); i++)
|
||||
{
|
||||
if (m_game_list_model->GetUniqueIdentifier(i).toStdString() == game)
|
||||
|
@ -593,6 +596,9 @@ std::string NetPlayDialog::FindGame(const std::string& game)
|
|||
}
|
||||
return std::string("");
|
||||
});
|
||||
if (path)
|
||||
return *path;
|
||||
return std::string("");
|
||||
}
|
||||
|
||||
void NetPlayDialog::ShowMD5Dialog(const std::string& file_identifier)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue