mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-15 16:45:46 -04:00
GameList: Support caching entries
This commit is contained in:
@ -281,7 +281,7 @@ void GameListSettingsWidget::onBrowseRedumpPathButtonPressed()
|
||||
|
||||
m_ui.redumpDatabasePath->setText(filename);
|
||||
m_host_interface->getQSettings().setValue("GameList/RedumpDatabasePath", filename);
|
||||
m_host_interface->updateGameListDatabase(true);
|
||||
m_host_interface->refreshGameList(true, true);
|
||||
}
|
||||
|
||||
void GameListSettingsWidget::onDownloadRedumpDatabaseButtonPressed()
|
||||
|
@ -112,27 +112,14 @@ void QtHostInterface::checkSettings()
|
||||
void QtHostInterface::createGameList()
|
||||
{
|
||||
m_game_list = std::make_unique<GameList>();
|
||||
updateGameListDatabase(false);
|
||||
refreshGameList(false);
|
||||
refreshGameList(false, false);
|
||||
}
|
||||
|
||||
void QtHostInterface::updateGameListDatabase(bool refresh_list /*= true*/)
|
||||
{
|
||||
m_game_list->ClearDatabase();
|
||||
|
||||
const QString redump_dat_path = m_qsettings.value("GameList/RedumpDatabasePath").toString();
|
||||
if (!redump_dat_path.isEmpty())
|
||||
m_game_list->ParseRedumpDatabase(redump_dat_path.toStdString().c_str());
|
||||
|
||||
if (refresh_list)
|
||||
refreshGameList(true);
|
||||
}
|
||||
|
||||
void QtHostInterface::refreshGameList(bool invalidate_cache /*= false*/)
|
||||
void QtHostInterface::refreshGameList(bool invalidate_cache /* = false */, bool invalidate_database /* = false */)
|
||||
{
|
||||
QtSettingsInterface si(m_qsettings);
|
||||
m_game_list->SetDirectoriesFromSettings(si);
|
||||
m_game_list->RescanAllDirectories();
|
||||
m_game_list->SetPathsFromSettings(si);
|
||||
m_game_list->Refresh(invalidate_cache, invalidate_database);
|
||||
emit gameListRefreshed();
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,7 @@ public:
|
||||
|
||||
const GameList* getGameList() const { return m_game_list.get(); }
|
||||
GameList* getGameList() { return m_game_list.get(); }
|
||||
void updateGameListDatabase(bool refresh_list = true);
|
||||
void refreshGameList(bool invalidate_cache = false);
|
||||
void refreshGameList(bool invalidate_cache = false, bool invalidate_database = false);
|
||||
|
||||
bool isOnWorkerThread() const { return QThread::currentThread() == m_worker_thread; }
|
||||
|
||||
|
Reference in New Issue
Block a user