fix: use cross-platform toStdString in FlameHasher

Almost the same issue from toml++ :p

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-11-07 14:04:48 -03:00
parent 9f462dcc27
commit 589d160515
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469

View File

@ -4,6 +4,7 @@
#include <QFile>
#include "FileSystem.h"
#include "StringUtils.h"
#include <MurmurHash2.h>
@ -66,7 +67,7 @@ void FlameHasher::executeTask()
// CF-specific
auto should_filter_out = [](char c) { return (c == 9 || c == 10 || c == 13 || c == 32); };
std::ifstream file_stream(m_path.toStdString(), std::ifstream::binary);
std::ifstream file_stream(StringUtils::toStdString(m_path), std::ifstream::binary);
// TODO: This is very heavy work, but apparently QtConcurrent can't use move semantics, so we can't boop this to another thread.
// How do we make this non-blocking then?
m_hash = QString::number(MurmurHash2(std::move(file_stream), 4 * MiB, should_filter_out));