clang-tidy: one declaration per line; braces around statements

clang-tidy checks:
readability-isolate-declaration and readability-braces-around-statements

KF task: https://phabricator.kde.org/T14729

GIT_SILENT
This commit is contained in:
Ahmad Samir
2021-08-13 15:13:07 +02:00
parent a8f92e5525
commit f5d574b3ad
12 changed files with 134 additions and 56 deletions

View File

@ -35,12 +35,14 @@ bool KraHandler::canRead() const
bool KraHandler::read(QImage *image)
{
KZip zip(device());
if (!zip.open(QIODevice::ReadOnly))
if (!zip.open(QIODevice::ReadOnly)) {
return false;
}
const KArchiveEntry *entry = zip.directory()->entry(QStringLiteral("mergedimage.png"));
if (!entry || !entry->isFile())
if (!entry || !entry->isFile()) {
return false;
}
const KZipFileEntry *fileZipEntry = static_cast<const KZipFileEntry *>(entry);
@ -57,8 +59,9 @@ bool KraHandler::canRead(QIODevice *device)
}
char buff[57];
if (device->peek(buff, sizeof(buff)) == sizeof(buff))
if (device->peek(buff, sizeof(buff)) == sizeof(buff)) {
return memcmp(buff + 0x26, s_magic, s_magic_size) == 0;
}
return false;
}