https://bugs.documentfoundation.org/show_bug.cgi?id=158985

            Bug ID: 158985
           Summary: Make "Clear Unavailable Files" in menu/start center
                    multi-threaded
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

Description:
Files that are deleted or renamed remain visible in the menu and start center
even after they are deleted/renamed. To avoid having the invalid file names /
thumbnails in the menus and start center, a new option, "Clear Unavailable
Files" is added to LibreOffice to address the issue tdf#101302.

The previous implementation can be found in below commit, which is not
multi-threaded:
tdf#101302: Add option to clear unavailable files in menu/start center
2839b604af94dbd1ee59dc6d47dc2f4c6ebd8dc6

This task here is to improve the implementation provided for the above issue by
making it multi-threaded. This is the quote from Mike in tdf#101302 comment 41,
which provides code pointers, before above change:

"Currently (after recent changes) thumbnail generation is performed fully in
RecentDocsViewItem constructor [1]. It has two cases: where a pre-created
thumbnail is present (see line 208), and when it's absent (line 167). The
former one currently does not attempt to access files, only using pre-existing
thumbnail and file name to draw the element in the start center; the latter
tries to access the document trying to detect if the document is protected (at
which case, it may be problematic when the file is unreachable - see e.g. bug
144566).

The change should:
1. Change second case to not attempt to access files, drawing default thumbnail
without lock to avoid UI blocking;
2. Introduce a thread (one for all, or per-item) to access files
asynchronously, detecting (a) file availability, and (b) file
encryption/password protection. This should result in unavailable items being
re-drawn (either as dimmed, or maybe using some overlay indicating its
unavailable status), and protected ones re-drawn with lock - when that data is
available. The thread should update the item's maPreview1, and use some method
of RecentDocsView [2] to update specific items (note that existing
RecentDocsView::Reload is not suitable, since it re-creates all the items). It
should be possible to terminate the thread early, when user leaves the recent
list (e.g., opens a file or switches to templates view)."

[1]
https://opengrok.libreoffice.org/xref/core/sfx2/source/control/recentdocsviewitem.cxx?r=1dbed50a#123

[2]
https://opengrok.libreoffice.org/xref/core/sfx2/inc/recentdocsview.hxx?r=1dbed50a#60

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to