From 76b1e20e1af315c2f760d66e36d460ce14abaf94 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Fri, 2 Feb 2018 01:11:23 +0300 Subject: [PATCH] [app] BooksUtil::computeFileHash should take const BooksTask pointer And so should BooksUtil::computeFileHashAndSetAttr --- app/src/BooksUtil.cpp | 4 ++-- app/src/BooksUtil.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/BooksUtil.cpp b/app/src/BooksUtil.cpp index 70e21b9..d4e7dc6 100644 --- a/app/src/BooksUtil.cpp +++ b/app/src/BooksUtil.cpp @@ -90,7 +90,7 @@ shared_ptr BooksUtil::bookFromFile(std::string aPath) return book; } -QByteArray BooksUtil::computeFileHash(QString aPath, BooksTask* aTask) +QByteArray BooksUtil::computeFileHash(QString aPath, const BooksTask* aTask) { QByteArray result; QFile file(aPath); @@ -157,7 +157,7 @@ bool BooksUtil::setFileHashAttr(QString aPath, QByteArray aHash) return false; } -QByteArray BooksUtil::computeFileHashAndSetAttr(QString aPath, BooksTask* aTask) +QByteArray BooksUtil::computeFileHashAndSetAttr(QString aPath, const BooksTask* aTask) { QByteArray hash = computeFileHash(aPath, aTask); if (!hash.isEmpty()) { diff --git a/app/src/BooksUtil.h b/app/src/BooksUtil.h index 506e844..4bec122 100644 --- a/app/src/BooksUtil.h +++ b/app/src/BooksUtil.h @@ -48,8 +48,8 @@ namespace BooksUtil { bool isValidFileName(QString aName); QByteArray fileHashAttr(QString aPath); bool setFileHashAttr(QString aPath, QByteArray aHash); - QByteArray computeFileHash(QString aPath, BooksTask* aTask = NULL); - QByteArray computeFileHashAndSetAttr(QString aPath, BooksTask* aTask = NULL); + QByteArray computeFileHash(QString aPath, const BooksTask* aTask = NULL); + QByteArray computeFileHashAndSetAttr(QString aPath, const BooksTask* aTask = NULL); } inline shared_ptr BooksUtil::bookFromFile(QString aPath)