we now load and save chats as well

This commit is contained in:
Rasmus Karlsson
2017-01-29 11:38:00 +01:00
parent 1c076b803e
commit c0b4035e6a
5 changed files with 64 additions and 7 deletions
+22
View File
@@ -83,5 +83,27 @@ ChatWidget::paintEvent(QPaintEvent *)
painter.fillRect(this->rect(), ColorScheme::getInstance().ChatBackground);
}
void
ChatWidget::load(const boost::property_tree::ptree &tree)
{
// Load tab text
try {
this->setChannelName(
QString::fromStdString(tree.get<std::string>("channelName")));
} catch (boost::property_tree::ptree_error) {
}
}
boost::property_tree::ptree
ChatWidget::save()
{
boost::property_tree::ptree tree;
tree.put("channelName", this->getChannelName().toStdString());
return tree;
}
} // namespace widgets
} // namespace chatterino