This allows for a user configured thumbnail image to be displayed
when the mouse is hovering over a file link. Any file that KIO can
transform into a thumbnail (image, video, folder) will be displayed.
Simply move the mouse to a file while holding an user selected keypress
(Alt, Shift, Control or a combination of them). The default
requires no key press. The profile setting 'Underline files' much be
enabled for this to work.
https://invent.kde.org/utilities/konsole/-/merge_requests/93
FIXED-IN: 20.08
FEATURE:
GUI:
CHANGELOG: Add thumbnails for certain file types on mouse hover
The time that it takes to search a collection of just too many strings
can take up to 48msec - tested triggering the code on /usr/lib with
around 7000 files.
changing to QSet this went down to 35msec. This is not a lot but
it's triggered at *every* mouse move event, so the gain is cummulative
The whole experience is a bit smoother.
When creating HotSpot's for local files, create them for files in the
current dir and for files in sub-directories too.
Re-format the code used to build the regex pattern for more readability
(easier for seeing what the regex pattern will look like, I hope).
Use a static QRegularExpression object, so as to only construct it once,
the pattern doesn't change and this should help with performance. Also
make createFileRegex() not static.
Don't convert QList<QString> to QSet<QString>, without actual benchmarking
it could be that QList is actually efficient here.
Use const where appropriate.
BUG: 416376
The actions are destroyed during a focusIn / focusOut, and recreated
with the same content but different memory positions, and that
killed the QActions inside of the menu.
To trigger this is simple, open the search bar, type some url in
konsole, and right click on it: you will not see the actions
to copy and go to url.
moving the related code to QSharedPointer fixes this by delaying
the destruction of the pointer untill the menu is closed.
Match files with known prefixes and full names.
Also cache known files instead of looking up and creating a QDir and
QFileInfo for every file, to improve performance massively.
REVIEW: 128396
Port away from using QRegExp to QRegularExpression. The result is a bit
better performance, a bit more readable code (imho) and also no more
relying on mutable state in static objects (like in the keyboard
translator parser).
REVIEW: 128346
An updated version of the patch by Adam Treat <treat@kde.org>:
Implement a new file filter using POSIX Portable Filename Character
Set along with KDE's mimetype database of file extension blobs that
filters text matching a POSIX portable pathname and underlines it
very much like links.
REVIEW: 128241
REVIEW: 114376