@@ -210,25 +210,27 @@ void MainFrame::BootGame(wxCommandEvent& WXUNUSED(event))
210210{
211211 bool stopped = false ;
212212
213- if (Emu.IsRunning ())
213+ if (Emu.IsRunning ())
214214 {
215215 Emu.Pause ();
216216 stopped = true ;
217217 }
218218
219219 wxDirDialog ctrl (this , L" Select game folder" , wxEmptyString);
220220
221- if (ctrl.ShowModal () == wxID_CANCEL)
221+ if (ctrl.ShowModal () == wxID_CANCEL)
222222 {
223- if (stopped) Emu.Resume ();
223+ if (stopped) Emu.Resume ();
224224 return ;
225225 }
226226
227227 Emu.Stop ();
228+
229+ const std::string path = fmt::ToUTF8 (ctrl.GetPath ());
228230
229- if (!Emu.BootGame (ctrl. GetPath (). ToStdString () ))
231+ if (!Emu.BootGame (path ))
230232 {
231- LOG_ERROR (GENERAL, " PS3 executable not found in selected folder (%s)" , fmt::ToUTF8 (ctrl. GetPath ())); // passing std::string (test)
233+ LOG_ERROR (GENERAL, " PS3 executable not found in selected folder (%s)" , path);
232234 }
233235}
234236
@@ -243,12 +245,14 @@ void MainFrame::InstallPkg(wxCommandEvent& WXUNUSED(event))
243245
244246 Emu.Stop ();
245247
248+ const std::string path = fmt::ToUTF8 (ctrl.GetPath ());
249+
246250 // Open PKG file
247- fs::file pkg_f (ctrl. GetPath (). ToStdString () );
251+ fs::file pkg_f (path );
248252
249253 if (!pkg_f || pkg_f.size () < 64 )
250254 {
251- LOG_ERROR (LOADER, " PKG: Failed to open %s" , ctrl. GetPath (). ToStdString () );
255+ LOG_ERROR (LOADER, " PKG: Failed to open %s" , path );
252256 return ;
253257 }
254258
@@ -428,7 +432,9 @@ void MainFrame::InstallFirmware(wxCommandEvent& WXUNUSED(event))
428432
429433 Emu.Stop ();
430434
431- fs::file pup_f (ctrl.GetPath ().ToStdString ());
435+ const std::string path = fmt::ToUTF8 (ctrl.GetPath ());
436+
437+ fs::file pup_f (path);
432438 pup_object pup (pup_f);
433439 if (!pup)
434440 {
0 commit comments