[Kstars-devel] KDE/kdeedu/kstars/kstars

Akarsh Simha akarshsimha at gmail.com
Wed Oct 15 12:27:13 CEST 2008


SVN commit 871618 by asimha:

Fixing some of the potential bugs and bad code that annma pointed out.

I'm not sure if the Q_ASSERT is the right way to solve the polyList
problem, but I think we expect the polyList to be created before that
point in execution where it is accessed.

CCMAIL: kstars-devel at kde.org



 M  +2 -3      kswizard.cpp  
 M  +4 -0      skycomponents/constellationboundarylines.cpp  
 M  +1 -1      skycomponents/starblock.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/kswizard.cpp #871617:871618
@@ -150,7 +150,6 @@
 }
 
 void KSWizard::slotChangeCity() {
-    Geo = 0L;
 
     if ( location->CityListBox->currentItem() >= 0 ) {
         for ( int i=0; i < filteredCityList.size(); ++i ) {
@@ -159,10 +158,10 @@
                 break;
             }
         }
+        location->LongBox->showInDegrees( Geo->lng() );
+        location->LatBox->showInDegrees( Geo->lat() );
     }
 
-    location->LongBox->showInDegrees( Geo->lng() );
-    location->LatBox->showInDegrees( Geo->lat() );
 }
 
 void KSWizard::slotFilterCities() {
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/constellationboundarylines.cpp #871617:871618
@@ -126,6 +126,10 @@
         }
 
         // always add the point to the boundary (and toss dupes)
+
+        // By the time we come here, we should have polyList. Else we aren't doing good
+        Q_ASSERT( polyList ); // Is this the right fix?
+
         polyList->append( QPointF( ra, dec ) );
         if ( ra < 0 ) polyList->wrapRA( true );
 
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/starblock.cpp #871617:871618
@@ -75,7 +75,7 @@
         newStarObject = (StarObject *) malloc( sizeof( StarObject ) );
         if( !newStarObject )
             return i;
-        memcpy( newStarObject, &plainStarTemplate, sizeof( StarObject ) );
+        memcpy( newStarObject, plainStarTemplate, sizeof( StarObject ) );
         stars.append( newStarObject );
     }
     return nstars;


More information about the Kstars-devel mailing list