X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=Client%2Faccrealtimedialog.cpp;h=fd5100f92f0044ddb1324a8b4167b2a94aa19dda;hb=8bc16dde57946bf3d217401e01061327867da370;hp=bf34104abc7e4cad68cf2948c649d6738376136d;hpb=d3f5e6c35e562437da3995a492b7df3304357109;p=speedfreak diff --git a/Client/accrealtimedialog.cpp b/Client/accrealtimedialog.cpp index bf34104..fd5100f 100644 --- a/Client/accrealtimedialog.cpp +++ b/Client/accrealtimedialog.cpp @@ -143,19 +143,22 @@ void AccRealTimeDialog::readAccelerometerData() if(!resultDialog) { resultDialog = new ResultDialog(this); + connect(resultDialog, SIGNAL(rejected()), this, SLOT(killResultDialog())); + connect(resultDialog, SIGNAL(sendresult(double)), this, SLOT(sendResult(double))); } - connect(resultDialog, SIGNAL(sendresult(double)), this, SLOT(sendResult(double))); - resultDialog->setEnd(stopMeasureSpeed); - - //Put all times from all speeds - QMap tempMap = calculate->getValuesMap(); - - for( int i = 1 ; i <= tempMap.count() ; i++ ) + if(resultDialog) { - resultDialog->setValue(i*10,tempMap[i*10]); + resultDialog->setEnd(stopMeasureSpeed); + //Put all times from all speeds + QMap tempMap = calculate->getValuesMap(); + + for( int i = 1 ; i <= tempMap.count() ; i++ ) + { + resultDialog->setValue(i*10,tempMap[i*10]); + } + resultDialog->show(); + this->hide(); } - resultDialog->show(); - this->hide(); } } @@ -210,3 +213,16 @@ void AccRealTimeDialog::sendResult(double result) { emit sendresult(result); } + +/** + *This slot function kills resultDialog. + * + **/ +void AccRealTimeDialog::killResultDialog() +{ + if(resultDialog) + { + delete resultDialog; + resultDialog = NULL; + } +}