-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: Add NFD_OVERRIDE_RECENT_WITH_DEFAULT flag #152
Conversation
a5daec7
to
a9f57d7
Compare
I'm wondering if we should use a CMake build option (that sets a #define macro) instead. All other configuration options do that. |
I've never worked with CMake build options before, but would something like the most recent changes work? |
6884e26
to
b9491e6
Compare
b9491e6
to
5df9fda
Compare
Interestingly enough, in my team we were having the same discussion, where we want to be able to finely control the default directory when opening a directory. A cmake option would work in case this needs to be consistently done in one way or the other in the entirety of the application. Not sure if would be interesting to be able to control the behavior on a per-call basis. |
Sorry for the delays, I have been kinda busy over the past few weeks. Yeah, I was also thinking about having it on a per-call basis instead, which would be the more flexible thing to do, and better mirror the native API. (Note that the original This is also kinda related to the |
Thanks for the PR! I'm happy to merge this as is, since it seems pretty unlikely that someone would want to control the behaviour on a per-call basis, especially without |
Happy to contribute! 😄That sounds good to me 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks mostly good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, but can we say that it's a build option, so people who aren't too familiar with CMake won't think that they are compiler defines? Seems like the other two build options mentioned in the README say it more plainly, e.g. "add -DNFD_PORTAL=ON
to the build command".
Co-authored-by: Bernard Teo <[email protected]>
Co-authored-by: Bernard Teo <[email protected]>
Co-authored-by: Bernard Teo <[email protected]>
I think this should be good to go now. Note related to the discussion about controlling this on individual calls: I think even if we were to do something similar where we allow passing in a GUID, we would run into a similar issue, or we'd have to add a manual implementation for the other platforms as you mentioned. |
Co-authored-by: Bernard Teo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a final look later today and will merge it if it looks fine!
Co-authored-by: Bernard Teo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good!
Implements #151
Implemented using a cmake option with default value set to off.
src/CMakeLists.txt
nfd_win.cpp
And then when a downstream app wants to use this they can set the cmake build option to ON:
This makes it so that downstream apps don't need to make any changes to keep the existing behavior, and can just set the build option when they want to use the new behavior.
Screenshots showing the new functionality: