summaryrefslogtreecommitdiffstats
path: root/gui/resources.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2018-08-24 18:17:36 +0200
committerEthan Yonker <dees_troy@teamw.in>2018-08-24 18:17:39 +0200
commit58f2132bc3954fc704787d477500a209eedb8e29 (patch)
treeeb0f79aacd68724b0c0c091018384ef924380f47 /gui/resources.cpp
parentRemove remaining pieces of supersu (diff)
parentSnap for 4745538 from 723056a83f8c8b15af02d9c302862dbb2304ea8c to pi-release (diff)
downloadandroid_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.gz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.bz2
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.lz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.xz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.zst
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.zip
Diffstat (limited to 'gui/resources.cpp')
-rw-r--r--gui/resources.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/gui/resources.cpp b/gui/resources.cpp
index 59b8ed484..bb2fd500a 100644
--- a/gui/resources.cpp
+++ b/gui/resources.cpp
@@ -294,38 +294,38 @@ AnimationResource* ResourceManager::FindAnimation(const std::string& name) const
std::string ResourceManager::FindString(const std::string& name) const
{
- if (this != NULL) {
+ //if (this != NULL) {
std::map<std::string, string_resource_struct>::const_iterator it = mStrings.find(name);
if (it != mStrings.end())
return it->second.value;
LOGERR("String resource '%s' not found. No default value.\n", name.c_str());
PageManager::AddStringResource("NO DEFAULT", name, "[" + name + ("]"));
- } else {
+ /*} else {
LOGINFO("String resources not loaded when looking for '%s'. No default value.\n", name.c_str());
- }
+ }*/
return "[" + name + ("]");
}
std::string ResourceManager::FindString(const std::string& name, const std::string& default_string) const
{
- if (this != NULL) {
+ //if (this != NULL) {
std::map<std::string, string_resource_struct>::const_iterator it = mStrings.find(name);
if (it != mStrings.end())
return it->second.value;
LOGERR("String resource '%s' not found. Using default value.\n", name.c_str());
PageManager::AddStringResource("DEFAULT", name, default_string);
- } else {
+ /*} else {
LOGINFO("String resources not loaded when looking for '%s'. Using default value.\n", name.c_str());
- }
+ }*/
return default_string;
}
void ResourceManager::DumpStrings() const
{
- if (this == NULL) {
+ /*if (this == NULL) {
gui_print("No string resources\n");
return;
- }
+ }*/
std::map<std::string, string_resource_struct>::const_iterator it;
gui_print("Dumping all strings:\n");
for (it = mStrings.begin(); it != mStrings.end(); it++)
@@ -363,7 +363,7 @@ void ResourceManager::LoadResources(xml_node<>* resList, ZipWrap* pZip, std::str
if (type == "font")
{
FontResource* res = new FontResource(child, pZip);
- if (res->GetResource())
+ if (res && res->GetResource())
mFonts.push_back(res);
else {
error = true;
@@ -393,7 +393,7 @@ void ResourceManager::LoadResources(xml_node<>* resList, ZipWrap* pZip, std::str
else if (type == "image")
{
ImageResource* res = new ImageResource(child, pZip);
- if (res->GetResource())
+ if (res && res->GetResource())
mImages.push_back(res);
else {
error = true;
@@ -403,7 +403,7 @@ void ResourceManager::LoadResources(xml_node<>* resList, ZipWrap* pZip, std::str
else if (type == "animation")
{
AnimationResource* res = new AnimationResource(child, pZip);
- if (res->GetResourceCount())
+ if (res && res->GetResourceCount())
mAnimations.push_back(res);
else {
error = true;