mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
impr: Handle macOS Open with... correctly
This commit is contained in:
@@ -283,4 +283,6 @@ namespace hex {
|
||||
return string.substr(0, maxLength - 3) + "...";
|
||||
}
|
||||
|
||||
std::optional<std::fs::path> getInitialFilePath();
|
||||
|
||||
}
|
||||
|
||||
@@ -502,8 +502,13 @@ namespace hex {
|
||||
return value;
|
||||
}
|
||||
|
||||
static std::optional<std::fs::path> fileToOpen;
|
||||
extern "C" void openFile(const char *path) {
|
||||
hex::EventManager::post<RequestOpenFile>(path);
|
||||
fileToOpen = path;
|
||||
}
|
||||
|
||||
std::optional<std::fs::path> getInitialFilePath() {
|
||||
return fileToOpen;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user