KDE/kdeedu/kstars/kstars/tools
Alexey Khudyakov <alexey.skladnoy <at> gmail.com>
2009-06-03 18:21:26 GMT
SVN commit 977267 by khudyakov:
Fix bug in batch mode of Planets module of Calculator. Objects were reference
when they went out of scope.
I suppose it wasn't noticed because batch mode feature is pretty unusable.
CCMAIL: kstars-devel <at> kde.org
M +11 -18 modcalcplanets.cpp
--- trunk/KDE/kdeedu/kstars/kstars/tools/modcalcplanets.cpp #977266:977267
@@ -466,28 +466,19 @@
KSPlanet Earth( kd, I18N_NOOP( "Earth" ));
Earth.findPosition( &num );
- KSPlanetBase *kspb;
+ // FIXME: allocate new object for every iteration is probably not wisest idea.
+ KSPlanetBase *kspb = 0 ;
if ( pn == "Pluto" ) {
- KSPluto ksp( kd );
- ksp.findPosition( &num, &latB, &LST, &Earth );
- ksp.EquatorialToHorizontal( &LST, &latB );
- kspb = (KSPlanetBase*)&ksp;
+ kspb = new KSPluto(kd);
} else if ( pn == "Sun" ) {
- KSSun ksp( kd );
- ksp.findPosition( &num, &latB, &LST, &Earth );
- ksp.EquatorialToHorizontal( &LST, &latB );
- kspb = (KSPlanetBase*)&ksp;
(Continue reading)