The "Clear Disk Caches" command also clears the KTX cache (on the next restart)

This commit is contained in:
Oren Hurvitz 2019-03-28 11:53:56 +02:00
parent 7e91fe9e8b
commit dbd9299e85
2 changed files with 11 additions and 3 deletions

View file

@ -632,8 +632,16 @@ Menu::Menu() {
QString("hifi/tablet/TabletNetworkingPreferences.qml"), "NetworkingPreferencesDialog");
});
addActionToQMenuAndActionHash(networkMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches()));
addActionToQMenuAndActionHash(networkMenu, MenuOption::ClearDiskCache, 0,
DependencyManager::get<AssetClient>().data(), SLOT(clearCache()));
action = addActionToQMenuAndActionHash(networkMenu, MenuOption::ClearDiskCaches);
connect(action, &QAction::triggered, [] {
// This cache is cleared immediately
DependencyManager::get<AssetClient>()->clearCache();
// Clear the KTX cache on the next restart. It can't be cleared immediately because its files might be in use.
Setting::Handle<int>(KTXCache::SETTING_VERSION_NAME, KTXCache::INVALID_VERSION).set(KTXCache::INVALID_VERSION);
});
addCheckableActionToQMenuAndActionHash(networkMenu,
MenuOption::DisableActivityLogger,
0,

View file

@ -56,7 +56,7 @@ namespace MenuOption {
const QString CalibrateCamera = "Calibrate Camera";
const QString CenterPlayerInView = "Center Player In View";
const QString Chat = "Chat...";
const QString ClearDiskCache = "Clear Disk Cache";
const QString ClearDiskCaches = "Clear Disk Caches (requires restart)";
const QString Collisions = "Collisions";
const QString Connexion = "Activate 3D Connexion Devices";
const QString Console = "Console...";