From: Joel Holdsworth Date: Sun, 19 Jan 2014 14:32:16 +0000 (+0000) Subject: SweepTimingWidgets: Fix list mode to show the correct suffix X-Git-Tag: pulseview-0.2.0~120 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b0ddc6bcc68bf8414021838515acd0decd3f0a77;p=pulseview.git SweepTimingWidgets: Fix list mode to show the correct suffix --- diff --git a/pv/widgets/sweeptimingwidget.cpp b/pv/widgets/sweeptimingwidget.cpp index 9bb75c86..ee37d8d9 100644 --- a/pv/widgets/sweeptimingwidget.cpp +++ b/pv/widgets/sweeptimingwidget.cpp @@ -34,6 +34,7 @@ namespace widgets { SweepTimingWidget::SweepTimingWidget(const char *suffix, QWidget *parent) : QWidget(parent), + _suffix(suffix), _layout(this), _value(this), _list(this), @@ -86,7 +87,7 @@ void SweepTimingWidget::show_list(const uint64_t *vals, size_t count) _list.clear(); for (size_t i = 0; i < count; i++) { - char *const s = sr_samplerate_string(vals[i]); + char *const s = sr_si_string_u64(vals[i], _suffix); _list.addItem(QString::fromUtf8(s), qVariantFromValue(vals[i])); g_free(s); diff --git a/pv/widgets/sweeptimingwidget.h b/pv/widgets/sweeptimingwidget.h index c0bcc8f7..b66188fa 100644 --- a/pv/widgets/sweeptimingwidget.h +++ b/pv/widgets/sweeptimingwidget.h @@ -59,6 +59,8 @@ signals: void value_changed(); private: + const char *const _suffix; + QHBoxLayout _layout; QDoubleSpinBox _value;