Opened 15 years ago
Closed 15 years ago
#5149 closed enhancement (fixed)
[Patch] Applying BGridLayout to Terminal preference
Reported by: | mt | Owned by: | jackburton |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications/Terminal | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Applying BGridLayout to BMenuFields in AppearPrefView.cpp.
Attachments (1)
Change History (6)
by , 15 years ago
Attachment: | terminal.patch added |
---|
follow-up: 3 comment:1 by , 15 years ago
Patch looks good to me, thanks for the cleanup as well! Note that the -> operators would go on the next line. I usually break up these lines with an open parenthesis. So instead of
fFont->Menu()-> FindItem(PrefHandler::Default()-> getString(PREF_HALF_FONT_FAMILY))->SetMarked(true);
I would do:
fFont->Menu()->FindItem(PrefHandler::Default()->getString( PREF_HALF_FONT_FAMILY))->SetMarked(true);
(Your version does have it's appeal because of clarity, but the other version seems to be preferred among most devs.)
comment:2 by , 15 years ago
BTW, I know the code was like that before and you just cleaned it up, but the defensive programmers version would be more like this:
BMenuItem* item = fFont->Menu()->FindItem( PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY)); if (item != NULL) item->SetMarked(true);
On the other hand, that would probably just hide an error elsewhere (mismatch of strings)... ;-)
comment:3 by , 15 years ago
Replying to stippi:
(Your version does have it's appeal because of clarity, but the other version seems to be preferred among most devs.)
Also very clear (even more so than the original version IMHO) and conforming to the style guide:
fFont->Menu()->FindItem(PrefHandler::Default()->getString( PREF_HALF_FONT_FAMILY)) ->SetMarked(true);
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Applied (with the change proposed by Ingo) in hrev34734. Thanks!
patch file