Skip to content
GitLab
Menu
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
989576dc
Commit
989576dc
authored
Nov 11, 2020
by
Stefan Brüns
Browse files
Use KArchiveDirectory::file instead of extra isFile() check
parent
a90db047
Changes
1
Hide whitespace changes
Inline
Side-by-side
thumbnail/kritacreator.cpp
View file @
989576dc
...
...
@@ -56,13 +56,13 @@ bool KritaCreator::create(const QString &path, int width, int height, QImage &im
// first check if normal thumbnail is good enough
// ORA thumbnail?
const
KArchive
Entry
*
entry
=
zip
.
directory
()
->
entry
(
QLatin1String
(
"Thumbnails/thumbnail.png"
));
// KRA thumbnail
if
(
!
entry
||
!
entry
->
isFile
())
{
entry
=
zip
.
directory
()
->
entry
(
QLatin1String
(
"preview.png"
));
const
KArchive
File
*
entry
=
zip
.
directory
()
->
file
(
QLatin1String
(
"Thumbnails/thumbnail.png"
));
if
(
!
entry
)
{
// KRA thumbnail
entry
=
zip
.
directory
()
->
file
(
QLatin1String
(
"preview.png"
));
}
if
(
!
entry
||
!
entry
->
isFile
()
)
{
if
(
!
entry
)
{
return
false
;
}
...
...
@@ -73,8 +73,8 @@ bool KritaCreator::create(const QString &path, int width, int height, QImage &im
return
true
;
}
entry
=
zip
.
directory
()
->
entry
(
QLatin1String
(
"mergedimage.png"
));
if
(
entry
&&
entry
->
isFile
()
)
{
entry
=
zip
.
directory
()
->
file
(
QLatin1String
(
"mergedimage.png"
));
if
(
entry
)
{
fileZipEntry
=
static_cast
<
const
KZipFileEntry
*>
(
entry
);
thumbLoaded
=
thumbnail
.
loadFromData
(
fileZipEntry
->
data
(),
"PNG"
);
if
(
thumbLoaded
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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