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

Prakash Mohan prak902000 at gmail.com
Sat May 30 13:46:38 CEST 2009


SVN commit 975471 by prakash:

Implementing loading and saving of Geographic Location also when the session list is saved.

CCMAIL: kstars-devel at kde.org


 M  +7 -2      observinglist.cpp  


--- branches/kstars/summer/kstars/kstars/tools/observinglist.cpp #975470:975471
@@ -816,6 +816,10 @@
         QTextStream istream(&f);
         QString line;
         SessionName = istream.readLine();
+        line = istream.readLine();
+        QStringList fields = line.split('~');
+        geo = ks->data()->locationNamed(fields[0],fields[1],fields[2]);
+        ui->SetLocation -> setText( geo -> fullName() );
 
         while ( ! istream.atEnd() ) {
             line = istream.readLine();
@@ -846,10 +850,10 @@
             QStringList hashdata = line.split(':');
             TimeHash.insert( hashdata[0], QTime::fromString( hashdata[1], " hms ap" ) );
         }
+        //Update the location and user set times from file
+        slotUpdate();
         //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() ) {
@@ -974,6 +978,7 @@
     }
     QTextStream ostream(&f);
     ostream << SessionName << endl;
+    ostream << geo->name() << "~" <<geo->province() << "~" << geo->country() << endl;
     foreach ( SkyObject* o, SessionList() ) {
         if ( o->name() == "star" ) {
             ostream << o->name() << "  " << o->ra()->Hours() << "  " << o->dec()->Degrees() << endl;


More information about the Kstars-devel mailing list