virtual void Verify()
{
- if(!!m_data.startFile)
+ if(!!m_data.startFileEncountered)
{
if(m_data.startFileNamespace == m_namespace
|| m_namespace != ConfigurationNamespace::TizenWebAppNamespaceName)
//else continue -> if previous item was not in tizen namespace
}
+ m_data.startFileEncountered = true;
m_data.startFileNamespace = m_namespace;
//we're consciously setting startFile even if m_src is null or invalid.
virtual void Accept(const XmlAttribute& attribute)
{
- if (attribute.name == L"src") {
- if (attribute.value.size() > 0) {
- m_src = attribute.value;
+ if (m_properNamespace)
+ {
+ if (attribute.name == L"src") {
+ if (attribute.value.size() > 0) {
+ m_src = attribute.value;
+ }
}
}
}
- virtual void Accept(const Element& /*element*/)
- {}
+ virtual void Accept(const Element& element)
+ {
+ if (element.ns ==
+ ConfigurationNamespace::TizenWebAppNamespaceName)
+ {
+ m_properNamespace = true;
+ }
+ }
virtual void Accept(const Text& /*text*/)
{}
virtual void Verify()
{
- if (m_src.IsNull()) {
- LogWarning(
- "src attribute of splash element is mandatory - ignoring");
+ if (m_src.IsNull())
+ {
+ LogWarning("src attribute of splash element is mandatory - ignoring");
return;
}
SplashParser(ConfigParserData& data) :
ElementParser(),
- m_data(data)
+ m_data(data),
+ m_properNamespace(false)
{}
private:
DPL::OptionalString m_src;
ConfigParserData& m_data;
+ bool m_properNamespace;
};
class BackgroundParser : public ElementParser
virtual void Verify()
{
+ std::pair<DPL::String, DPL::String> boxLabel;
if (m_label.empty()) {
- ThrowMsg(Exception::ParseError,
- "box-label element cannot be empty - ignoring");
+ LogWarning("box-label element is empty");
+ boxLabel.first = DPL::FromUTF8String("");
+ boxLabel.second = DPL::FromUTF8String("");
+ m_data.m_label.push_back(boxLabel);
+ }
+ else {
+ boxLabel.first = m_lang;
+ boxLabel.second = m_label;
+ m_data.m_label.push_back(boxLabel);
}
- std::pair<DPL::String, DPL::String> boxLabel;
- boxLabel.first = m_lang;
- boxLabel.second = m_label;
- m_data.m_label.push_back(boxLabel);
}
BoxLabelParser(ConfigParserData::LiveboxInfo& data) :
if (attribute.name == L"preview") {
m_preview = attribute.value;
}
+ if (attribute.name == L"use-decoration") {
+ m_useDecoration = attribute.value;
+ }
}
}
"size is mandatory - ignoring");
}
- std::pair<DPL::String, DPL::String> boxSize;
- boxSize.first = m_size;
- boxSize.second = m_preview;
- m_data.m_boxSize.push_back(boxSize);
+ ConfigParserData::LiveboxInfo::BoxSizeInfo boxSizeInfo;
+ boxSizeInfo.m_size = m_size;
+ boxSizeInfo.m_preview = m_preview;
+ boxSizeInfo.m_useDecoration = m_useDecoration;
+ m_data.m_boxSize.push_back(boxSizeInfo);
}
explicit BoxSizeParser(
private:
DPL::String m_size;
DPL::String m_preview;
+ DPL::String m_useDecoration;
bool m_properNamespace;
ConfigParserData::LiveboxInfo::BoxContentInfo& m_data;
};
}
NormalizeString(m_key);
NormalizeString(m_value);
- ConfigParserData::Metadata metaData(*m_key, *m_value);
+ ConfigParserData::Metadata metaData(m_key, m_value);
FOREACH(it, m_data.metadataList) {
- if (!DPL::StringCompare(it->key, *m_key)) {
+ if (!DPL::StringCompare(*it->key, *m_key)) {
LogError("Key isn't unique");
return;
}