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

Jason Harris kstars at 30doradus.org
Wed Dec 19 17:38:38 CET 2007


SVN commit 750584 by harris:

Fix for modCalcAltAz (LST was not getting defined)

CCMAIL: kstars-devel at kde.org



 M  +8 -5      modcalcaltaz.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/tools/modcalcaltaz.cpp #750583:750584
@@ -36,18 +36,20 @@
         : QFrame(parentSplit), horInputCoords(false) {
     setupUi(this);
 
+    KStars *ks = ((KStars*) topLevelWidget()->parent());
+    RA->setDegType(false);
+
     //Initialize Date/Time and Location data
-    KStars *ks = ((KStars*) topLevelWidget()->parent());
-    DateTime->setDateTime( ks->data()->lt().dateTime() );
     geoPlace = ks->geo();
     LocationButton->setText( geoPlace->fullName() );
 
-    RA->setDegType(false);
+    //Make sure slotDateTime() gets called, so that LST will be set
+    connect(DateTime, SIGNAL(dateTimeChanged(const QDateTime&)), this, SLOT(slotDateTimeChanged(const QDateTime&)));
+    DateTime->setDateTime( ks->data()->lt().dateTime() );
 
     connect(NowButton, SIGNAL(clicked()), this, SLOT(slotNow()));
     connect(LocationButton, SIGNAL(clicked()), this, SLOT(slotLocation()));
     connect(ObjectButton, SIGNAL(clicked()), this, SLOT(slotObject()));
-    connect(DateTime, SIGNAL(dateTimeChanged(const QDateTime&)), this, SLOT(slotDateTimeChanged(const QDateTime&)));
 
     connect(RA,  SIGNAL(editingFinished()), this, SLOT(slotCompute()));
     connect(Dec, SIGNAL(editingFinished()), this, SLOT(slotCompute()));
@@ -104,7 +106,8 @@
 
 void modCalcAltAz::slotDateTimeChanged(const QDateTime &dt)
 {
-    LST = geoPlace->GSTtoLST( ((KStarsDateTime)dt).gst() );
+    KStarsDateTime ut = geoPlace->LTtoUT( KStarsDateTime( dt ) );
+    LST = geoPlace->GSTtoLST( ut.gst() );
 }
 
 void modCalcAltAz::slotCompute()


More information about the Kstars-devel mailing list