From eba8ab839876e8242b996fe2dc7cbb93edfe576d Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Wed, 22 Aug 2012 05:21:15 +0000 Subject: [PATCH] -added new option to wiiflow.ini, "skip_list_check", if you enable it wiiflow will not check for new games on boot, that will speed up bootup amazingly for people with alot of wii games (disabled by def) -disabled extended list check by default --- source/list/cachedlist.cpp | 10 +++++----- source/list/cachedlist.hpp | 38 ++++++++++++++++++++------------------ source/menu/menu.cpp | 6 +++--- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/source/list/cachedlist.cpp b/source/list/cachedlist.cpp index 2b20feea..31547042 100644 --- a/source/list/cachedlist.cpp +++ b/source/list/cachedlist.cpp @@ -35,24 +35,24 @@ void CachedList::Load(string path, string containing, string m_lastLanguage, Con gprintf("%s\n", path.c_str()); if(stat(path.c_str(), &filestat) == -1) return; - + bool update_lang = m_lastLanguage != m_curLanguage; bool noDB = stat(m_database.c_str(), &cache) == -1; bool mtimes = filestat.st_mtime > cache.st_mtime; if(strcasestr(m_discinf.c_str(), "wbfs") != NULL && stat(m_discinf.c_str(), &discinfo) != -1) ditimes = discinfo.st_mtime > cache.st_mtime; - m_update = update_lang || noDB || mtimes || ditimes; + m_update = update_lang || noDB || (!m_skipcheck && (mtimes || ditimes)); if(m_update) gprintf("Cache of %s is being updated because:\n", path.c_str()); if(update_lang) gprintf("Languages are different!\nOld language string: %s\nNew language string: %s\n", m_lastLanguage.c_str(), m_curLanguage.c_str()); if(noDB) gprintf("A database was not found!\n"); - if(mtimes || ditimes) + if(!m_skipcheck && (mtimes || ditimes)) gprintf("The WBFS folder was modified!\nCache date: %i\nFolder date: %i\n", cache.st_mtime, filestat.st_mtime); - if(m_extcheck && !m_update) + if(m_extcheck && !m_update && !m_skipcheck) { bool m_chupdate = false; DIR *dir = opendir(path.c_str()); @@ -66,7 +66,7 @@ void CachedList::Load(string path, string containing, string m_lastLanguage, Con break; } m_update = m_chupdate; - } + } } if(update_games) diff --git a/source/list/cachedlist.hpp b/source/list/cachedlist.hpp index 2a611e30..1074333f 100644 --- a/source/list/cachedlist.hpp +++ b/source/list/cachedlist.hpp @@ -19,8 +19,8 @@ enum { class CachedList : public vector { - public: - void Init(string cachedir, string settingsDir, string curLanguage, string DMLgameDir, bool extcheck) /* Initialize Private Variables */ +public: + void Init(string cachedir, string settingsDir, string curLanguage, string DMLgameDir, bool extcheck, bool skipcheck) /* Initialize Private Variables */ { m_cacheDir = cachedir; m_settingsDir = settingsDir; @@ -29,6 +29,7 @@ class CachedList : public vector m_database = ""; m_update = false; m_extcheck = extcheck; + m_skipcheck = skipcheck; m_DMLgameDir = DMLgameDir; for(u32 i = 0; i < COVERFLOW_MAX; i++) force_update[i] = false; @@ -49,30 +50,31 @@ class CachedList : public vector } } - void Load(string path, string containing, string m_lastLanguage, Config &m_plugin); + void Load(string path, string containing, string m_lastLanguage, Config &m_plugin); void LoadChannels(string path, u32 channelType, string m_lastLanguage); - void Unload(){if(m_loaded) {this->clear(); m_loaded = false; m_database = "";}}; - void Save() {if(m_loaded) CCache(*this, m_database, SAVE);} /* Save All */ + void Unload(){if(m_loaded) {this->clear(); m_loaded = false; m_database = "";}}; + void Save() {if(m_loaded) CCache(*this, m_database, SAVE);} /* Save All */ - void Get(dir_discHdr tmp, u32 index) {if(m_loaded) CCache(tmp, m_database, index, LOAD);} /* Load One */ - void Set(dir_discHdr tmp, u32 index) {if(m_loaded) CCache(tmp, m_database, index, SAVE);} /* Save One */ + void Get(dir_discHdr tmp, u32 index) {if(m_loaded) CCache(tmp, m_database, index, LOAD);} /* Load One */ + void Set(dir_discHdr tmp, u32 index) {if(m_loaded) CCache(tmp, m_database, index, SAVE);} /* Save One */ + + void Add(dir_discHdr tmp) {if(m_loaded) CCache(*this, m_database, tmp, ADD);} /* Add One */ + void Remove(u32 index) {if(m_loaded) CCache(*this, m_database, index, REMOVE);} /* Remove One */ - void Add(dir_discHdr tmp) {if(m_loaded) CCache(*this, m_database, tmp, ADD);} /* Add One */ - void Remove(u32 index) {if(m_loaded) CCache(*this, m_database, index, REMOVE);} /* Remove One */ - void SetLanguage(string curLanguage) { m_curLanguage = curLanguage; } - private: - string make_db_name(string path); +private: + string make_db_name(string path); - bool m_loaded; - bool m_update; - bool m_wbfsFS; + bool m_loaded; + bool m_update; + bool m_wbfsFS; bool m_extcheck; + bool m_skipcheck; u8 force_update[COVERFLOW_MAX]; - CList list; - string m_database; - string m_cacheDir; + CList list; + string m_database; + string m_cacheDir; string m_settingsDir; string m_curLanguage; string m_lastLanguage; diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index df7e79ac..2edbefde 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -416,11 +416,11 @@ void CMenu::init(void) m_curLanguage = CMenu::_translations[0]; m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str())); } - - bool extcheck = m_cfg.getBool("GENERAL", "extended_list_check", true); + bool extcheck = m_cfg.getBool("GENERAL", "extended_list_check", false); + bool skipcheck = m_cfg.getBool("GENERAL", "skip_list_check", false); m_tempView = false; - m_gameList.Init(m_listCacheDir, m_settingsDir, m_loc.getString(m_curLanguage, "gametdb_code", "EN"), m_DMLgameDir, extcheck); + m_gameList.Init(m_listCacheDir, m_settingsDir, m_loc.getString(m_curLanguage, "gametdb_code", "EN"), m_DMLgameDir, extcheck, skipcheck); m_aa = 3;