[Kstars-devel] branches/kstars/summer/kstars/kstars

Prakash Mohan prak902000 at gmail.com
Sat Jul 25 01:01:54 CEST 2009


SVN commit 1002096 by prakash:

Implementing the loading of the target lists in a cleaner manner. The OL handles the adding to the list part instead of the Log class directly adding them.

CCMAIL: kstars-devel at kde.org


 M  +4 -3      comast/log.cpp  
 M  +6 -0      comast/log.h  
 M  +6 -0      tools/observinglist.cpp  


--- branches/kstars/summer/kstars/kstars/comast/log.cpp #1002095:1002096
@@ -560,12 +560,12 @@
                 if( name != "star" ) {
                     o = ks->data()->objectNamed( name );
                     if( ! o ) o = ks->data()->skyComposite()->findStarByGenetiveName( name );
-                    if( o ) ks->observingList()->slotAddObject( o, true );
+                    if( o ) targetList()->append( o );
                 }
             } else if( reader->name() == "time" ) {
                 time = reader->readElementText();
                 if( o )
-                    ks->observingList()->setTime( o, QTime::fromString( time, "h:mm:ss AP" ) );
+                    TimeHash.insert( o->name(), QTime::fromString( time, "h:mm:ss AP" ) );
             } else if( reader->name() == "notes" ) {
                 notes = reader->readElementText();
                 if( o )
@@ -862,7 +862,8 @@
                 readUnknownElement();
         }
     }
-    ks->observingList()->setGeoDate( name, province, country, date );
+    geo = ks->data()->locationNamed( name, province, country );
+    dt.setDate( QDate::fromString( date, "ddMMyyyy" ) );
 }
 
 Comast::Observer* Comast::Log::findObserverByName( QString id ) {
--- branches/kstars/summer/kstars/kstars/comast/log.h #1002095:1002096
@@ -103,6 +103,9 @@
         Comast::Lens* findLensByName( QString id );
         Comast::Filter* findFilterByName( QString id );
         Comast::Observation* findObservationByName( QString id );
+        QHash<QString, QTime> timeHash() { return TimeHash; }
+        KStarsDateTime dateTime() { return dt; }
+        GeoLocation* geoLocation() { return geo; }
     private:
         QList<SkyObject *> m_targetList;
         QList<Comast::Observer *> m_observerList;
@@ -121,5 +124,8 @@
         KStars *ks;
         QXmlStreamWriter *writer;
         QXmlStreamReader *reader;
+        QHash<QString, QTime> TimeHash;
+        KStarsDateTime dt;
+        GeoLocation *geo;
 };
 #endif
--- branches/kstars/summer/kstars/kstars/tools/observinglist.cpp #1002095:1002096
@@ -862,6 +862,12 @@
         input = istream.readAll();
         Comast::Log logObject;
         logObject.readBegin( input );
+        //Set the New TimeHash
+        TimeHash = logObject.timeHash();
+        geo = logObject.geoLocation();
+        dt = logObject.dateTime();
+        foreach( SkyObject *o, *( logObject.targetList() ) )
+            slotAddObject( o, true );
         //Update the location and user set times from file
         slotUpdate();
         //Newly-opened list should not trigger isModified flag


More information about the Kstars-devel mailing list