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 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