From 91f3b07ee6525bfdacaef4187983965a79062c20 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 4 Jan 2016 21:03:19 +0100 Subject: [PATCH] Make clear browser cache button work with CEF (requires restart now) --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 12 ++++++++++++ indra/newview/llfloaterpreference.cpp | 6 +----- indra/newview/skins/default/xui/de/notifications.xml | 2 +- indra/newview/skins/default/xui/en/notifications.xml | 2 +- .../skins/default/xui/en/panel_preferences_setup.xml | 1 - indra/newview/skins/default/xui/ru/notifications.xml | 2 ++ 7 files changed, 28 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9840ee6843..eba04af6e4 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -23788,6 +23788,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 + FSStartupClearBrowserCache + + Comment + Clear internal browser cache on next startup. + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dbbcb721fd..f2d1c26d14 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5137,6 +5137,18 @@ bool LLAppViewer::initCache() } // + // Purge web browser cache + if (gSavedSettings.getBOOL("FSStartupClearBrowserCache")) + { + std::string browser_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "cef_cache"); + if (LLFile::isdir(browser_cache)) + { + gDirUtilp->deleteDirAndContents(browser_cache); + } + gSavedSettings.setBOOL("FSStartupClearBrowserCache", FALSE); + } + // + // For Windows, purging the cache can take an extraordinary amount of time. Rename the cache dir and purge it using another thread. startCachePurge(); // diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index a0489b1021..d446918bea 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -273,8 +273,7 @@ bool callback_clear_web_browser_cache(const LLSD& notification, const LLSD& resp S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) // YES { - LLViewerMedia::clearAllCaches(); - LLViewerMedia::clearAllCookies(); + gSavedSettings.setBOOL("FSStartupClearBrowserCache", TRUE); } return false; @@ -2493,9 +2492,6 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im // Clear inventory cache button getChildView("ClearInventoryCache")->setEnabled(TRUE); - - // Clear web browser cache button - getChildView("ClearWebBrowserCache")->setEnabled(TRUE); } diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 7dc3e27342..21e6611d93 100755 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -2486,7 +2486,7 @@ Möchten Sie den Nicht-stören-Modus deaktivieren, bevor Sie diese Transaktion a - Möchten Sie Ihren Webbrowser-Cache wirklich leeren? + Möchten Sie Ihren Webbrowser-Cache wirklich leeren (Benötigt Neustart)? diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 6aeaddbb47..651f4e2e96 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6281,7 +6281,7 @@ Are you sure you want to clear your inventory cache? icon="alertmodal.tga" name="ConfirmClearWebBrowserCache" type="alertmodal"> -Are you sure you want to clear your web browser cache? +Are you sure you want to clear your web browser cache (Requires Restart)? confirm