mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Windows: Switch to preferred file selection method.
It seems like the previous may not support long paths.
This commit is contained in:
parent
08a55d19d5
commit
8d29aa6590
2 changed files with 13 additions and 6 deletions
|
@ -191,10 +191,13 @@ PermissionStatus System_GetPermissionStatus(SystemPermission permission) { retur
|
|||
|
||||
void OpenDirectory(const char *path) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS)
|
||||
PIDLIST_ABSOLUTE pidl = ILCreateFromPath(ConvertUTF8ToWString(ReplaceAll(path, "/", "\\")).c_str());
|
||||
SFGAOF flags;
|
||||
PIDLIST_ABSOLUTE pidl = nullptr;
|
||||
HRESULT hr = SHParseDisplayName(ConvertUTF8ToWString(ReplaceAll(path, "/", "\\")).c_str(), nullptr, &pidl, 0, &flags);
|
||||
if (pidl) {
|
||||
SHOpenFolderAndSelectItems(pidl, 0, NULL, 0);
|
||||
ILFree(pidl);
|
||||
if (SUCCEEDED(hr))
|
||||
SHOpenFolderAndSelectItems(pidl, 0, NULL, 0);
|
||||
CoTaskMemFree(pidl);
|
||||
}
|
||||
#elif PPSSPP_PLATFORM(MAC)
|
||||
std::string command = std::string("open ") + path;
|
||||
|
|
|
@ -108,10 +108,14 @@ static std::thread inputBoxThread;
|
|||
static bool inputBoxRunning = false;
|
||||
|
||||
void OpenDirectory(const char *path) {
|
||||
PIDLIST_ABSOLUTE pidl = ILCreateFromPath(ConvertUTF8ToWString(ReplaceAll(path, "/", "\\")).c_str());
|
||||
SFGAOF flags;
|
||||
PIDLIST_ABSOLUTE pidl = nullptr;
|
||||
HRESULT hr = SHParseDisplayName(ConvertUTF8ToWString(ReplaceAll(path, "/", "\\")).c_str(), nullptr, &pidl, 0, &flags);
|
||||
|
||||
if (pidl) {
|
||||
SHOpenFolderAndSelectItems(pidl, 0, NULL, 0);
|
||||
ILFree(pidl);
|
||||
if (SUCCEEDED(hr))
|
||||
SHOpenFolderAndSelectItems(pidl, 0, nullptr, 0);
|
||||
CoTaskMemFree(pidl);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue