Some refactor
This commit is contained in:
37 files changed
+1599
-981
No files matched your search
@@ -1,5 +1,6 @@
|
||||
#include "TxtReader.h"
|
||||
|
||||
#include <QCryptographicHash>
|
||||
#include <QFileInfo>
|
||||
#include <QRegularExpression>
|
||||
#include <QTextStream>
|
||||
@@ -110,6 +111,8 @@ bool TxtReader::open(const QString &filePath)
|
||||
QByteArray raw = file.readAll();
|
||||
file.close();
|
||||
|
||||
m_contentHash = QCryptographicHash::hash(raw, QCryptographicHash::Md5);
|
||||
|
||||
uchardet_t ud = uchardet_new();
|
||||
if (uchardet_handle_data(ud, raw.constData(), raw.size()) == 0) {
|
||||
uchardet_data_end(ud);
|
||||
@@ -206,3 +209,8 @@ QString TxtReader::coverImagePath()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
QByteArray TxtReader::contentHash()
|
||||
{
|
||||
return m_contentHash;
|
||||
}
|
||||
Reference in new issue
Block a user