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

Prakash Mohan prak902000 at gmail.com
Sat May 30 07:01:59 CEST 2009


SVN commit 975396 by prakash:

Implementing the Saving and Loading of Session list with the user specified times.

CCMAIL: kstars-devel at kde.org


 M  +15 -2     observinglist.cpp  


--- branches/kstars/summer/kstars/kstars/tools/observinglist.cpp #975395:975396
@@ -829,6 +829,8 @@
                 SkyPoint p( ra, dc );
                 double maxrad = 1000.0/Options::zoomFactor();
                 o = ks->data()->skyComposite()->starNearest( &p, maxrad );
+            } else if ( line.startsWith( "Begin Hash" ) ) {
+                break;
             } else {
                 o = ks->data()->objectNamed( line );
             }
@@ -839,9 +841,15 @@
 
             if ( o ) slotAddObject( o, true );
         }
-
+        while ( ! istream.atEnd() ) {
+            line = istream.readLine();
+            QStringList hashdata = line.split(':');
+            TimeHash.insert( hashdata[0], QTime::fromString( hashdata[1], " hms ap" ) );
+        }
         //Newly-opened list should not trigger isModified flag
         isModified = false;
+        //Update the user set times from file
+        slotUpdate();
         f.close();
         
     } else if ( !fileURL.path().isEmpty() ) {
@@ -981,7 +989,12 @@
             ostream << o->name() << endl;
         }
     }
-
+    ostream << "Begin Hash"<<endl;
+    QHashIterator<QString, QTime> i(TimeHash);
+    while (i.hasNext()) {
+        i.next();
+        ostream << i.key() << ": " << i.value().toString("hms ap") << endl;
+    }
     f.close();
     isModified = false;
 }


More information about the Kstars-devel mailing list