[app] BooksUtil::computeFileHash should take const BooksTask pointer
And so should BooksUtil::computeFileHashAndSetAttr
This commit is contained in:
parent
09fc0cbe3e
commit
76b1e20e1a
2 changed files with 4 additions and 4 deletions
|
@ -90,7 +90,7 @@ shared_ptr<Book> BooksUtil::bookFromFile(std::string aPath)
|
||||||
return book;
|
return book;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray BooksUtil::computeFileHash(QString aPath, BooksTask* aTask)
|
QByteArray BooksUtil::computeFileHash(QString aPath, const BooksTask* aTask)
|
||||||
{
|
{
|
||||||
QByteArray result;
|
QByteArray result;
|
||||||
QFile file(aPath);
|
QFile file(aPath);
|
||||||
|
@ -157,7 +157,7 @@ bool BooksUtil::setFileHashAttr(QString aPath, QByteArray aHash)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray BooksUtil::computeFileHashAndSetAttr(QString aPath, BooksTask* aTask)
|
QByteArray BooksUtil::computeFileHashAndSetAttr(QString aPath, const BooksTask* aTask)
|
||||||
{
|
{
|
||||||
QByteArray hash = computeFileHash(aPath, aTask);
|
QByteArray hash = computeFileHash(aPath, aTask);
|
||||||
if (!hash.isEmpty()) {
|
if (!hash.isEmpty()) {
|
||||||
|
|
|
@ -48,8 +48,8 @@ namespace BooksUtil {
|
||||||
bool isValidFileName(QString aName);
|
bool isValidFileName(QString aName);
|
||||||
QByteArray fileHashAttr(QString aPath);
|
QByteArray fileHashAttr(QString aPath);
|
||||||
bool setFileHashAttr(QString aPath, QByteArray aHash);
|
bool setFileHashAttr(QString aPath, QByteArray aHash);
|
||||||
QByteArray computeFileHash(QString aPath, BooksTask* aTask = NULL);
|
QByteArray computeFileHash(QString aPath, const BooksTask* aTask = NULL);
|
||||||
QByteArray computeFileHashAndSetAttr(QString aPath, BooksTask* aTask = NULL);
|
QByteArray computeFileHashAndSetAttr(QString aPath, const BooksTask* aTask = NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline shared_ptr<Book> BooksUtil::bookFromFile(QString aPath)
|
inline shared_ptr<Book> BooksUtil::bookFromFile(QString aPath)
|
||||||
|
|
Loading…
Reference in a new issue