[haiku-bugs] Re: [Haiku] #9012: Add disk device name

  • From: "axeld" <trac@xxxxxxxxxxxx>
  • Date: Fri, 30 Nov 2012 20:22:54 -0000

#9012: Add disk device name
---------------------------------------+----------------------------
   Reporter:  dsjonny                  |      Owner:  stippi
       Type:  enhancement              |     Status:  new
   Priority:  normal                   |  Milestone:  R1
  Component:  Applications/DriveSetup  |    Version:  R1/Development
 Resolution:                           |   Keywords:
 Blocked By:                           |   Blocking:
Has a Patch:  0                        |   Platform:  All
---------------------------------------+----------------------------

Comment (by axeld):

 Thanks for the patch, dsjonny -- as you might have noticed already, a part
 of it made it into hrev44929 by accident. That part of your original patch
 was not correct, as you would have overwritten the actual volume in case
 the raw device contained a file system directly.

 Also, the '{' go to the end of the line, not in a new line. It's always a
 good idea not to let your code additions stick out in any way. It's an
 even better idea to read our coding style guide, though, and make your
 code follow that one :-)

 Anyway, the other part of your patch duplicates a lot of lines that
 shouldn't be duplicated: only the name changed, the rest of the code stays
 the same.

 Ie. the code could look like this instead:
 {{{
 const char* name;
 if (partition->Name() != NULL && partition->Name()[0] != '\0')
         name = partition->Name();
 else
         name = B_TRANSLATE("Device");
 }}}

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

Other related posts: