[Kstars-devel] KDE/kdeedu/kstars/kstars/tools
Jason Harris
kstars at 30doradus.org
Fri Dec 7 02:49:16 CET 2007
SVN commit 745776 by harris:
Fix crash in modcalcvizequinox. modCalcEquinox is not the parent of the
plot widget, it's the parent's parent's parent's parent. How did this
code ever work?
Also fixed string formatting.
CCMAIL: kstars-devel at kde.org
M +2 -1 eqplotwidget.cpp
M +4 -4 modcalcvizequinox.cpp
M +1 -1 modcalcvizequinox.ui
--- trunk/KDE/kdeedu/kstars/kstars/tools/eqplotwidget.cpp #745775:745776
@@ -17,6 +17,7 @@
#include "eqplotwidget.h"
#include <QPainter>
+#include <kdebug.h>
#include "kstarsdatetime.h"
#include "modcalcvizequinox.h"
@@ -32,7 +33,7 @@
QPainter p;
p.begin(this);
- modCalcEquinox *mc = (modCalcEquinox*)parent();
+ modCalcEquinox *mc = (modCalcEquinox*)(parent()->parent()->parent()->parent());
KStarsDateTime dt( QDate(mc->Year->value(), 1, 1), QTime(0,0,0) );
long double jd0 = dt.djd(); //save JD on Jan 1st
--- trunk/KDE/kdeedu/kstars/kstars/tools/modcalcvizequinox.cpp #745775:745776
@@ -201,10 +201,10 @@
dWinter = findSolstice( Year->value(), false );
//Display the Date/Time of each event in the text fields
- VEquinox->setText( dSpring.toString() );
- SSolstice->setText( dSummer.toString() );
- AEquinox->setText( dAutumn.toString() );
- WSolstice->setText( dWinter.toString() );
+ VEquinox->setText( dSpring.toString("%d %b %Y %H:%M") );
+ SSolstice->setText( dSummer.toString("%d %b %Y %H:%M") );
+ AEquinox->setText( dAutumn.toString("%d %b %Y %H:%M") );
+ WSolstice->setText( dWinter.toString("%d %b %Y %H:%M") );
//Add vertical dotted lines at times of the equinoxes and solstices
KPlotObject *poSpring = new KPlotObject( Qt::white, KPlotObject::Lines, 1 );
--- trunk/KDE/kdeedu/kstars/kstars/tools/modcalcvizequinox.ui #745775:745776
@@ -16,7 +16,7 @@
<item>
<widget class="QTabWidget" name="tabWidget" >
<property name="currentIndex" >
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="tab" >
<attribute name="title" >
More information about the Kstars-devel
mailing list