[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Tue Sep 30 05:26:11 CEST 2003


CVS commit by harris: 

Two fixes:  

1. Comets and asteroids were being treated as deep-sky 
objects in their detail dialogs (the secondary name field was showing
PGC/UGC catalog numbers). 

2. Can flag a line for removal in a global URL file by prefixing 
it with "XXX:".  Can't simply remove lines from these files, because 
users get a local version of the files which they can modify.

The removal is demonstrated in info_url.dat.  It specified a link 
to Antonio Cidadao's homepage for the Moon's popup menu.  We no 
longer use Antonio's images, so the link should not appear.

Your local info_url.dat file should currently have 149 lines, and 
should have 148 lines after installing and running the updated 
version.

CCMAIL: kstars-devel at kde.org


  M +7 -2      detaildialog.cpp   1.23
  M +24 -14    kstarsdata.cpp   1.97
  M +1 -1      data/info_url.dat   1.9


--- kdeedu/kstars/kstars/detaildialog.cpp  #1.22:1.23
@@ -224,4 +224,9 @@ void DetailDialog::createGeneralTab(QDat
                 }
                 break;
+        case 9:  //comets
+        case 10: //asteroids:
+                Names = new NameBox( selectedObject->translatedName(), "", i18n( "Object type:" ),
+                                        selectedObject->typeName(), "--", generalTab );
+                break;
         default: //deep-sky objects
                 dso = (DeepSkyObject *)selectedObject;

--- kdeedu/kstars/kstars/kstarsdata.cpp  #1.96:1.97
@@ -933,4 +933,8 @@ bool KStarsData::openURLFile(QString url
                                                                 QString line = gStream.readLine();
 
+                                                                //If global-file line begins with "XXX:" then this line should be removed from the local file.
+                                                                if ( line.left( 4 ) == "XXX:"  && urlData.contains( line.mid( 4 ) ) ) {
+                                                                        urlData.remove( urlData.find( line.mid( 4 ) ) );
+                                                                } else {
                                                                 //does local file contain the current global file line, up to second ':' ?
 
@@ -955,4 +959,5 @@ bool KStarsData::openURLFile(QString url
                                 }
                         }
+                        }
 
                         file.close();
@@ -979,5 +984,10 @@ bool KStarsData::openURLFile(QString url
                                         QTextStream readStream(&file);
                                         QTextStream writeStream(&localeFile);
-                                        writeStream <<  readStream.read();
+                                        while ( ! readStream.eof() ) {
+                                                QString line = readStream.readLine();
+                                                if ( line.left( 4 ) != "XXX:" ) //do not write "deleted" lines
+                                                        writeStream << line << endl;
+                                        }
+
                                         localeFile.close();
                                         file.reset();

--- kdeedu/kstars/kstars/data/info_url.dat  #1.8:1.9
@@ -117,5 +117,4 @@
 Moon:NASA JPL Page:http://www.jpl.nasa.gov/solar_system/planets/moon_index.html
 Moon:The Apollo Program:http://www.nasm.edu/apollo/
-Moon:About the Moon Images:http://www.astrosurf.com/cidadao/
 Mercury:SEDS Information Page:http://www.seds.org/nineplanets/nineplanets/mercury.html
 Mercury:NASA JPL Page:http://www.jpl.nasa.gov/solar_system/planets/planets_index.html
@@ -148,2 +147,3 @@
 Pluto:SEDS Information Page:http://www.seds.org/nineplanets/nineplanets/pluto.html
 Pluto:NASA JPL Page:http://www.jpl.nasa.gov/solar_system/planets/pluto_index.html
+XXX:Moon:About the Moon Images:http://www.astrosurf.com/cidadao/




More information about the Kstars-devel mailing list