Fix unrar detection on Windows

CCBUG: 412413
remotes/origin/work/aacid/okular_focus_actions
George Florea Bănuș 5 years ago committed by Albert Astals Cid
parent ccda6d2a65
commit e6f82a50cf
  1. 4
      generators/comicbook/unrar.cpp

@ -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);
Q_UNUSED(ok)
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();

Loading…
Cancel
Save