From 1ffca9bea22c4c57ea066b363dd2de6e5f07c169 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 24 Jun 2022 13:28:11 -0500 Subject: [PATCH] can you do the inverse --- extern/nfd-modified/src/nfd_cocoa.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extern/nfd-modified/src/nfd_cocoa.mm b/extern/nfd-modified/src/nfd_cocoa.mm index 5b5ee4cc..cb57e565 100644 --- a/extern/nfd-modified/src/nfd_cocoa.mm +++ b/extern/nfd-modified/src/nfd_cocoa.mm @@ -22,7 +22,7 @@ static NSArray *BuildAllowedFileTypes( const std::vector& filterLis // NSMutableArray *buildFilterList = NSMutableArray::alloc()->init(); NSMutableArray *buildFilterList = [[NSMutableArray alloc] init]; - String typebuf; + std::string typebuf; for (std::string& i: filterList) { typebuf=""; for (char& j: i) { @@ -30,7 +30,7 @@ static NSArray *BuildAllowedFileTypes( const std::vector& filterLis // or this: NSString::stringWithUTF8String(typebuf); // buildFilterList->addObject(thisType); // really? did you have to make this mess?! - NSString *thisType = [NSString stringWithUTF8String: [typebuf c_str]]; + NSString *thisType = NSString::stringWithUTF8String(typebuf.c_str()); [buildFilterList addObject:thisType]; typebuf=""; } else if (j!='.' && j!='*') { @@ -39,7 +39,7 @@ static NSArray *BuildAllowedFileTypes( const std::vector& filterLis } if (!typebuf.empty()) { // I don't think this will work, but come on... - NSString *thisType = [NSString stringWithUTF8String: [typebuf c_str]]; + NSString *thisType = NSString::stringWithUTF8String(typebuf.c_str()); [buildFilterList addObject:thisType]; } }