diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-22 12:54:47 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-26 23:01:53 +0200 |
commit | f50ac3549d6a7f1199fa012e4b03f581bc8d305b (patch) | |
tree | 50ff044f1c618119c88544709808f533ed02225e /tracker-pt/ftnoir_tracker_pt_dialog.cpp | |
parent | d61eb905ae3fa161d50821d01ee47915713e89c2 (diff) |
core, modules: modernize syntax only
Use more C++17 features where this helps any.
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt_dialog.cpp')
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt_dialog.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.cpp b/tracker-pt/ftnoir_tracker_pt_dialog.cpp index 9073907d..ce1b9eb0 100644 --- a/tracker-pt/ftnoir_tracker_pt_dialog.cpp +++ b/tracker-pt/ftnoir_tracker_pt_dialog.cpp @@ -165,18 +165,16 @@ void TrackerDialog_PT::startstop_trans_calib(bool start) // Don't bother counting roll samples. Roll calibration is hard enough // that it's a hidden unsupported feature anyway. - const QString sample_feedback = progn( - if (nsamples[0] < min_yaw_samples) - return tr("%1 yaw samples. Yaw more to %2 samples for stable calibration.") - .arg(nsamples[0]).arg(min_yaw_samples); - if (nsamples[1] < min_pitch_samples) - return tr("%1 pitch samples. Pitch more to %2 samples for stable calibration.") - .arg(nsamples[1]).arg(min_pitch_samples); - + QString sample_feedback; + if (nsamples[0] < min_yaw_samples) + sample_feedback = tr("%1 yaw samples. Yaw more to %2 samples for stable calibration.").arg(nsamples[0]).arg(min_yaw_samples); + else if (nsamples[1] < min_pitch_samples) + sample_feedback = tr("%1 pitch samples. Pitch more to %2 samples for stable calibration.").arg(nsamples[1]).arg(min_pitch_samples); + else + { const int nsamples_total = nsamples[0] + nsamples[1]; - - return tr("%1 samples. Over %2, good!").arg(nsamples_total).arg(min_samples); - ); + sample_feedback = tr("%1 samples. Over %2, good!").arg(nsamples_total).arg(min_samples); + } ui.sample_count_display->setText(sample_feedback); } @@ -184,12 +182,11 @@ void TrackerDialog_PT::startstop_trans_calib(bool start) ui.tx_spin->setEnabled(!start); ui.ty_spin->setEnabled(!start); ui.tz_spin->setEnabled(!start); - ui.tcalib_button->setText(progn( - if (start) - return tr("Stop calibration"); - else - return tr("Start calibration"); - )); + + if (start) + ui.tcalib_button->setText(tr("Stop calibration")); + else + ui.tcalib_button->setText(tr("Start calibration")); } void TrackerDialog_PT::poll_tracker_info_impl() |