mirror of
https://github.com/WerWolv/ImHex
synced 2024-10-20 17:52:41 +00:00
fix: Opening files on macOS through the Open with...
option
Fixes #1070
This commit is contained in:
parent
85ec807417
commit
75c03d56d2
|
@ -679,6 +679,7 @@ namespace hex {
|
|||
|
||||
static std::optional<std::fs::path> fileToOpen;
|
||||
extern "C" void openFile(const char *path) {
|
||||
log::info("Opening file: {0}", path);
|
||||
fileToOpen = path;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,10 @@
|
|||
NSString* urlString = [url absoluteString];
|
||||
const char* utf8String = [urlString UTF8String];
|
||||
|
||||
const char *prefix = "file://";
|
||||
if (strncmp(utf8String, prefix, strlen(prefix)) == 0)
|
||||
utf8String += strlen(prefix);
|
||||
|
||||
openFile(utf8String);
|
||||
|
||||
return YES;
|
||||
|
|
Loading…
Reference in a new issue