Fix cppcheck warnings

This commit is contained in:
Lars Toenning
2023-04-16 21:02:55 +02:00
parent ac04aa3a63
commit 7ef0e6e1eb
28 changed files with 45 additions and 53 deletions

View File

@@ -64,7 +64,7 @@ namespace BlackMisc
bool CFileUtils::writeStringToLockedFile(const QString &content, const QString &fileNameAndPath)
{
QLockFile lock(fileNameAndPath + ".lock");
lock.lock();
if (!lock.lock()) { return false; }
return writeStringToFile(content, fileNameAndPath);
}
@@ -81,7 +81,7 @@ namespace BlackMisc
QString CFileUtils::readLockedFileToString(const QString &fileNameAndPath)
{
QLockFile lock(fileNameAndPath + ".lock");
lock.lock();
if (!lock.lock()) { return {}; }
return readFileToString(fileNameAndPath);
}