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

Jason Harris kstars at 30doradus.org
Thu Jan 3 06:07:38 CET 2008


SVN commit 756311 by harris:

Compute angular size for the sun.
Correct object type for moon in detail dialog.

CCMAIL: kstars-devel at kde.org



 M  +7 -4      detaildialog.cpp  
 M  +4 -0      kssun.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/detaildialog.cpp #756310:756311
@@ -111,7 +111,7 @@
     QString pname, oname;
 
     switch ( selectedObject->type() ) {
-    case 0: //stars
+    case SkyObject::STAR:
         s = (StarObject *)selectedObject;
 
         Data->Names->setText( s->longname() );
@@ -151,15 +151,18 @@
 
         break; //end of stars case
 
-    case 9:  //asteroids [fall through to planets]
-    case 10: //comets [fall through to planets]
-    case 2:  //planets (including comets and asteroids)
+    case SkyObject::ASTEROID:  //[fall through to planets]
+    case SkyObject::COMET: //[fall through to planets]
+    case SkyObject::MOON: //[fall through to planets]
+    case SkyObject::PLANET:
         ps = (KSPlanetBase *)selectedObject;
 
         Data->Names->setText( ps->longname() );
         //Type is "G5 star" for Sun
         if ( ps->name() == "Sun" )
             Data->Type->setText( i18n("G5 star") );
+        else if ( ps->name() == "Moon" )
+            Data->Type->setText( ps->translatedName() );
         else
             Data->Type->setText( ps->typeName() );
 
--- trunk/KDE/kdeedu/kstars/kstars/kssun.cpp #756310:756311
@@ -22,6 +22,7 @@
 
 #include "ksutils.h"
 #include "ksnumbers.h"
+#include "kstarsdata.h"
 #include "kstarsdatetime.h"
 
 KSSun::KSSun( KStarsData *kd )
@@ -132,6 +133,9 @@
     //Determine the position angle
     findPA( num );
 
+    //Set the angular size in arcmin
+    setAngularSize( asin(physicalSize()/Rearth/AU_KM)*60.*180./dms::PI );
+
     return true;
 }
 


More information about the Kstars-devel mailing list