]> sigrok.org Git - pulseview.git/commitdiff
SweepTimingWidgets: Fix list mode to show the correct suffix
authorJoel Holdsworth <redacted>
Sun, 19 Jan 2014 14:32:16 +0000 (14:32 +0000)
committerJoel Holdsworth <redacted>
Sun, 19 Jan 2014 14:50:34 +0000 (14:50 +0000)
pv/widgets/sweeptimingwidget.cpp
pv/widgets/sweeptimingwidget.h

index 9bb75c869a8f780c52e3e6590e2a54ebad94931e..ee37d8d98d55d2b2cbe879c0399a864f5dec130f 100644 (file)
@@ -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);
index c0bcc8f787bfa2efbdad56f0194bdca762cf6964..b66188fa31be5af876a5bdc114f5eaf8045205e3 100644 (file)
@@ -59,6 +59,8 @@ signals:
        void value_changed();
 
 private:
+       const char *const _suffix;
+
        QHBoxLayout _layout;
 
        QDoubleSpinBox _value;