X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fwidgets%2Fsweeptimingwidget.cpp;h=b4943225dd8d44ddae54fad59b7231e70a8c6e3f;hb=4d48a00b1a546fc04baa7c56ed0bcf52a2fdf985;hp=1c1581bb7c086ae649fd2e2f753877004eb66f37;hpb=8dbbc7f0b9ea59d0f0d62225772f8a56eee125f5;p=pulseview.git
diff --git a/pv/widgets/sweeptimingwidget.cpp b/pv/widgets/sweeptimingwidget.cpp
index 1c1581b..b494322 100644
--- a/pv/widgets/sweeptimingwidget.cpp
+++ b/pv/widgets/sweeptimingwidget.cpp
@@ -14,18 +14,15 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see .
*/
-#include "sweeptimingwidget.h"
+#include "sweeptimingwidget.hpp"
+#include
#include
-
#include
-#include
-
#include
using std::abs;
@@ -88,11 +85,9 @@ void SweepTimingWidget::show_list(const uint64_t *vals, size_t count)
value_type_ = List;
list_.clear();
- for (size_t i = 0; i < count; i++)
- {
+ for (size_t i = 0; i < count; i++) {
char *const s = sr_si_string_u64(vals[i], suffix_);
- list_.addItem(QString::fromUtf8(s),
- qVariantFromValue(vals[i]));
+ list_.addItem(QString::fromUtf8(s), qVariantFromValue(vals[i]));
g_free(s);
}
@@ -142,24 +137,20 @@ void SweepTimingWidget::show_125_list(uint64_t min, uint64_t max)
uint64_t SweepTimingWidget::value() const
{
- switch(value_type_)
- {
+ switch (value_type_) {
case None:
return 0;
-
case MinMaxStep:
return (uint64_t)value_.value();
-
case List:
{
const int index = list_.currentIndex();
return (index >= 0) ? list_.itemData(
index).value() : 0;
}
-
default:
// Unexpected value type
- assert(0);
+ assert(false);
return 0;
}
}
@@ -183,5 +174,5 @@ void SweepTimingWidget::set_value(uint64_t value)
list_.setCurrentIndex(best_match);
}
-} // widgets
-} // pv
+} // namespace widgets
+} // namespace pv