Opened 15 years ago
Closed 15 years ago
#4713 closed bug (fixed)
[Sounds] Wrong selected sounds
Reported by: | mpanasyuk | Owned by: | marcusoverhagen |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Preferences/Sounds | Version: | R1/pre-alpha1 |
Keywords: | Cc: | stimut@… | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
Select some sound for an event and then revert it by selecting <none> for this event. Previous sound will still be visible as selected.
Haiku R1/alpha1 (Revision 32975)
Attachments (1)
Change History (4)
follow-up: 2 comment:1 by , 15 years ago
Cc: | added |
---|
comment:2 by , 15 years ago
Replying to stimut:
This stems from a BString's '=' operator treating a NULL 'const char *' differently to one which is an empty string. That is, the BString's value does not change if the '=' operator is used with a NULL.
I've attached a small patch which fixes the problem in the Sounds preflet. My personal preference would be to change the implementation of BString to treat NULLs like empty strings, but that is quite a core component and I don't feel I have the authority to make that call (this being my first ever code contribution) :).
I agree with you. If there aren't any api compatibility problems with that change, I'd like to fix that problem in BString,
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in hrev34983. It changes the implementation of BString as suggested and verified against Dano.
A bit more detail on how to produce the error:
At this point the list of sounds will still correctly say <none> for the sound, but the popup/drop-down (whatever it's called) will display the last selected file.
This stems from a BString's '=' operator treating a NULL 'const char *' differently to one which is an empty string. That is, the BString's value does not change if the '=' operator is used with a NULL.
I've attached a small patch which fixes the problem in the Sounds preflet. My personal preference would be to change the implementation of BString to treat NULLs like empty strings, but that is quite a core component and I don't feel I have the authority to make that call (this being my first ever code contribution) :).