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

Alexey Khudyakov alexey.skladnoy at gmail.com
Fri Jul 31 22:13:24 CEST 2009


SVN commit 1005337 by khudyakov:

Remove constructor FOV(QString name). It's not used any more.
And it doesn't seem useful with current data model.

CCMAIL: kstars-devel at kde.org



 M  +2 -60     fov.cpp  
 M  +0 -2      fov.h  


--- trunk/KDE/kdeedu/kstars/kstars/fov.cpp #1005336:1005337
@@ -36,68 +36,10 @@
     m_sizeY = (b < 0.0) ? a : b;
 } 
 
-FOV::FOV() : m_name( i18n( "No FOV" ) ), m_color( "#FFFFFF" ), m_sizeX( 0.0 ), m_sizeY( 0.0 ), m_shape( SQUARE )
+FOV::FOV() :
+    m_name( i18n( "No FOV" ) ), m_color( "#FFFFFF" ), m_sizeX( 0.0 ), m_sizeY( 0.0 ), m_shape( SQUARE )
 {}
 
-FOV::FOV( const QString &sname ) {
-    QFile f;
-    f.setFileName( KStandardDirs::locate( "appdata", "fov.dat" ) );
-
-    int sh;
-    float sx, sy;
-
-    /* NOTE:
-       If there are five fields, interpret them as Name:SizeX:SizeY:Shape:Color
-       If there are four fields, interpret them as Name:Size = SizeX = SizeY:Shape:Color
-       [This is required for backward compatibility]
-    */
-
-    if ( f.exists() && f.open( QIODevice::ReadOnly ) ) {
-        QTextStream stream( &f );
-        while ( !stream.atEnd() ) {
-            QStringList fields = stream.readLine().split( ':' );
-            bool ok( false );
-            if ( fields.count() == 4 || fields.count() == 5 ) {
-                int index = 0;
-                if ( fields[index] == sname ) {
-                    ++index;
-                    sx = (float)(fields[index].toDouble( &ok ));
-                    if( !ok )
-                        break;  // Conversion failed, so no point continuing
-                    ++ index;
-
-                    if( fields.count() == 5 ) {
-                        sy = (float)(fields[index].toDouble( &ok ));
-                        if( !ok )
-                            break;
-                        ++index;
-                    }
-                    else
-                        sy = sx;
-
-                    sh = fields[index].toInt( &ok );
-                    if( !ok )
-                        break;
-                    ++index;
-                    m_name = fields[0];
-                    m_sizeX = sx;
-                    m_sizeY = sy;
-                    m_shape = intToShape(sh);
-                    m_color = fields[index];
-                    return;
-                }
-            }
-        }
-    }
-    
-    //If we get here, then the symbol could not be assigned
-    m_name = i18n( "No FOV" );
-    m_sizeX = 0.0;
-    m_sizeY = 0.0;
-    m_shape = UNKNOWN;
-    m_color = "#FFFFFF";
-}
-
 void FOV::draw( QPainter &p, float zoomFactor ) {
     float pixelSizeX = sizeX() * zoomFactor / 57.3 / 60.0;
     float pixelSizeY = sizeY() * zoomFactor / 57.3 / 60.0;
--- trunk/KDE/kdeedu/kstars/kstars/fov.h #1005336:1005337
@@ -41,9 +41,7 @@
     
     /**Default constructor*/
     FOV();
-    FOV( const QString &name );  //in this case, read params from fov.dat
     FOV( const QString &name, float a, float b=-1, Shape shape=SQUARE, const QString &color="#FFFFFF" );
-    ~FOV() {}
 
     inline QString name() const { return m_name; }
     void setName( const QString &n ) { m_name = n; }


More information about the Kstars-devel mailing list