[apps/graph] Add a name attribute to functions

Change-Id: I7a8fd1701b026b27d1dfcfc87fc92398c494e7fd
This commit is contained in:
Émilie Feral
2016-09-16 17:23:45 +02:00
parent c633fbda4d
commit 082a3883cd
2 changed files with 7 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ Graph::Function::Function() :
Graph::Function::Function(const char * text, KDColor color) :
m_text(text), // FIXME: Copy !!
m_color(color),
m_name("f(x)"),
m_expression(nullptr),
m_layout(nullptr)
{
@@ -29,6 +30,10 @@ const char * Graph::Function::text() {
return m_text;
}
const char * Graph::Function::name() {
return m_name;
}
Expression * Graph::Function::expression() {
if (m_expression == nullptr) {
m_expression = Expression::parse(m_text);