[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kstars-devel
Subject:    [Kstars-devel] KDE/kdeedu/kstars/kstars/dialogs
From:       Alexey Khudyakov <alexey.skladnoy () gmail ! com>
Date:       2009-08-03 21:50:01
Message-ID: 1249336201.107241.31660.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1006534 by khudyakov:

Why one should bother himself with endless conversion to and fro.
NewFOV dialog already provide FOV object. 

CCMAIL: kstars-devel@kde.org


 M  +3 -11     fovdialog.cpp  
 M  +2 -1      fovdialog.h  


--- trunk/KDE/kdeedu/kstars/kstars/dialogs/fovdialog.cpp #1006533:1006534
@@ -132,12 +132,7 @@
 void FOVDialog::slotNewFOV() {
     QPointer<NewFOV> newfdlg = new NewFOV( this );
     if ( newfdlg->exec() == QDialog::Accepted ) {
-        FOV *newfov = new FOV( newfdlg->ui->FOVName->text(),
-                               textToDouble( newfdlg->ui->FOVEditX ),
-                               textToDouble( newfdlg->ui->FOVEditY ),
-                               FOV::intToShape(newfdlg->ui->ShapeBox->currentIndex()),
-                               newfdlg->ui->ColorButton->color().name() );
-        // Add new item in listbox
+        FOV *newfov = new FOV( newfdlg->getFOV() );
         addListWidget( newfov );
         fov->FOVListBox->setCurrentRow( fov->FOVListBox->count() -1 );
     }
@@ -162,11 +157,7 @@
 
     if ( newfdlg->exec() == QDialog::Accepted ) {
         // Overwrite FOV
-        *f =  FOV( newfdlg->ui->FOVName->text(), 
-                   textToDouble( newfdlg->ui->FOVEditX ),
-                   textToDouble( newfdlg->ui->FOVEditY ),
-                   FOV::intToShape(newfdlg->ui->ShapeBox->currentIndex()),
-                   newfdlg->ui->ColorButton->color().name() );
+        *f = newfdlg->getFOV();
         fov->ViewBox->update();
     }
     delete newfdlg;
@@ -182,6 +173,7 @@
 }
 
 //-------------NewFOV------------------//
+
 NewFOV::NewFOV( QWidget *parent )
         : KDialog( parent ), f()
 {
--- trunk/KDE/kdeedu/kstars/kstars/dialogs/fovdialog.h #1006533:1006534
@@ -78,7 +78,8 @@
     NewFOV( QWidget *parent=0 );
     ~NewFOV() {}
     NewFOVUI *ui;
-
+    /** Return reference to FOV. */
+    const FOV& getFOV() const { return f; }
 public slots:
     void slotBinocularFOVDistanceChanged( int index );
     void slotUpdateFOV();
_______________________________________________
Kstars-devel mailing list
Kstars-devel@kde.org
https://mail.kde.org/mailman/listinfo/kstars-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic