summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-12-03 23:47:37 +0100
committerDees Troy <dees_troy@teamw.in>2014-12-12 17:10:20 +0100
commit619a721a30731d1ff599873d37b20ee05ad81cf9 (patch)
tree91f16d21d90506234cf954a1ed76a1fc5324f236 /gui
parentAttempt to set the proper uid/gid/contexts on new files and dirs (diff)
downloadandroid_bootable_recovery-619a721a30731d1ff599873d37b20ee05ad81cf9.tar
android_bootable_recovery-619a721a30731d1ff599873d37b20ee05ad81cf9.tar.gz
android_bootable_recovery-619a721a30731d1ff599873d37b20ee05ad81cf9.tar.bz2
android_bootable_recovery-619a721a30731d1ff599873d37b20ee05ad81cf9.tar.lz
android_bootable_recovery-619a721a30731d1ff599873d37b20ee05ad81cf9.tar.xz
android_bootable_recovery-619a721a30731d1ff599873d37b20ee05ad81cf9.tar.zst
android_bootable_recovery-619a721a30731d1ff599873d37b20ee05ad81cf9.zip
Diffstat (limited to 'gui')
-rw-r--r--gui/resources.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/gui/resources.cpp b/gui/resources.cpp
index 5f3923d10..74f020b62 100644
--- a/gui/resources.cpp
+++ b/gui/resources.cpp
@@ -149,8 +149,10 @@ ImageResource::ImageResource(xml_node<>* node, ZipArchive* pZip)
std::string file;
mSurface = NULL;
- if (!node)
+ if (!node) {
+ LOGERR("ImageResource node is NULL\n");
return;
+ }
if (node->first_attribute("filename"))
file = node->first_attribute("filename")->value();
@@ -261,10 +263,13 @@ void ResourceManager::LoadResources(xml_node<>* resList, ZipArchive* pZip)
FontResource* res = new FontResource(child, pZip);
if (res == NULL || res->GetResource() == NULL)
{
- xml_attribute<>* attr_name = child->first_attribute("name");
+ std::string res_name;
+ if (child->first_attribute("name"))
+ res_name = child->first_attribute("name")->value();
+ if (res_name.empty() && child->first_attribute("filename"))
+ res_name = child->first_attribute("filename")->value();
- if (!attr_name) {
- std::string res_name = attr_name->value();
+ if (!res_name.empty()) {
LOGERR("Resource (%s)-(%s) failed to load\n", type.c_str(), res_name.c_str());
} else
LOGERR("Resource type (%s) failed to load\n", type.c_str());
@@ -281,10 +286,13 @@ void ResourceManager::LoadResources(xml_node<>* resList, ZipArchive* pZip)
ImageResource* res = new ImageResource(child, pZip);
if (res == NULL || res->GetResource() == NULL)
{
- xml_attribute<>* attr_name = child->first_attribute("name");
+ std::string res_name;
+ if (child->first_attribute("name"))
+ res_name = child->first_attribute("name")->value();
+ if (res_name.empty() && child->first_attribute("filename"))
+ res_name = child->first_attribute("filename")->value();
- if (!attr_name) {
- std::string res_name = attr_name->value();
+ if (!res_name.empty()) {
LOGERR("Resource (%s)-(%s) failed to load\n", type.c_str(), res_name.c_str());
} else
LOGERR("Resource type (%s) failed to load\n", type.c_str());
@@ -301,10 +309,13 @@ void ResourceManager::LoadResources(xml_node<>* resList, ZipArchive* pZip)
AnimationResource* res = new AnimationResource(child, pZip);
if (res == NULL || res->GetResource() == NULL)
{
- xml_attribute<>* attr_name = child->first_attribute("name");
+ std::string res_name;
+ if (child->first_attribute("name"))
+ res_name = child->first_attribute("name")->value();
+ if (res_name.empty() && child->first_attribute("filename"))
+ res_name = child->first_attribute("filename")->value();
- if (!attr_name) {
- std::string res_name = attr_name->value();
+ if (!res_name.empty()) {
LOGERR("Resource (%s)-(%s) failed to load\n", type.c_str(), res_name.c_str());
} else
LOGERR("Resource type (%s) failed to load\n", type.c_str());