[haiku-bugs] Re: [Haiku] #3560: Have window status line indicate used disk space

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Thu, 23 Oct 2014 06:31:52 -0000

#3560: Have window status line indicate used disk space
------------------------------+---------------------------
   Reporter:  BeOSR           |      Owner:  stippi
       Type:  enhancement     |     Status:  new
   Priority:  normal          |  Milestone:  R1
  Component:  User Interface  |    Version:  R1/pre-alpha1
 Resolution:                  |   Keywords:
 Blocked By:                  |   Blocking:
Has a Patch:  0               |   Platform:  All
------------------------------+---------------------------

Comment (by pulkomandy):

 Hi,
 Some issues:
 * You must leave two blank lines between methods GetCountsandSize and Draw
 * GetCountAndSize should be named differently, because it doesn't "get"
 anything. Maybe UpdateCountAndSize ?
 * The method could also be made private (and in this case its name should
 start with an underscore).
 * entry.GetStat already gives you the stat info (StatStruct and struct
 stat are the same). You can get he file size from the st_size field in the
 struct, so there is no need for getting it from BFile.
 * The method should probably initialize fDirCount, fFileCount, and
 fTotalFilesSize to 0 before the loop. Otherwise calling it multiple times
 will lead to the wrong results.
 * If the model is not a directory, you will be using an uninitialized ref
 and tryng to get the list of files from it.
 * You can use a BMessagFormat such as "{0, plural, one{# file} other{#
 files}} (%size%)", then use BString.ReplaceFirst to replace the "%size%"
 with the size. This will allow people working on localization to use a
 different format if needed (maybe they need [] instead of (), for
 example). It also makes it clearer to them how the string will be used.
 * There seem to be a removal of a } in the patch that does not looks
 correct.

--
Ticket URL: <https://dev.haiku-os.org/ticket/3560#comment:9>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: