[Marble-devel] Review Request: Constellation Extension to Stars Plugin
Dennis Nienhüser
earthwings at gentoo.org
Tue Dec 4 10:37:37 UTC 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107571/#review22961
-----------------------------------------------------------
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.
src/plugins/render/stars/StarsPlugin.h
<http://git.reviewboard.kde.org/r/107571/#comment17539>
const QString &name, const QString &stars
for performance reasons
src/plugins/render/stars/StarsPlugin.h
<http://git.reviewboard.kde.org/r/107571/#comment17547>
The longer m_constellationsLoaded is easier to read.
src/plugins/render/stars/StarsPlugin.h
<http://git.reviewboard.kde.org/r/107571/#comment17540>
m_idMap
This looks quite c-ish. Can't we use a QVector<int> or a QMap<int,int> instead for example?
src/plugins/render/stars/StarsPlugin.cpp
<http://git.reviewboard.kde.org/r/107571/#comment17541>
Don't shorten code like this, please. Use the more verbose
if ( version >= 2 ) {
in >> id;
}
Same below.
src/plugins/render/stars/StarsPlugin.cpp
<http://git.reviewboard.kde.org/r/107571/#comment17542>
Add curly brackets, new line, please.
src/plugins/render/stars/StarsPlugin.cpp
<http://git.reviewboard.kde.org/r/107571/#comment17543>
Please remove or use a human friendly output.
src/plugins/render/stars/StarsPlugin.cpp
<http://git.reviewboard.kde.org/r/107571/#comment17545>
Wouldn't that interpret empty lines as EOF? What about using continue instead of break here, or checking for in.atEnd() explicitly?
src/plugins/render/stars/StarsPlugin.cpp
<http://git.reviewboard.kde.org/r/107571/#comment17544>
line.startsWith('#') is easier to read
src/plugins/render/stars/StarsPlugin.cpp
<http://git.reviewboard.kde.org/r/107571/#comment17546>
Our current code style suggests opening brackets within the same line, so the earlier version was correct in that sense.
src/plugins/render/stars/StarsPlugin.cpp
<http://git.reviewboard.kde.org/r/107571/#comment17548>
What about caching one of the two quaternions? Would spare half of the creations and rotations around skyAxisMatrix.
src/plugins/render/stars/StarsPlugin.cpp
<http://git.reviewboard.kde.org/r/107571/#comment17549>
Why not use it? If it's not needed, the pen creation could be removed above.
- Dennis Nienhüser
On Dec. 3, 2012, 11:56 p.m., Timothy Lanzi wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107571/
> -----------------------------------------------------------
>
> (Updated Dec. 3, 2012, 11:56 p.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/20121204/2b798738/attachment-0001.html>
More information about the Marble-devel
mailing list