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

Akarsh Simha akarshsimha at gmail.com
Sun Jul 13 15:09:02 CEST 2008


SVN commit 831857 by asimha:

Replacing a QMap<int, long double> used to store the Julian Days of
conjunctions against the index in the output list by a 
QVector<long double>

CCMAIL: kstars-devel at kde.org



 M  +2 -5      conjunctions.cpp  
 M  +1 -1      conjunctions.h  


--- trunk/KDE/kdeedu/kstars/kstars/tools/conjunctions.cpp #831856:831857
@@ -105,7 +105,7 @@
 
 void ConjunctionsTool::slotGoto() {
     int index = OutputView->currentRow();
-    long double jd = outputJDList.value( index );
+    long double jd = outputJDList.at( index );
     KStarsDateTime dt;
     KStars *ks= (KStars *) topLevelWidget()->parent();
     KStarsData *data = KStarsData::Instance();
@@ -202,17 +202,14 @@
 
   KStarsDateTime dt;
   QMap<long double, dms>::Iterator it;
-  int i;
 
   OutputView->clear();
   outputJDList.clear();
-  i = 0;
 
   for(it = conjunctionlist.begin(); it != conjunctionlist.end(); ++it) {
     dt.setDJD( it.key() );
     OutputView -> addItem( i18n("Conjunction on %1 UT: Separation is %2", dt.toString("%a, %d %b %Y %H:%M"), it.data().toDMSString()) );
-    outputJDList.insert( i, it.key() );
-    ++i;
+    outputJDList.append( it.key() );
   }
 }
 
--- trunk/KDE/kdeedu/kstars/kstars/tools/conjunctions.h #831856:831857
@@ -61,7 +61,7 @@
     KSPlanetBase *Object2;        // Second object is always a planet.
     
     QHash<int, QString> pNames;   // To store the names of Planets vs. values expected by KSPlanetBase::createPlanet()
-    QMap<int, long double> outputJDList; // To store Julian Days corresponding to the row index in the output list widget
+    QVector<long double> outputJDList; // To store Julian Days corresponding to the row index in the output list widget
 
     void showConjunctions(QMap<long double, dms> conjunctionlist);
 


More information about the Kstars-devel mailing list