Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
KIO Extras
Commits
5571dd56
Commit
5571dd56
authored
Jun 05, 2021
by
Marcin Gurtowski
Committed by
David Faure
Jun 05, 2021
Browse files
Skipping thumbnail caching for encrypted storages
parent
98520e6c
Pipeline
#64335
passed with stage
in 4 minutes and 2 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
thumbnail/CMakeLists.txt
View file @
5571dd56
thumbnail/thumbnail.cpp
View file @
5571dd56
...
...
@@ -690,9 +690,16 @@ bool ThumbnailProtocol::createSubThumbnail(QImage &thumbnail, const QString &fil
if
(
subCreator
&&
subCreator
->
create
(
filePath
,
cacheSize
,
cacheSize
,
thumbnail
))
{
scaleDownImage
(
thumbnail
,
cacheSize
,
cacheSize
);
// The thumbnail has been created successfully. Store the thumbnail
// to the cache for future access.
// The thumbnail has been created successfully. Check if we can store
// the thumbnail to the cache for future access.
#if KIO_VERSION >= QT_VERSION_CHECK(5, 83, 0)
if
(
metaData
(
"cache"
).
toInt
())
{
#else
{
#endif
// Save the cache
QSaveFile
thumbnailfile
(
thumbPath
.
absoluteFilePath
(
thumbName
));
if
(
thumbnailfile
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Truncate
))
{
QFileInfo
fi
(
filePath
);
thumbnail
.
setText
(
QStringLiteral
(
"Thumb::URI"
),
QString
::
fromUtf8
(
fileUrl
));
...
...
@@ -703,6 +710,8 @@ bool ThumbnailProtocol::createSubThumbnail(QImage &thumbnail, const QString &fil
thumbnailfile
.
commit
();
}
}
}
}
else
{
return
false
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment