diff options
Diffstat (limited to 'src/libs/installer/binaryformatengine.cpp')
-rw-r--r-- | src/libs/installer/binaryformatengine.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/libs/installer/binaryformatengine.cpp b/src/libs/installer/binaryformatengine.cpp index ec6926031..7f00c8d47 100644 --- a/src/libs/installer/binaryformatengine.cpp +++ b/src/libs/installer/binaryformatengine.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2023 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -28,7 +28,7 @@ #include "binaryformatengine.h" -#include <QRegExp> +#include <QRegularExpression> namespace { @@ -127,9 +127,16 @@ bool BinaryFormatEngine::close() /*! \internal */ +#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0) bool BinaryFormatEngine::open(QIODevice::OpenMode mode) +#else +bool BinaryFormatEngine::open(QIODevice::OpenMode mode, std::optional<QFile::Permissions> permissions) +#endif { Q_UNUSED(mode) +#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0) + Q_UNUSED(permissions) +#endif return m_resource.isNull() ? false : m_resource->open(); } @@ -263,15 +270,17 @@ QStringList BinaryFormatEngine::entryList(QDir::Filters filters, const QStringLi if (filterNames.isEmpty()) return result; - QList<QRegExp> regexps; - foreach (const QString &i, filterNames) - regexps.append(QRegExp(i, Qt::CaseInsensitive, QRegExp::Wildcard)); + QList<QRegularExpression> regexps; + for (const QString &i : filterNames) { + regexps.append(QRegularExpression(QRegularExpression::wildcardToRegularExpression(i), + QRegularExpression::CaseInsensitiveOption)); + } QStringList entries; - foreach (const QString &i, result) { + for (const QString &i : qAsConst(result)) { bool matched = false; - foreach (const QRegExp ®, regexps) { - matched = reg.exactMatch(i); + for (const QRegularExpression ® : qAsConst(regexps)) { + matched = reg.match(i).hasMatch(); if (matched) break; } |