[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Fri Jan 14 06:30:28 CET 2005


CVS commit by harris: 

It is now possible to add user log text to stars identified with their 
genetive name.  The problem was that the Greek letter in the genetive 
name was being recorded in the user log file as a "?" character.  The 
Greek letter is now recorded in the file in ascii phonetic text (e.g., 
"lambda"), and is read from the log file that way as well.

CCMAIL: kstars-devel at kde.org


  M +3 -0      kstarsdata.cpp   1.138
  M +51 -44    skyobject.cpp   1.50


--- kdeedu/kstars/kstars/kstarsdata.cpp  #1.137:1.138
@@ -1051,4 +1051,7 @@ bool KStarsData::readUserLog(void)
                 buffer = buffer.mid(endIndex + 11);
 
+                //Find the sky object named 'name'.
+                //Note that ObjectNameList::find() looks for the ascii representation 
+                //of star genetive names, so stars are identified that way in the user log.
                 SkyObjectName *sonm = ObjNames.find(name);
                 if (sonm == 0) {

--- kdeedu/kstars/kstars/skyobject.cpp  #1.49:1.50
@@ -26,4 +26,5 @@
 
 #include "skyobject.h"
+#include "starobject.h" //needed in saveUserLog()
 #include "ksnumbers.h"
 #include "dms.h"
@@ -372,4 +373,10 @@ void SkyObject::saveUserLog( const QStri
   // header label
   QString KSLabel ="[KSLABEL:" + name() + "]";
+        //However, we can't accept a star name if it has a greek letter in it:
+        if ( type() == STAR ) {
+                StarObject *star = (StarObject*)this;
+                if ( name() == star->gname() ) 
+                        KSLabel = "[KSLABEL:" + star->gname( false ) + "]"; //"false": spell out greek letter
+        }
 
   file.setName( locateLocal( "appdata", "userlog.dat" ) ); //determine filename in local user KDE directory tree.




More information about the Kstars-devel mailing list