summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2011-11-17 14:04:16 -0800
committerJosé Fonseca <jose.r.fonseca@gmail.com>2011-11-24 18:11:33 +0000
commite935ee1015d5162e02d90be7b52267194231e038 (patch)
tree7aebca70a36041aae908ba7f4c5556a589cebe37 /gui
parent30d24d96251f691a6d0463b9235a6077dbf3c29c (diff)
Parse doubles to a new Double class rather than to the Float class.
This is simply a case of not discarding information. Without this, it would not be possible to parse a trace and re-create the identical trace. Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
Diffstat (limited to 'gui')
-rw-r--r--gui/apitracecall.cpp5
-rw-r--r--gui/apitracecall.h1
-rw-r--r--gui/saverthread.cpp5
3 files changed, 11 insertions, 0 deletions
diff --git a/gui/apitracecall.cpp b/gui/apitracecall.cpp
index c8c2245e..4752cc00 100644
--- a/gui/apitracecall.cpp
+++ b/gui/apitracecall.cpp
@@ -171,6 +171,11 @@ void VariantVisitor::visit(trace::Float *node)
m_variant = QVariant(node->value);
}
+void VariantVisitor::visit(trace::Double *node)
+{
+ m_variant = QVariant(node->value);
+}
+
void VariantVisitor::visit(trace::String *node)
{
m_variant = QVariant(QString::fromStdString(node->value));
diff --git a/gui/apitracecall.h b/gui/apitracecall.h
index fc4e5d0d..f017f5df 100644
--- a/gui/apitracecall.h
+++ b/gui/apitracecall.h
@@ -25,6 +25,7 @@ public:
virtual void visit(trace::SInt *node);
virtual void visit(trace::UInt *node);
virtual void visit(trace::Float *node);
+ virtual void visit(trace::Double *node);
virtual void visit(trace::String *node);
virtual void visit(trace::Enum *e);
virtual void visit(trace::Bitmask *bitmask);
diff --git a/gui/saverthread.cpp b/gui/saverthread.cpp
index 1773494c..7e7c471d 100644
--- a/gui/saverthread.cpp
+++ b/gui/saverthread.cpp
@@ -243,6 +243,11 @@ public:
m_editedValue = new trace::Float(m_variant.toFloat());
}
+ virtual void visit(trace::Double *node)
+ {
+ m_editedValue = new trace::Double(m_variant.toDouble());
+ }
+
virtual void visit(trace::String *node)
{
QString str = m_variant.toString();