mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
make file::openFolder actually work on selecting paths on windows
This commit is contained in:
parent
057ffa58f0
commit
0309e01e04
1 changed files with 7 additions and 2 deletions
|
@ -82,9 +82,14 @@ bool utils::file::openFolder(std::filesystem::path const& path) {
|
|||
auto success = false;
|
||||
auto thread = std::thread([](auto const& path, bool& success) {
|
||||
if (CoInitializeEx(nullptr, COINIT_MULTITHREADED) == S_OK) {
|
||||
if (auto id = ILCreateFromPathW(path.wstring().c_str())) {
|
||||
// Don't try to open up a file >:(
|
||||
std::error_code whatever;
|
||||
std::filesystem::path dir = path;
|
||||
if (!std::filesystem::is_directory(dir, whatever)) {
|
||||
dir = dir.parent_path();
|
||||
}
|
||||
if (auto id = ILCreateFromPathW(dir.wstring().c_str())) {
|
||||
std::filesystem::path selectPath = path / ".";
|
||||
std::error_code whatever;
|
||||
if (!std::filesystem::is_directory(path, whatever)) {
|
||||
selectPath = path;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue