From 85854d0bf2e80f139d8d2eee34dbb0e75c4dc4d8 Mon Sep 17 00:00:00 2001 From: entropy Date: Sun, 29 Jan 2012 23:11:43 +0000 Subject: [PATCH] More cache overrides at startup, plus related debugging gprintfs --- source/list/cachedlist.cpp | 1 + source/list/cachedlist.hpp | 8 +++++++- source/menu/menu.cpp | 5 +++-- source/menu/menu_main.cpp | 3 +++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/source/list/cachedlist.cpp b/source/list/cachedlist.cpp index e4456bc8..3da2581c 100644 --- a/source/list/cachedlist.cpp +++ b/source/list/cachedlist.cpp @@ -18,6 +18,7 @@ void CachedList::Load(string path, string containing) /* Load All update_games = strcasestr(path.c_str(), "wbfs") != NULL && force_update[COVERFLOW_USB]; update_homebrew = strcasestr(path.c_str(), "apps") != NULL && force_update[COVERFLOW_HOMEBREW]; + gprintf("update_games=%d update_homebrew=%d\n", update_games, update_homebrew); if(update_games || update_homebrew) remove(m_database.c_str()); diff --git a/source/list/cachedlist.hpp b/source/list/cachedlist.hpp index 85faae5c..a86144e0 100644 --- a/source/list/cachedlist.hpp +++ b/source/list/cachedlist.hpp @@ -37,9 +37,15 @@ class CachedList : public safe_vector { if(view == COVERFLOW_MAX) for(u32 i = 0; i < COVERFLOW_MAX; i++) + { force_update[i] = true; + gprintf("force_update[%d] = true\n", i); + } else + { force_update[view] = true; + gprintf("force_update[%d] = true\n", view); + } } void Load(string path, string containing); @@ -72,4 +78,4 @@ class CachedList : public safe_vector string m_lastchannelLang; }; -#endif \ No newline at end of file +#endif diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index ca88e05f..ca603d04 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -1547,10 +1547,10 @@ bool CMenu::_loadList(void) m_cf.clear(); m_gameList.clear(); - gprintf("Loading items of "); - if(m_cfg.getBool(_domainFromView(), "update_cache")) m_gameList.Update(m_current_view); + gprintf("Loading items of "); + bool retval; switch(m_current_view) { @@ -1779,6 +1779,7 @@ const char *CMenu::_domainFromView() void CMenu::UpdateCache(u32 view) { + gprintf("UpdateCache(%ld)\n", view); if(view == COVERFLOW_MAX) { UpdateCache(COVERFLOW_USB); diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index b67d9c54..e0d9f310 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -177,7 +177,10 @@ int CMenu::main(void) MusicPlayer::Instance()->Play(); m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str()); if (m_cfg.getBool("GENERAL", "update_cache", false)) + { UpdateCache(); + m_gameList.Update(); + } _loadList(); _showMain();