Commit 15418ed1 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Task: Don't silently override the current item.

This works now but is bound to fail at some point
parent 3fa529c9
......@@ -162,6 +162,11 @@ const std::string& Task::Item::mrl() const
return m_mrl;
}
void Task::Item::setMrl( std::string mrl )
{
m_mrl = std::move( mrl );
}
const std::vector<Task::Item>& Task::Item::subItems() const
{
return m_subItems;
......@@ -314,7 +319,7 @@ void Task::setMrl( std::string newMrl )
"mrl = ? WHERE id_task = ?";
if ( sqlite::Tools::executeUpdate( m_ml->getConn(), req, newMrl, m_id ) == false )
return;
m_item = Item{ std::move( newMrl ) };
m_item.setMrl( std::move( newMrl ) );
}
void Task::createTable( sqlite::Connection* dbConnection )
......
......@@ -148,6 +148,7 @@ public:
void setMeta( Metadata type, std::string value );
const std::string& mrl() const;
void setMrl( std::string mrl );
const std::vector<Item>& subItems() const;
void addSubItem( Item mrl );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment