[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - desktop/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 19 09:17:45 UTC 2019


 desktop/source/app/app.cxx |   13 +++++++++++++
 1 file changed, 13 insertions(+)

New commits:
commit bced052ae28a3cafbe4cd0538cefc9a37f80094f
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Nov 19 00:54:46 2019 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Nov 19 10:17:08 2019 +0100

    tdf#128523: drop cache directory when restart manager initiates restart
    
    This would allow to re-create cached elements that could be broken.
    Restarts include those after a version upgrade (with bugfixes); using
    safe mode dialog (after crashes/problems); some configuration changes.
    An example of issue fixed by this is bad cached icons from versions
    affected by tdf#119020, that still make troubles to users after a year
    after the reason of generation of bad icons had been fixed [1, 2, 3].
    
    [1] https://ask.libreoffice.org/en/question/211759
    [2] https://ask.libreoffice.org/en/question/215263
    [3] https://ask.libreoffice.org/en/question/217831
    
    Change-Id: I2362547c25f8f265915efafa4e224435eda03e20
    Reviewed-on: https://gerrit.libreoffice.org/83138
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 2d2a76dd0ada087c168134c0a873e0f9a98eea05)
    Reviewed-on: https://gerrit.libreoffice.org/83156
    Tested-by: Jenkins

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index ef94b0d96da3..76b2f93c95fb 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -96,6 +96,7 @@
 #include <unotools/configmgr.hxx>
 #include <unotools/moduleoptions.hxx>
 #include <unotools/localfilehelper.hxx>
+#include <unotools/ucbhelper.hxx>
 #include <officecfg/Office/Common.hxx>
 #include <officecfg/Office/Recovery.hxx>
 #include <officecfg/Office/Update.hxx>
@@ -327,6 +328,15 @@ void DoRestartActionsIfNecessary(bool quickstart) {
     }
 }
 
+void RemoveIconCacheDirectory()
+{
+    // See getIconCacheUrl in vcl/source/image/ImplImageTree.cxx
+    OUString sUrl = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER
+        "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache";
+    rtl::Bootstrap::expandMacros(sUrl);
+    utl::UCBContentHelper::Kill(sUrl);
+}
+
 }
 
 namespace {
@@ -1684,6 +1694,9 @@ int Desktop::doShutdown()
 
     if (pExecGlobals->bRestartRequested)
     {
+        // tdf#128523
+        RemoveIconCacheDirectory();
+
         // a restart is already requested, usually due to a configuration change
         // that needs a restart to get active. If this is the case, do not try
         // to use SecureUserConfig to safe this still untested new configuration


More information about the Libreoffice-commits mailing list