[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:12:23
Message-ID: 1249333943.859921.26385.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1006519 by khudyakov:
Use QPointer for dialog in slotEditFOV. It's the safe way to
create modal dialogs
CCMAIL: kstars-devel@kde.org
M +15 -14 fovdialog.cpp
--- trunk/KDE/kdeedu/kstars/kstars/dialogs/fovdialog.cpp #1006518:1006519
@@ -105,28 +105,28 @@
}
void FOVDialog::slotEditFOV() {
- NewFOV newfdlg( this );
//Preload current values
FOV *f = FOVList[ currentItem() ];
if (!f)
return;
- newfdlg.ui->FOVName->setText( f->name() );
- newfdlg.ui->FOVEditX->setText( QString::number( (double)( f->sizeX() ), 'f', 2 \
).replace( '.', KGlobal::locale()->decimalSymbol() ) );
- newfdlg.ui->FOVEditY->setText( QString::number( (double)( f->sizeY() ), 'f', 2 \
).replace( '.', KGlobal::locale()->decimalSymbol() ) );
- newfdlg.ui->ColorButton->setColor( QColor( f->color() ) );
- newfdlg.ui->ShapeBox->setCurrentIndex( f->shape() );
- newfdlg.slotUpdateFOV();
+ QPointer<NewFOV> newfdlg = new NewFOV( this );
+ newfdlg->ui->FOVName->setText( f->name() );
+ newfdlg->ui->FOVEditX->setText( QString::number( (double)( f->sizeX() ), 'f', 2 \
).replace( '.', KGlobal::locale()->decimalSymbol() ) ); + \
newfdlg->ui->FOVEditY->setText( QString::number( (double)( f->sizeY() ), 'f', 2 \
).replace( '.', KGlobal::locale()->decimalSymbol() ) ); + \
newfdlg->ui->ColorButton->setColor( QColor( f->color() ) ); + \
newfdlg->ui->ShapeBox->setCurrentIndex( f->shape() ); + newfdlg->slotUpdateFOV();
- 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() );
+ 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() );
- fov->FOVListBox->currentItem()->setText( newfdlg.ui->FOVName->text() );
+ fov->FOVListBox->currentItem()->setText( newfdlg->ui->FOVName->text() );
//Use the following replacement for QPtrList::replace():
//(see Qt4 porting guide at doc.trolltech.com)
@@ -137,6 +137,7 @@
fov->ViewBox->setFOV( FOVList[ currentItem() ] );
fov->ViewBox->update();
}
+ delete newfdlg;
}
void FOVDialog::slotRemoveFOV() {
_______________________________________________
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