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

Prakash Mohan prak902000 at gmail.com
Wed Jul 22 06:33:41 CEST 2009


SVN commit 1000808 by prakash:

Adding findByName functions to all the lists. This is required while writing logs, to get the object fromt the currentText() of comboBoxes.

CCMAIL: kstars-devel at kde.org


 M  +56 -0     log.cpp  
 M  +9 -0      log.h  


--- branches/kstars/summer/kstars/kstars/comast/log.cpp #1000807:1000808
@@ -861,3 +861,59 @@
     }
     ks->observingList()->setGeoDate( name, province, country, date );
 }
+
+Comast::Observer* Comast::Log::findObserverByName( QString id ) {
+    foreach( Comast::Observer *obs, *observerList() )
+        if( obs->name() == id )
+            return obs;
+    return NULL;
+}
+
+Comast::Session* Comast::Log::findSessionByName( QString id ) {
+    foreach( Comast::Session *s, *sessionList() )
+        if( s->id()  == id )
+            return s;
+    return NULL;
+}
+
+Comast::Site* Comast::Log::findSiteByName( QString name ) {
+    foreach( Comast::Site *s, *siteList() )
+        if( s->name()  == name )
+            return s;
+    return NULL;
+}
+
+Comast::Scope* Comast::Log::findScopeByName( QString id ) {
+    foreach( Comast::Scope *s, *scopeList() )
+        if( s->id()  == id )
+            return s;
+    return NULL;
+}
+
+Comast::Eyepiece* Comast::Log::findEyepieceByName( QString id ) {
+    foreach( Comast::Eyepiece *e, *eyepieceList() )
+        if( e->id()  == id )
+            return e;
+    return NULL;
+}
+
+Comast::Filter* Comast::Log::findFilterByName( QString id ) {
+    foreach( Comast::Filter *f, *filterList() )
+        if( f->id()  == id )
+            return f;
+    return NULL;
+}
+
+Comast::Lens* Comast::Log::findLensByName( QString id ) {
+    foreach( Comast::Lens *l, *lensList() )
+        if( l->id()  == id )
+            return l;
+    return NULL;
+}
+
+Comast::Observation* Comast::Log::findObservationByName( QString id ) {
+    foreach( Comast::Observation *o, *observationList() )
+        if( o->id()  == id )
+            return o;
+    return NULL;
+}
--- branches/kstars/summer/kstars/kstars/comast/log.h #1000807:1000808
@@ -60,6 +60,7 @@
         inline QList<Comast::Lens *> *lensList() { return &m_lensList; }
         inline QList<Comast::Filter *> *filterList() { return &m_filterList; }
         inline QList<Comast::Observation *> *observationList() { return &m_observationList; }
+        inline QList<Comast::Observer *> *observerList() { return &m_observerList; }
         void writeObserver( Comast::Observer *o );
         void writeSite( Comast::Site *s );
         void writeSession( Comast::Session *s );
@@ -94,6 +95,14 @@
         void readPosition();
         void readGeoDate();
         QString readResult();
+        Comast::Observer* findObserverByName( QString id );
+        Comast::Site* findSiteByName( QString id );
+        Comast::Session* findSessionByName( QString id );
+        Comast::Scope* findScopeByName( QString id );
+        Comast::Eyepiece* findEyepieceByName( QString id );
+        Comast::Lens* findLensByName( QString id );
+        Comast::Filter* findFilterByName( QString id );
+        Comast::Observation* findObservationByName( QString id );
     private:
         QList<SkyObject *> m_targetList;
         QList<Comast::Observer *> m_observerList;


More information about the Kstars-devel mailing list