Commit e6f82a50 authored by George Florea Bănuș's avatar George Florea Bănuș Committed by Albert Astals Cid
Browse files

Fix unrar detection on Windows

CCBUG: 412413
parent ccda6d2a
Pipeline #53558 passed with stage
in 10 minutes and 38 seconds
......@@ -23,6 +23,7 @@
#include "debug_comicbook.h"
#include <QRegularExpression>
#include <QStandardPaths>
#include <memory>
......@@ -47,7 +48,8 @@ static UnrarFlavour *detectUnrar(const QString &unrarPath, const QString &versio
proc.start(unrarPath, QStringList() << versionCommand);
bool ok = proc.waitForFinished(-1);
const QStringList lines = QString::fromLocal8Bit(proc.readAllStandardOutput()).split(QLatin1Char('\n'), QString::SkipEmptyParts);
const QRegularExpression regex(QStringLiteral("[\r\n]"));
const QStringList lines = QString::fromLocal8Bit(proc.readAllStandardOutput()).split(regex, QString::SkipEmptyParts);
if (!lines.isEmpty()) {
if (lines.first().startsWith(QLatin1String("UNRAR ")))
kind = new NonFreeUnrarFlavour();
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