Commit 45244ec5 authored by Volker Krause's avatar Volker Krause
Browse files

Fix plain text auto-detection

parent 164de2f5
Pipeline #56211 passed with stages
in 13 minutes and 1 second
......@@ -12,12 +12,13 @@
#include <QStringView>
#include <algorithm>
#include <cctype>
using namespace KItinerary;
bool TextDocumentProcessor::canHandleData(const QByteArray &encodedData, QStringView fileName) const
{
return std::none_of(encodedData.begin(), encodedData.end(), [](const auto c) { return c < 20; })
return std::none_of(encodedData.begin(), encodedData.end(), [](auto c) { return std::iscntrl(c) && !std::isspace(c); })
|| fileName.endsWith(QLatin1String(".txt"), Qt::CaseInsensitive);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment