Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d132cab authored by Dees Troy's avatar Dees Troy Committed by Gerrit Code Review
Browse files

Merge "Add support for persistent variables in theme's <variables> section" into android-4.4

parents 504022bd 81c29dc7
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -611,16 +611,21 @@ Page* PageSet::FindPage(std::string name)
int PageSet::LoadVariables(xml_node<>* vars)
{
	xml_node<>* child;
	xml_attribute<> *name, *value, *persist;
	int p;

	child = vars->first_node("variable");
	while (child)
	{
		if (!child->first_attribute("name"))
			break;
		if (!child->first_attribute("value"))
			break;
		name = child->first_attribute("name");
		value = child->first_attribute("value");
		persist = child->first_attribute("persist");
		if(name && value)
		{
			p = persist ? atoi(persist->value()) : 0;
			DataManager::SetValue(name->value(), value->value(), p);
		}

		DataManager::SetValue(child->first_attribute("name")->value(), child->first_attribute("value")->value());
		child = child->next_sibling("variable");
	}
	return 0;