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

Prakash Mohan prak902000 at gmail.com
Sun Jun 7 15:41:32 CEST 2009


SVN commit 978541 by prakash:

Merging changes from trunk into the branch.

CCMAIL: kstars-devel at kde.org


 M  +2 -2      kstarsactions.cpp  
 M  +2 -2      kstarsinit.cpp  
 M  +19 -3     skyobjects/skypoint.h  
 M  +22 -40    tools/modcalcplanets.cpp  


--- branches/kstars/summer/kstars/kstars/kstarsactions.cpp #978540:978541
@@ -1010,9 +1010,9 @@
 
                 if ( fields.count() == 4 || fields.count() == 5 ) {
                     QString nm = fields[0].trimmed();
-                    KToggleAction *kta = actionCollection()->add<KToggleAction>( nm.toUtf8() );
+                    KToggleAction *kta = actionCollection()->add<KToggleAction>( nm );
                     kta->setText( nm );
-                    kta->setObjectName( nm.toUtf8() );
+                    kta->setObjectName( nm );
                     kta->setActionGroup( fovGroup );
                     connect( kta, SIGNAL( toggled(bool) ), this, SLOT( slotTargetSymbol() ) );
                     if ( nm == Options::fOVName() ) kta->setChecked( true );
--- branches/kstars/summer/kstars/kstars/kstarsinit.cpp #978540:978541
@@ -545,11 +545,11 @@
 
             if ( fields.count() == 4 || fields.count() == 5 ) {
                 nm = fields[0].trimmed();
-                KToggleAction *kta = actionCollection()->add<KToggleAction>( nm.toUtf8() );
+                KToggleAction *kta = actionCollection()->add<KToggleAction>( nm );
                 kta->setText( nm );
                 connect( kta, SIGNAL( toggled( bool ) ), this, SLOT( slotTargetSymbol() ) );
 
-                kta->setObjectName( nm.toUtf8() );
+                kta->setObjectName( nm );
                 kta->setActionGroup( fovGroup );
                 if ( nm == Options::fOVName() ) kta->setChecked( true );
                 fovActionMenu->addAction( kta );
--- branches/kstars/summer/kstars/kstars/skyobjects/skypoint.h #978540:978541
@@ -54,21 +54,37 @@
     	*@param r Right Ascension
     	*@param d Declination
     	*/
-    SkyPoint( const dms& r, const dms& d ) { set( r, d ); }
+    SkyPoint( const dms& r, const dms& d ) :
+        RA0(r), Dec0(d),
+        RA(r),  Dec(d)
+    {
+        syncQuaternion();
+    }
 
     /**Alternate constructor using pointer arguments, for convenience.
     	*It behaves essentially like the default constructor.
     	*@param r Right Ascension pointer
     	*@param d Declination pointer
     	*/
-    SkyPoint( const dms *r, const dms *d ) { set( dms(*r), dms(*d) ); }
+    SkyPoint( const dms *r, const dms *d ) :
+        RA0(*r), Dec0(*d),
+        RA(*r),  Dec(*d)
+    {
+        syncQuaternion();
+    }
 
     /**Alternate constructor using double arguments, for convenience.
     	*It behaves essentially like the default constructor.
     	*@param r Right Ascension, expressed as a double
     	*@param d Declination, expressed as a double
     	*/
-    explicit SkyPoint( double r=0.0, double d=0.0 ) { set( r, d ); }
+    //FIXME: this (*15.0) thing is somewhat hacky.
+    explicit SkyPoint( double r=0.0, double d=0.0 ) :
+        RA0(r*15.0), Dec0(d),
+        RA(r*15.0),  Dec(d)
+    {
+        syncQuaternion();
+    }
 
     /**
     	*Empty destructor.
--- branches/kstars/summer/kstars/kstars/tools/modcalcplanets.cpp #978540:978541
@@ -283,11 +283,11 @@
     return i;
 }
 
-void modCalcPlanets::processLines( QTextStream &istream ) {
-
+void modCalcPlanets::processLines( QTextStream &istream )
+{
     // we open the output file
 
-    QString outputFileName, lineToWrite;
+    QString outputFileName;
     outputFileName = OutputFileBoxBatch->url().toLocalFile();
     QFile fOut( outputFileName );
     fOut.open(QIODevice::WriteOnly);
@@ -295,7 +295,6 @@
     bool lineIsValid = true;
     QString message;
 
-    QString line;
     QChar space = ' ';
     QString planetB;
     unsigned int i = 0, nline = 0;
@@ -318,8 +317,8 @@
     ///Parse the input file
     int numberOfRequiredFields = requiredBatchFields();
     while ( ! istream.atEnd() ) {
-        lineToWrite.clear();
-        line = istream.readLine();
+        QString lineToWrite;
+        QString line = istream.readLine();
         line.trimmed();
 
         //Go through the line, looking for parameters
@@ -338,7 +337,6 @@
         i = 0;
         if(PlanetCheckBatch->isChecked() ) {
             planetB = fields[i];
-
             int j = pNamesi18n.indexOf( planetB );
             if (j == -1) {
                 kWarning() << i18n("Unknown planet ")
@@ -348,21 +346,15 @@
             }
             pn = pNames.at(j); //untranslated planet name
             i++;
-        } else
+        } else {
             planetB = PlanetComboBoxBatch->currentText( );
-
-        if ( AllRadioBatch->isChecked() ) {
+        }
+        if ( AllRadioBatch->isChecked() || PlanetCheckBatch->isChecked() ) {
             lineToWrite = planetB;
             lineToWrite += space;
         }
-        else
-            if(PlanetCheckBatch->isChecked() ) {
-                lineToWrite = planetB;
-                lineToWrite += space;
-            }
 
         // Read Ut and write in ostream if corresponds
-
         if(UTCheckBatch->isChecked() ) {
             utB = QTime::fromString( fields[i] );
             if ( !utB.isValid() ) {
@@ -372,17 +364,13 @@
                 continue;
             }
             i++;
-        } else
+        } else {
             utB = UTBoxBatch->time();
-
-        if ( AllRadioBatch->isChecked() )
+        }
+        if ( AllRadioBatch->isChecked() || UTCheckBatch->isChecked() )
             lineToWrite += KGlobal::locale()->formatTime( utB, true ).append(space);
-        else
-            if(UTCheckBatch->isChecked() )
-                lineToWrite += KGlobal::locale()->formatTime( utB, true ).append(space);
 
         // Read date and write in ostream if corresponds
-
         if(DateCheckBatch->isChecked() ) {
             dtB = QDate::fromString( fields[i], Qt::ISODate );
             if ( !dtB.isValid() ) {
@@ -393,41 +381,35 @@
                 continue;
             }
             i++;
-        } else
+        } else {
             dtB = DateBoxBatch->date();
-        if ( AllRadioBatch->isChecked() )
+        }
+        if ( AllRadioBatch->isChecked() || DateCheckBatch->isChecked() )
             lineToWrite += KGlobal::locale()->formatDate( dtB, KLocale::LongDate ).append(space);
-        else
-            if(DateCheckBatch->isChecked() )
-                lineToWrite += KGlobal::locale()->formatDate( dtB, KLocale::LongDate ).append(space);
 
+
         // Read Longitude and write in ostream if corresponds
 
         if (LongCheckBatch->isChecked() ) {
             longB = dms::fromString( fields[i],true);
             i++;
-        } else
+        } else {
             longB = LongBoxBatch->createDms(true);
-
-        if ( AllRadioBatch->isChecked() )
+        }
+        if ( AllRadioBatch->isChecked() || LongCheckBatch->isChecked() )
             lineToWrite += longB.toDMSString() + space;
-        else
-            if (LongCheckBatch->isChecked() )
-                lineToWrite += longB.toDMSString() +  space;
 
         // Read Latitude
-
         if (LatCheckBatch->isChecked() ) {
             latB = dms::fromString( fields[i], true);
             i++;
-        } else
+        } else {
             latB = LatBoxBatch->createDms(true);
-        if ( AllRadioBatch->isChecked() )
+        }
+        if ( AllRadioBatch->isChecked() || LatCheckBatch->isChecked() ) 
             lineToWrite += latB.toDMSString() + space;
-        else
-            if (LatCheckBatch->isChecked() )
-                lineToWrite += latB.toDMSString() + space;
 
+
         KStarsDateTime edt( dtB, utB );
         dms LST = edt.gst().Degrees() + longB.Degrees();
 


More information about the Kstars-devel mailing list