[Kstars-devel] KDE/kdeedu/kstars/kstars

Akarsh Simha akarshsimha at gmail.com
Mon Jul 14 23:07:02 CEST 2008


SVN commit 832516 by asimha:

More fixes from EBN.

CCMAIL: kstars-devel at kde.org



 M  +6 -4      binfilehelper.cpp  
 M  +3 -3      binfilehelper.h  
 M  +1 -1      data/tools/binfiletester.c  
 M  +2 -2      data/tools/mysql2bin.c  
 M  +1 -1      ksplanet.cpp  
 M  +1 -1      kstarssplash.h  
 M  +1 -1      skycomponents/linelistindex.h  
 M  +3 -1      skycomponents/starblocklist.cpp  
 M  +4 -2      skycomponents/starcomponent.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/binfilehelper.cpp #832515:832516
@@ -19,6 +19,7 @@
 #include "binfilehelper.h"
 
 #include <kstandarddirs.h>
+#include <kde_file.h>
 #include "byteswap.h"
 
 class BinFileHelper;
@@ -59,9 +60,10 @@
 FILE *BinFileHelper::openFile(const QString &fileName) {
     QString FilePath = KStandardDirs::locate( "appdata", fileName );
     init();
-    const char *filepath = FilePath.toAscii().data();
+    QByteArray b = FilePath.toAscii();
+    const char *filepath = b.data();
 
-    fileHandle = fopen(filepath, "rb");
+    fileHandle = KDE_fopen(filepath, "rb");
 
     if(!fileHandle) {
 	errno = ERR_FILEOPEN;
@@ -125,7 +127,7 @@
     quint16 nrecs;
     quint16 prev_nrecs;
 
-    itableOffset = ftell(fileHandle);
+    itableOffset = KDE_ftell(fileHandle);
 
     prev_offset = 0;
     prev_nrecs = 0;
@@ -171,7 +173,7 @@
 	prev_nrecs = nrecs;
     }
 
-    dataOffset = ftell(fileHandle);
+    dataOffset = KDE_ftell(fileHandle);
 
     indexUpdated = true;
 
--- trunk/KDE/kdeedu/kstars/kstars/binfilehelper.h #832515:832516
@@ -69,14 +69,14 @@
      *WARNING: This function may not be compatible in other locales, because it calls QString::toAscii
      *@short Open a Binary data file and set the handle
      *@param fileName  Reference to QString containing the name of the file
-     *@return Handle to the file if successful, NULL if an error occured, sets the error.
+     *@return Handle to the file if successful, NULL if an error occurred, sets the error.
      */
 
     FILE *openFile(const QString &fileName);
 
     /**
      *@short  Read the header and index table from the file and fill up the QVector s with the entries
-     *@return True if successful, false if an error occured, sets the error.
+     *@return True if successful, false if an error occurred, sets the error.
      */
 
     bool readHeader();
@@ -198,7 +198,7 @@
      *@short   An enum providing user-friendly names for errors encountered
      */
     enum Errors {
-	ERR_NULL,             // No error occured
+	ERR_NULL,             // No error occurred
 	ERR_FILEOPEN,         // File could not be opened
 	ERR_FD_TRUNC,         // Field descriptor table is truncated
 	ERR_INDEX_TRUNC,      // File ends prematurely, before expected end of index table
--- trunk/KDE/kdeedu/kstars/kstars/data/tools/binfiletester.c #832515:832516
@@ -374,7 +374,7 @@
 /**
  *@short  Read the KStars binary file header and display its contents
  *@param f  Binary file to read from
- *@returns  non-zero if succesful, zero if not
+ *@returns  non-zero if successful, zero if not
  */
 
 int readFileHeader(FILE *f) {
--- trunk/KDE/kdeedu/kstars/kstars/data/tools/mysql2bin.c #832515:832516
@@ -229,7 +229,7 @@
 /*
  * Dump the data file header.
  *
- * WARNING: Must edit everytime the definition of the starData structures changes
+ * WARNING: Must edit every time the definition of the starData structures changes
  *
  * f : Data file handle
  */
@@ -272,7 +272,7 @@
 /*
  * Dump the name file header.
  *
- * WARNING: Must edit everytime the definition of the starName structures changes
+ * WARNING: Must edit every time the definition of the starName structures changes
  *
  * nf : Name file handle
  */
--- trunk/KDE/kdeedu/kstars/kstars/ksplanet.cpp #832515:832516
@@ -142,7 +142,7 @@
             KSPlanetBase::init( i18n("Neptune"), "neptune.png", QColor( "skyblue" ), 49572. );
             break;
         default:
-            kDebug() << i18n("Error: Illegal identifier in KSPlanet constructor: %1").arg(n) << endl;
+            kDebug() << i18n("Error: Illegal identifier in KSPlanet constructor: %1", n) << endl;
             break;
     }
 }
--- trunk/KDE/kdeedu/kstars/kstars/kstarssplash.h #832515:832516
@@ -44,7 +44,7 @@
     /**Constructor. Create widgets.  Load KStars logo.  Start load timer.
      * A non-empty customMessage will replace "Welcome to KStars [...]".
     */
-    KStarsSplash( QWidget *parent, const QString& customMessage="" );
+    explicit KStarsSplash( QWidget *parent, const QString& customMessage="" );
 
     /**Destructor
     	*/
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/linelistindex.h #832515:832516
@@ -43,7 +43,7 @@
      * @param mesh Pointer to the universal SkyMesh instance
      * @param name name of the subclass used for debugging
      */
-    LineListIndex( SkyComponent *parent, const QString& name="" );
+    explicit LineListIndex( SkyComponent *parent, const QString& name="" );
 
     /* @short this is called from within the draw routines when the updateID
      * of the lineList is stale.  It is virtual because different subclasses
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/starblocklist.cpp #832515:832516
@@ -21,6 +21,8 @@
 #include "stardata.h"
 #include "starcomponent.h"
 
+#include <kde_file.h>
+
 StarBlockList::StarBlockList(Trixel tr) {
     trixel = tr;
     nStars = 0;
@@ -99,7 +101,7 @@
 
     Q_ASSERT( nBlocks == blocks.size() );
 
-    fseek( dataFile, readOffset, SEEK_SET );
+    KDE_fseek( dataFile, readOffset, SEEK_SET );
     
     /*
     kDebug() << "Reading trixel" << trixel << ", id on disk =" << trixelId << ", currently nStars =" << nStars
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/starcomponent.cpp #832515:832516
@@ -40,6 +40,8 @@
 #include "byteswap.h"
 #include "starblockfactory.h"
 
+#include <kde_file.h>
+
 BinFileHelper StarComponent::deepStarReader;
 StarBlockFactory StarComponent::m_StarBlockFactory;
 bool StarComponent::frugalMem = false;
@@ -449,7 +451,7 @@
         kDebug() << "Error reading starnames.dat header : " << nameReader.getErrorNumber() << " : " << nameReader.getError() << endl;
         return;
     }
-    fseek(nameFile, nameReader.getDataOffset(), SEEK_SET);
+    KDE_fseek(nameFile, nameReader.getDataOffset(), SEEK_SET);
     swapBytes = dataReader.getByteSwap();
 
     long int nstars = 0;
@@ -458,7 +460,7 @@
     // TODO : Remove timing code when we are done with all possible optimizations
     t.start();
 
-    fseek(dataFile, dataReader.getDataOffset(), SEEK_SET);
+    KDE_fseek(dataFile, dataReader.getDataOffset(), SEEK_SET);
 
     qint16 faintmag;
     quint8 htm_level;


More information about the Kstars-devel mailing list