GameList: Add function to query whether database exists

This commit is contained in:
Connor McLaughlin 2020-01-24 14:51:12 +10:00
parent f6fee86f1c
commit c5faa36f43
2 changed files with 8 additions and 1 deletions

View File

@ -689,6 +689,11 @@ void GameList::SetSearchDirectoriesFromSettings(SettingsInterface& si)
m_search_directories.push_back({std::move(dir), true});
}
bool GameList::IsDatabasePresent() const
{
return FileSystem::FileExists(m_database_filename.c_str());
}
void GameList::Refresh(bool invalidate_cache, bool invalidate_database)
{
if (invalidate_cache)

View File

@ -65,8 +65,10 @@ public:
void SetCacheFilename(std::string filename) { m_cache_filename = std::move(filename); }
void SetDatabaseFilename(std::string filename) { m_database_filename = std::move(filename); }
void SetSearchDirectoriesFromSettings(SettingsInterface& si);
bool IsDatabasePresent() const;
void AddDirectory(std::string path, bool recursive);
void Refresh(bool invalidate_cache, bool invalidate_database);