Fix Qt 5.15 deprecation warnings for QString::SkipEmptyParts

Task-number: QTCREATORBUG-24098
Change-Id: I03ee6811df4346754bbd652f2c3c97477f9cdb7e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-06-16 16:32:50 +02:00
parent 592e20cf0f
commit 8a697cde64
3 changed files with 10 additions and 2 deletions

View File

@@ -36,6 +36,12 @@ QT_END_NAMESPACE
namespace Utils {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
constexpr QString::SplitBehavior SkipEmptyParts = QString::SkipEmptyParts;
#else
constexpr Qt::SplitBehaviorFlags SkipEmptyParts = Qt::SkipEmptyParts;
#endif
// Create a usable settings key from a category,
// for example Editor|C++ -> Editor_C__
QTCREATOR_UTILS_EXPORT QString settingsKey(const QString &category);

View File

@@ -31,6 +31,7 @@
#include <utils/algorithm.h>
#include <utils/hostosinfo.h>
#include <utils/optional.h>
#include <utils/stringutils.h>
#include <QDir>
#include <QRegularExpression>
@@ -236,7 +237,7 @@ QStringList splitCommandLine(QString commandLine, QSet<QString> &flagsCache)
}
} else { // If 's' is outside quotes ...
for (const QString &flag :
part.split(QRegularExpression("\\s+"), QString::SkipEmptyParts)) {
part.split(QRegularExpression("\\s+"), Utils::SkipEmptyParts)) {
auto flagIt = flagsCache.insert(flag);
result.append(*flagIt);
}

View File

@@ -40,6 +40,7 @@
#include <utils/cpplanguage_details.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/stringutils.h>
#include <QDir>
#include <QRegularExpression>
@@ -742,7 +743,7 @@ void CompilerOptionsBuilder::evaluateCompilerFlags()
{
static QStringList userBlackList = QString::fromLocal8Bit(
qgetenv("QTC_CLANG_CMD_OPTIONS_BLACKLIST"))
.split(';', QString::SkipEmptyParts);
.split(';', Utils::SkipEmptyParts);
const Core::Id &toolChain = m_projectPart.toolchainType;
bool containsDriverMode = false;