Add support for application:openFile:#26
Add support for application:openFile:#26mrmekon merged 4 commits intomrmekon:masterfrom jorgenpt:open-file-support
Conversation
|
Sorry for the delay! Please drop the formatting commit, and I'll merge, looks good to me. I still prefer without rustfmt, but even if I'm convinced the reformatting should be in a dedicated PR to avoid mixing with new features. I know I'm the weirdo here, but I just dislike auto-formatters :( |
This plumbs through a callback for application:openFile: -- allowing an application to register for file types. Fixes GH-25.
This is a helper to convert `NSString` Objects into Rust `String`, so that it's easy to parse the parameter passed to application:openFile:
Make it so that you can drag & drop a file to the Dock icon of register_url to have it log a line and terminate.
Adding a non-macOS shim for `nsstring_to_string` will allow this crate and the examples to build on non-macOS platforms.
|
Ok, I've dropped the reformatting commit! I can understand disagreeing with the auto formatter. FWIW I think in this situation the main benefit is lowering the barrier to entry for new contributors, and helping multiple contributors stay consistent with formatting (and removing the need for complicated documentation about what the expected formatting is). I will certainly defer to your preference on formatting for your project. :) |
|
Thanks! Yep, if other projects start depending on it and outside contributions become common, I'm certainly open to reformatting. At the moment, this is just a personal dependency for a personal project that a few other people have poked at a couple of times, so changing it all around burdens me a bit more than it helps others. Maybe that will change :) |
Now that mrmekon/fruitbasket#26 has been merged, switch the fruitbasket dependency to mrmekon/fruitbasket's mainline, rather than using our own branch.
This should address GH-25, which is also needed by https://github.com/jorgenpt/bichrome which wants to pretend to be a browser and wants to register for HTML files being opened from the filesystem.
It wasn't clear from #15 what the desired path was regarding auto-formatting, so I've included a separate commit in this pull request which applies
rustfmtformatting to the files touched by subsequent commits. Let me know if you want me to attempt to disable autoformatting in my IDE and re-do the changes without touching the formatting.