macOS APIs are really really bonkers
This commit is contained in:
parent
4584d5ce47
commit
0e3a193db6
1 changed files with 2 additions and 6 deletions
|
|
@ -1669,14 +1669,10 @@ - (BOOL) prepareForDragOperation:(id<NSDraggingInfo>) sender {
|
||||||
static void
|
static void
|
||||||
create_uri_list(_GLFWDropData *d, NSArray *urls) {
|
create_uri_list(_GLFWDropData *d, NSArray *urls) {
|
||||||
NSMutableArray<NSString *> *items = [NSMutableArray array];
|
NSMutableArray<NSString *> *items = [NSMutableArray array];
|
||||||
NSCharacterSet *c1 = [NSCharacterSet URLQueryAllowedCharacterSet];
|
NSCharacterSet *allowedChars = [NSCharacterSet URLQueryAllowedCharacterSet];
|
||||||
NSCharacterSet *c2 = [NSCharacterSet URLPathAllowedCharacterSet];
|
|
||||||
for (NSURL *url in urls) {
|
for (NSURL *url in urls) {
|
||||||
NSCharacterSet *allowedChars = c1;
|
NSCharacterSet *allowedChars = c1;
|
||||||
if ([url isFileURL]) {
|
if ([url isFileURL]) url = [url filePathURL];
|
||||||
url = [url filePathURL];
|
|
||||||
allowedChars = c2;
|
|
||||||
}
|
|
||||||
NSString *absoluteString = url.absoluteString;
|
NSString *absoluteString = url.absoluteString;
|
||||||
NSString *q = [absoluteString stringByAddingPercentEncodingWithAllowedCharacters:allowedChars];
|
NSString *q = [absoluteString stringByAddingPercentEncodingWithAllowedCharacters:allowedChars];
|
||||||
[items addObject:q];
|
[items addObject:q];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue