[haiku-commits] Re: haiku: hrev49398 - src/kits/interface headers/os/interface

  • From: gus knight <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 14 Jul 2015 08:48:17 -0400

On Tue, Jul 14, 2015 at 2:49 AM, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:

Please don't add anymore friend classes. Instead, we use a Private class
that offers the private methods to other classes.
There are lots of examples in our code already, BRoster or BMessenger would
be such cases.

Ah, OK. I'll do that.

void
-BTab::Select(BView* owner)
+BTab::Select(BView*)


How about checking if the owner is still the one we think it is?

Yeah, I didn't realize that was needed. Adrien fixed it already for me, I see.


{
- // TODO: Shouldn't we still maintain fSelected like in Deselect()?
- if (!owner || !View() || !owner->Window())
+ fSelected = true;
+
+ if (!fTabView || !View())


== NULL, not !

I'll clean up the style of the whole file at the same time, I suppose.


+ if (!fTabView->ContainerView()->GetLayout() &&
View()->Parent() == NULL)

+ fTabView->AddChild(fView);

Stray tab. Also, == NULL, and I don't like that BTab is doing this -- this
is really outside of its scope; it shouldn't have to know how its parent
deals with this stuff.

That would make sense to me, except we have two systems inside
BTabView: the layout version, and the non-layout version.
Distinguishing between the two (or even having common code) is really
tricky and prone to mess things up (as I did here, which Adrien fixed
for me). I'd rather not try and change that pre-R2...

At any rate I'll add a TODO item to clean up BTab[View] once we break ABI.
-gus

Other related posts: