[haiku-commits] Re: r39148 - haiku/trunk/src/add-ons/input_server/filters/shortcut_catcher

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 28 Oct 2010 19:59:06 +0200

"Jonas Sundström" <jonas@xxxxxxxxxxx> wrote:
> Axel Dörfler "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx> wrote:
> > jonas@xxxxxxxxxxx wrote:
> > > + if (!fileEntry.Exists())
> > > +         BFile file(fFileName, B_READ_ONLY|B_CREATE_FILE);
> >
> > While this also introduces a style violation, why not also
> > monitoring its directory?
> > Creating files that aren't needed isn't really the way to go IMO.
> I understand your ideal, but I decided that I don't have that
> time right now, that this was good enough for now. It doesn't
> stop anybody from doing it better.

Understood, although using a BPathMonitor instead would also cover the
case when the file is removed. It's a lot easier to use than node
monitoring from a developer's point of view for most use cases.
A TODO comment would make sense in those cases where one introduces
work-arounds like this.

Bye,
   Axel.


Other related posts: