I reworked my patch according to your suggestions.
We already iterate over custom buttons and check every common button flag before this point, so it shouldn't be necessary to have another loop.
I'm open to suggestion, but how would you do that?
We could add three checks each time before taskdialog_init_button is
called,
or alternatively one check in taskdialog_init_button. Like giving it a
pointer
to default_button, and checking if the id equal the taskdialog default
button.
But I find my current solution to be cleaner to be honest, what's your suggestion?
Yes, something like that. taskdialog_init_button() has all the info to do that.
In the beginning I wanted to have default_button be -1 if no button was found yet, but as the tests show this is impossible since windows accepts a negative ID. Now we have to pass 2 pointers around.. Your thoughts on that? I find that the second loop makes things a lot cleaner.
Regards, Fabian Maurer
On 05.11.2017 18:46, Fabian Maurer wrote:
I reworked my patch according to your suggestions.
We already iterate over custom buttons and check every common button flag before this point, so it shouldn't be necessary to have another loop.
I'm open to suggestion, but how would you do that?
We could add three checks each time before taskdialog_init_button is
called,
or alternatively one check in taskdialog_init_button. Like giving it a
pointer
to default_button, and checking if the id equal the taskdialog default
button.
But I find my current solution to be cleaner to be honest, what's your suggestion?
Yes, something like that. taskdialog_init_button() has all the info to do that.
In the beginning I wanted to have default_button be -1 if no button was found yet, but as the tests show this is impossible since windows accepts a negative ID. Now we have to pass 2 pointers around.. Your thoughts on that? I find that the second loop makes things a lot cleaner.
I sent another version that doesn't touch helper interface and uses single variable to mark default button, with otherwise unchanged logic and tests.
Regards, Fabian Maurer