mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
FileChooser: Allow new filechooser to load paths containing unicode characters
This commit is contained in:
parent
1ec24991e8
commit
6ac0e90e58
1 changed files with 18 additions and 4 deletions
|
|
@ -234,8 +234,12 @@ private:
|
|||
};
|
||||
|
||||
LPWSTR ptr = nullptr;
|
||||
item.GetDisplayName (SIGDN_URL, &ptr);
|
||||
return std::unique_ptr<WCHAR, Free> { ptr };
|
||||
|
||||
if (item.GetDisplayName (SIGDN_FILESYSPATH, &ptr) != S_OK)
|
||||
return URL();
|
||||
|
||||
const auto path = std::unique_ptr<WCHAR, Free> { ptr };
|
||||
return URL (File (String (path.get())));
|
||||
};
|
||||
|
||||
if (isSave)
|
||||
|
|
@ -262,7 +266,12 @@ private:
|
|||
if (item == nullptr)
|
||||
return {};
|
||||
|
||||
return { URL (String (getUrl (*item).get())) };
|
||||
const auto url = getUrl (*item);
|
||||
|
||||
if (url.isEmpty())
|
||||
return {};
|
||||
|
||||
return { url };
|
||||
}
|
||||
|
||||
const auto dialog = [&]
|
||||
|
|
@ -298,7 +307,12 @@ private:
|
|||
items->GetItemAt (i, scope.resetAndGetPointerAddress());
|
||||
|
||||
if (scope != nullptr)
|
||||
result.add (String (getUrl (*scope).get()));
|
||||
{
|
||||
const auto url = getUrl (*scope);
|
||||
|
||||
if (! url.isEmpty())
|
||||
result.add (url);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue