Fix browsing of directory paths with spaces

Open directories through default file handler rather than file URI scheme
This commit is contained in:
neebyA 2025-04-26 23:05:42 -07:00
parent b089ae5b32
commit 2e2d351e23
3 changed files with 6 additions and 6 deletions

View file

@ -491,7 +491,7 @@ void TitleManager::OnSaveOpenDirectory(wxCommandEvent& event)
if (!fs::exists(target) || !fs::is_directory(target))
return;
wxLaunchDefaultBrowser(wxHelper::FromUtf8(fmt::format("file:{}", _pathToUtf8(target))));
wxLaunchDefaultApplication(wxHelper::FromPath(target));
}
void TitleManager::OnSaveDelete(wxCommandEvent& event)

View file

@ -668,7 +668,7 @@ void wxGameList::OnContextMenuSelected(wxCommandEvent& event)
{
fs::path path(gameInfo.GetBase().GetPath());
_stripPathFilename(path);
wxLaunchDefaultBrowser(wxHelper::FromUtf8(fmt::format("file:{}", _pathToUtf8(path))));
wxLaunchDefaultApplication(wxHelper::FromPath(path));
break;
}
case kWikiPage:
@ -689,21 +689,21 @@ void wxGameList::OnContextMenuSelected(wxCommandEvent& event)
case kContextMenuSaveFolder:
{
wxLaunchDefaultBrowser(wxHelper::FromUtf8(fmt::format("file:{}", _pathToUtf8(gameInfo.GetSaveFolder()))));
wxLaunchDefaultApplication(wxHelper::FromPath(gameInfo.GetSaveFolder()));
break;
}
case kContextMenuUpdateFolder:
{
fs::path path(gameInfo.GetUpdate().GetPath());
_stripPathFilename(path);
wxLaunchDefaultBrowser(wxHelper::FromUtf8(fmt::format("file:{}", _pathToUtf8(path))));
wxLaunchDefaultApplication(wxHelper::FromPath(path));
break;
}
case kContextMenuDLCFolder:
{
fs::path path(gameInfo.GetAOC().front().GetPath());
_stripPathFilename(path);
wxLaunchDefaultBrowser(wxHelper::FromUtf8(fmt::format("file:{}", _pathToUtf8(path))));
wxLaunchDefaultApplication(wxHelper::FromPath(path));
break;
}
case kContextMenuRemoveCache:

View file

@ -869,7 +869,7 @@ void wxTitleManagerList::OnContextMenuSelected(wxCommandEvent& event)
case kContextMenuOpenDirectory:
{
const auto path = fs::is_directory(entry->path) ? entry->path : entry->path.parent_path();
wxLaunchDefaultBrowser(wxHelper::FromUtf8(fmt::format("file:{}", _pathToUtf8(path))));
wxLaunchDefaultApplication(wxHelper::FromPath(path));
}
break;
case kContextMenuDelete: