[haiku-bugs] Re: [Haiku] #8556: [StyledEdit] increases window number even if previous one was closed

  • From: "axeld" <trac@xxxxxxxxxxxx>
  • Date: Tue, 02 Jul 2013 15:16:46 -0000

#8556: [StyledEdit] increases window number even if previous one was closed
---------------------------------------+----------------------------
   Reporter:  diver                    |      Owner:  leavengood
       Type:  bug                      |     Status:  assigned
   Priority:  normal                   |  Milestone:  R1
  Component:  Applications/StyledEdit  |    Version:  R1/Development
 Resolution:                           |   Keywords:
 Blocked By:                           |   Blocking:
Has a Patch:  1                        |   Platform:  All
---------------------------------------+----------------------------

Comment (by axeld):

 Thanks for your patch! There are a number of issues, though, most of the
 are coding style related:
 * a BWindow runs in its own thread, but you don't do any locking when
 accessing your list.
 * OnOpen() is not a good name, as it doesn't make a pair with OnQuit().
 Furthermore, those names don't feel like Be API. I would probably just go
 with AddWindow(), and RemoveWindow() instead.
 * Not sure if it makes sense to keep the class implementation in a header;
 this might be problematic with regards to localization (ie. instead of
 doing it automatically, the class depends on strings of the file that
 includes it).
 * a static member variable gets an 's' prefix.
 * '{' go to the end of the line.
 * Variable names like 't' and 'd' should be avoided.

 To get a better idea about our coding style, please have a look at
 https://www.haiku-os.org/development/coding-guidelines.

--
Ticket URL: <http://dev.haiku-os.org/ticket/8556#comment:15>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: