[Marble-devel] Review Request: Constellation Extension to Stars Plugin

Timothy Lanzi trlanzi at gmail.com
Wed Dec 5 03:41:59 UTC 2012



> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > Great work, this will become an eye-catcher :-)
> > 
> > You're deviating from the Marble code style at some points which make the code harder to read in the long run. I marked some points. In general please respect (taken from the CODING file in Marble's sources and kdelibs coding style policy):
> >  - opening braces at end of line (except struct, class, functions and
> >    namespaces)
> >  - as little abbreviation in variable names as possible
> >  - one variable declaration per line
> >  - whitespace after control statements
> >  - Use curly braces even when the body of a conditional statement contains only one line.
> >

Applied:
astyle --indent=spaces=4 --brackets=linux \
       --indent-labels --pad-oper --unpad-paren --pad-header \
       --keep-one-line-statements --convert-tabs \
       --indent-preprocessor

To cpp and h file to bring code in line. This came from techbase code style page. This will be in next diff submitted. 


> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > src/plugins/render/stars/StarsPlugin.h, line 75
> > <http://git.reviewboard.kde.org/r/107571/diff/1/?file=97135#file97135line75>
> >
> >     const QString &name, const QString &stars
> >     
> >     for performance reasons

Fixed in diff rev 2.


> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > src/plugins/render/stars/StarsPlugin.h, line 166
> > <http://git.reviewboard.kde.org/r/107571/diff/1/?file=97135#file97135line166>
> >
> >     The longer m_constellationsLoaded is easier to read.
> >

Fixed in diff rev 2.


> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > src/plugins/render/stars/StarsPlugin.h, line 169
> > <http://git.reviewboard.kde.org/r/107571/diff/1/?file=97135#file97135line169>
> >
> >     m_idMap
> >     
> >     This looks quite c-ish. Can't we use a QVector<int> or a QMap<int,int> instead for example?
> >

This is above me right now but I'll see what I can do.


> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > src/plugins/render/stars/StarsPlugin.cpp, line 150
> > <http://git.reviewboard.kde.org/r/107571/diff/1/?file=97136#file97136line150>
> >
> >     Don't shorten code like this, please. Use the more verbose
> >     
> >     if ( version >= 2 ) {
> >       in >> id;
> >     }
> >     
> >     Same below.

Fixed in diff rev 2.


> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > src/plugins/render/stars/StarsPlugin.cpp, line 162
> > <http://git.reviewboard.kde.org/r/107571/diff/1/?file=97136#file97136line162>
> >
> >     Add curly brackets, new line, please.

Fixed in diff rev 2.


> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > src/plugins/render/stars/StarsPlugin.cpp, line 174
> > <http://git.reviewboard.kde.org/r/107571/diff/1/?file=97136#file97136line174>
> >
> >     Please remove or use a human friendly output.

This was in the original code, but I removed it.


> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > src/plugins/render/stars/StarsPlugin.cpp, line 192
> > <http://git.reviewboard.kde.org/r/107571/diff/1/?file=97136#file97136line192>
> >
> >     Wouldn't that interpret empty lines as EOF? What about using continue instead of break here, or checking for in.atEnd() explicitly?
> >

Fixed in diff rev 2.


> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > src/plugins/render/stars/StarsPlugin.cpp, line 197
> > <http://git.reviewboard.kde.org/r/107571/diff/1/?file=97136#file97136line197>
> >
> >     line.startsWith('#') is easier to read

Fixed in diff rev 2.


> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > src/plugins/render/stars/StarsPlugin.cpp, line 230
> > <http://git.reviewboard.kde.org/r/107571/diff/1/?file=97136#file97136line230>
> >
> >     Our current code style suggests opening brackets within the same line, so the earlier version was correct in that sense.
> >

OK. This should be OK with the astyle command I used.


> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > src/plugins/render/stars/StarsPlugin.cpp, line 349
> > <http://git.reviewboard.kde.org/r/107571/diff/1/?file=97136#file97136line349>
> >
> >     What about caching one of the two quaternions? Would spare half of the creations and rotations around skyAxisMatrix.
> >

I wasn't sure how this would work with the new blank/dash line function.


> On Dec. 4, 2012, 10:37 a.m., Dennis Nienhüser wrote:
> > src/plugins/render/stars/StarsPlugin.cpp, line 415
> > <http://git.reviewboard.kde.org/r/107571/diff/1/?file=97136#file97136line415>
> >
> >     Why not use it? If it's not needed, the pen creation could be removed above.
> >

I was playing around with the label color this was left in by mistake.


- Timothy


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107571/#review22961
-----------------------------------------------------------


On Dec. 5, 2012, 3:34 a.m., Timothy Lanzi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107571/
> -----------------------------------------------------------
> 
> (Updated Dec. 5, 2012, 3:34 a.m.)
> 
> 
> Review request for Marble.
> 
> 
> Description
> -------
> 
> Constellation extension to stars plugin. 
> Extended stars plugin to read constellation.dat file and draw constellation lines/labels. 
> 
> 
> Diffs
> -----
> 
>   data/stars/constellations.dat PRE-CREATION 
>   data/stars/stars.dat 14a0723 
>   src/plugins/render/stars/StarsPlugin.h 6aeebf5 
>   src/plugins/render/stars/StarsPlugin.cpp 1bced5e 
>   tools/stars/stars.cpp 1542092 
> 
> Diff: http://git.reviewboard.kde.org/r/107571/diff/
> 
> 
> Testing
> -------
> 
> Basic operational testing. Plugin compiles without warning and runs with the data files supplied.
> 
> 
> Thanks,
> 
> Timothy Lanzi
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20121205/4c294225/attachment-0001.html>


More information about the Marble-devel mailing list