[haiku-commits] Re: r40373 - haiku/trunk/src/preferences/filetypes

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 07 Feb 2011 21:14:11 +0100

"Stephan Assmus" <superstippi@xxxxxx> wrote:
> Von: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
> > superstippi@xxxxxx wrote:
> > > +         rightWeight = 1.0 - leftWeight;
> > > + }
> > > + fMainSplitView->SetItemWeight(0, leftWeight, false);
> > > + fMainSplitView->SetItemWeight(1, rightWeight, true);
> > Since they will always add to 1, why do you have to remember and
> > set
> > them both?
> That's what I did at first, but in fact I don't know how those weights
> work and
> if they always add up to 1 after setting weights with the mouse. It's
> somewhat
> transparent to BSplitView. The way I do it now is robust against any
> surprises.

Hm, feels a bit like controlling the chaos :-)
How weights are implemented always depends on the view in question (for
example, in a layout, it's the programmer's job to divide the weights
completely). I haven't looked at the split view, but I would expect it
to work the way that the weights add up to 1.
Maybe we should start documenting that stuff, so one is not always
forced to look into the code.

> > >                           if (which == B_MIME_TYPE_DELETED
> > >                                   || which == B_SUPPORTED_TYPES_CHANGED
> > > -                                 || which == B_PREFERRED_APP_CHANGED)
> > > +                                 || which == B_PREFERRED_APP_CHANGED) {
> > >                                   _UpdatePreferredApps(&fCurrentType);
> > > +                         }
> > BTW we still never decided to do that, and I would prefer us to do
> > so
> > officially before changes like this are made.
> What's needed for officially deciding this? I guess I've presented my
> arguments
> already.

Well, more than just your opinion, I'm afraid :-)
Just put it on the menu in the development list, and if either no one
cares, or there is a cleaar majority, there we can just adopt it.

> And to be perfectly honest, I thought I saw you point out a coding
> style violation
> to someone very recently about some if-clause becomming a multi-line
> statement
> and needing braces. It was proabably a slightly different situation,
> but that's just
> my point, the rules are simpler with less exceptions.

There is no exception, you just interprete the multi-line statement
differently than what it actually is; only the body counts as a new
statement, not the if-clause itself.
In any case, there is no point in warming that old discussion up again,
we already had that a few months ago. And I thought I would be getting
old... :-)

Bye,
   Axel.


Other related posts: