forked from qt-creator/qt-creator
Fix Qt 6 build of ProjectExplorer and targets & build systems
QStringRef is gone. qsizetype vs int. QMultiHash::insertMulti is gone. QXmlStreamWriter writes UTF-8 by default. Task-number: QTCREATORBUG-24098 Change-Id: Id217e40a1f17993a84fc725976e9cb84618b0580 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -367,7 +367,7 @@ QVector<int> AndroidConfig::availableNdkPlatforms(const BaseQtVersion *qtVersion
|
||||
while (it.hasNext()) {
|
||||
const QString &fileName = it.next();
|
||||
availableNdkPlatforms.push_back(
|
||||
fileName.midRef(fileName.lastIndexOf(QLatin1Char('-')) + 1).toInt());
|
||||
fileName.mid(fileName.lastIndexOf(QLatin1Char('-')) + 1).toInt());
|
||||
}
|
||||
Utils::sort(availableNdkPlatforms, std::greater<>());
|
||||
|
||||
@@ -648,7 +648,7 @@ QString AndroidConfig::getAvdName(const QString &serialnumber)
|
||||
if (index == -1)
|
||||
return QString();
|
||||
bool ok;
|
||||
int port = serialnumber.midRef(index + 1).toInt(&ok);
|
||||
int port = serialnumber.mid(index + 1).toInt(&ok);
|
||||
if (!ok)
|
||||
return QString();
|
||||
|
||||
|
@@ -959,7 +959,7 @@ int extractVersion(const QString &string)
|
||||
int index = string.indexOf(QLatin1Char(':'));
|
||||
if (index == -1)
|
||||
return 0;
|
||||
return string.midRef(4, index - 4).toInt();
|
||||
return string.mid(4, index - 4).toInt();
|
||||
}
|
||||
|
||||
void AndroidManifestEditorWidget::syncToEditor()
|
||||
|
@@ -248,7 +248,7 @@ void DeviceSelectionModel::parsePackage(const QString &packageFile)
|
||||
return;
|
||||
QXmlStreamReader in(&f);
|
||||
while (in.readNextStartElement()) {
|
||||
const QStringRef elementName = in.name();
|
||||
const auto elementName = in.name();
|
||||
if (elementName == "package")
|
||||
parsePackage(in, packageFile);
|
||||
else
|
||||
@@ -264,7 +264,7 @@ void DeviceSelectionModel::parsePackage(QXmlStreamReader &in, const QString &pac
|
||||
child->fullPath = packageFile;
|
||||
child->version = extractPackVersion(packageFile);
|
||||
while (in.readNextStartElement()) {
|
||||
const QStringRef elementName = in.name();
|
||||
const auto elementName = in.name();
|
||||
if (elementName == "name") {
|
||||
fillElementProperty(in, child->name);
|
||||
} else if (elementName == "description") {
|
||||
@@ -275,7 +275,7 @@ void DeviceSelectionModel::parsePackage(QXmlStreamReader &in, const QString &pac
|
||||
fillElementProperty(in, child->url);
|
||||
} else if (elementName == "devices") {
|
||||
while (in.readNextStartElement()) {
|
||||
const QStringRef elementName = in.name();
|
||||
const auto elementName = in.name();
|
||||
if (elementName == "family")
|
||||
parseFamily(in, child);
|
||||
else
|
||||
@@ -296,7 +296,7 @@ void DeviceSelectionModel::parseFamily(QXmlStreamReader &in, DeviceSelectionItem
|
||||
child->name = attrs.value("Dfamily").toString();
|
||||
fillVendor(attrs.value("Dvendor").toString(), child->vendorName, child->vendorId);
|
||||
while (in.readNextStartElement()) {
|
||||
const QStringRef elementName = in.name();
|
||||
const auto elementName = in.name();
|
||||
if (elementName == "processor") {
|
||||
fillCpu(in, child->cpu);
|
||||
} else if (elementName == "algorithm") {
|
||||
@@ -323,7 +323,7 @@ void DeviceSelectionModel::parseSubFamily(QXmlStreamReader &in, DeviceSelectionI
|
||||
const QXmlStreamAttributes attrs = in.attributes();
|
||||
child->name = attrs.value("DsubFamily").toString();
|
||||
while (in.readNextStartElement()) {
|
||||
const QStringRef elementName = in.name();
|
||||
const auto elementName = in.name();
|
||||
if (elementName == "processor") {
|
||||
fillCpu(in, child->cpu);
|
||||
} else if (elementName == "debug") {
|
||||
@@ -344,7 +344,7 @@ void DeviceSelectionModel::parseDevice(QXmlStreamReader &in, DeviceSelectionItem
|
||||
const QXmlStreamAttributes attrs = in.attributes();
|
||||
child->name = attrs.value("Dname").toString();
|
||||
while (in.readNextStartElement()) {
|
||||
const QStringRef elementName = in.name();
|
||||
const auto elementName = in.name();
|
||||
if (elementName == "processor") {
|
||||
fillCpu(in, child->cpu);
|
||||
} else if (elementName == "debug") {
|
||||
@@ -371,7 +371,7 @@ void DeviceSelectionModel::parseDeviceVariant(QXmlStreamReader &in, DeviceSelect
|
||||
const QXmlStreamAttributes attrs = in.attributes();
|
||||
child->name = attrs.value("Dvariant").toString();
|
||||
while (in.readNextStartElement()) {
|
||||
const QStringRef elementName = in.name();
|
||||
const auto elementName = in.name();
|
||||
if (elementName == "processor") {
|
||||
fillCpu(in, child->cpu);
|
||||
} else if (elementName == "memory") {
|
||||
|
@@ -630,8 +630,8 @@ static QString extractVersion(const QString &toolsFile, const QString §ion)
|
||||
switch (state) {
|
||||
case Enter:
|
||||
if (hasSection) {
|
||||
const auto content = line.midRef(firstBracket + 1,
|
||||
lastBracket - firstBracket - 1);
|
||||
const auto content = QStringView(line).mid(firstBracket + 1,
|
||||
lastBracket - firstBracket - 1);
|
||||
if (content == section)
|
||||
state = Lookup;
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ static bool lineIsEmpty(const QString &line)
|
||||
|
||||
static int paranthesesLevel(const QString &line)
|
||||
{
|
||||
const QStringRef beforeComment = line.midRef(0, line.indexOf(QLatin1Char('#')));
|
||||
const QString beforeComment = line.mid(0, line.indexOf(QLatin1Char('#')));
|
||||
const int opening = beforeComment.count(QLatin1Char('('));
|
||||
const int closing = beforeComment.count(QLatin1Char(')'));
|
||||
if (opening == closing)
|
||||
|
@@ -84,7 +84,7 @@ void CMakeTargetLocatorFilter::prepareSearch(const QString &entry)
|
||||
|
||||
Core::LocatorFilterEntry filterEntry(this, target.title, extraData);
|
||||
filterEntry.extraInfo = path.shortNativePath();
|
||||
filterEntry.highlightInfo = {index, entry.length()};
|
||||
filterEntry.highlightInfo = {index, int(entry.length())};
|
||||
filterEntry.fileName = path.toString();
|
||||
|
||||
m_result.append(filterEntry);
|
||||
|
@@ -437,7 +437,7 @@ void IosDeviceToolHandlerPrivate::processXml()
|
||||
// until the corresponding EndElement. Attributes are reported in attributes(),
|
||||
// namespace declarations in namespaceDeclarations().
|
||||
{
|
||||
QStringRef elName = outputParser.name();
|
||||
const auto elName = outputParser.name();
|
||||
if (elName == QLatin1String("msg")) {
|
||||
stack.append(ParserState(ParserState::Msg));
|
||||
} else if (elName == QLatin1String("exit")) {
|
||||
@@ -472,7 +472,7 @@ void IosDeviceToolHandlerPrivate::processXml()
|
||||
} else if (elName == QLatin1String("app_started")) {
|
||||
stack.append(ParserState(ParserState::AppStarted));
|
||||
QXmlStreamAttributes attributes = outputParser.attributes();
|
||||
QStringRef statusStr = attributes.value(QLatin1String("status"));
|
||||
const auto statusStr = attributes.value(QLatin1String("status"));
|
||||
Ios::IosToolHandler::OpStatus status = Ios::IosToolHandler::Unknown;
|
||||
if (statusStr.compare(QLatin1String("success"), Qt::CaseInsensitive) == 0)
|
||||
status = Ios::IosToolHandler::Success;
|
||||
@@ -482,7 +482,7 @@ void IosDeviceToolHandlerPrivate::processXml()
|
||||
} else if (elName == QLatin1String("app_transfer")) {
|
||||
stack.append(ParserState(ParserState::AppTransfer));
|
||||
QXmlStreamAttributes attributes = outputParser.attributes();
|
||||
QStringRef statusStr = attributes.value(QLatin1String("status"));
|
||||
const auto statusStr = attributes.value(QLatin1String("status"));
|
||||
Ios::IosToolHandler::OpStatus status = Ios::IosToolHandler::Unknown;
|
||||
if (statusStr.compare(QLatin1String("success"), Qt::CaseInsensitive) == 0)
|
||||
status = Ios::IosToolHandler::Success;
|
||||
|
@@ -455,7 +455,7 @@ Abi Abi::abiFromTargetTriplet(const QString &triple)
|
||||
if (machine.isEmpty())
|
||||
return Abi();
|
||||
|
||||
const QVector<QStringRef> parts = machine.splitRef(QRegularExpression("[ /-]"));
|
||||
const QStringList parts = machine.split(QRegularExpression("[ /-]"));
|
||||
|
||||
Architecture arch = UnknownArchitecture;
|
||||
OS os = UnknownOS;
|
||||
@@ -464,7 +464,7 @@ Abi Abi::abiFromTargetTriplet(const QString &triple)
|
||||
unsigned char width = 0;
|
||||
int unknownCount = 0;
|
||||
|
||||
for (const QStringRef &p : parts) {
|
||||
for (const QString &p : parts) {
|
||||
if (p == "unknown" || p == "pc"
|
||||
|| p == "gnu" || p == "uclibc"
|
||||
|| p == "86_64" || p == "redhat"
|
||||
@@ -881,7 +881,7 @@ QString Abi::toString(int w)
|
||||
Abi Abi::fromString(const QString &abiString)
|
||||
{
|
||||
Abi::Architecture architecture = UnknownArchitecture;
|
||||
const QVector<QStringRef> abiParts = abiString.splitRef('-');
|
||||
const QStringList abiParts = abiString.split('-');
|
||||
if (!abiParts.isEmpty()) {
|
||||
architecture = architectureFromString(abiParts.at(0));
|
||||
if (abiParts.at(0) != toString(architecture))
|
||||
@@ -919,7 +919,7 @@ Abi Abi::fromString(const QString &abiString)
|
||||
return Abi(architecture, os, flavor, format, wordWidth);
|
||||
}
|
||||
|
||||
Abi::Architecture Abi::architectureFromString(const QStringRef &a)
|
||||
Abi::Architecture Abi::architectureFromString(const QString &a)
|
||||
{
|
||||
if (a == "unknown")
|
||||
return UnknownArchitecture;
|
||||
@@ -983,7 +983,7 @@ Abi::Architecture Abi::architectureFromString(const QStringRef &a)
|
||||
return UnknownArchitecture;
|
||||
}
|
||||
|
||||
Abi::OS Abi::osFromString(const QStringRef &o)
|
||||
Abi::OS Abi::osFromString(const QString &o)
|
||||
{
|
||||
if (o == "unknown")
|
||||
return UnknownOS;
|
||||
@@ -1006,7 +1006,7 @@ Abi::OS Abi::osFromString(const QStringRef &o)
|
||||
return UnknownOS;
|
||||
}
|
||||
|
||||
Abi::OSFlavor Abi::osFlavorFromString(const QStringRef &of, const OS os)
|
||||
Abi::OSFlavor Abi::osFlavorFromString(const QString &of, const OS os)
|
||||
{
|
||||
const int index = indexOfFlavor(of.toUtf8());
|
||||
const auto flavor = OSFlavor(index);
|
||||
@@ -1015,7 +1015,7 @@ Abi::OSFlavor Abi::osFlavorFromString(const QStringRef &of, const OS os)
|
||||
return UnknownFlavor;
|
||||
}
|
||||
|
||||
Abi::BinaryFormat Abi::binaryFormatFromString(const QStringRef &bf)
|
||||
Abi::BinaryFormat Abi::binaryFormatFromString(const QString &bf)
|
||||
{
|
||||
if (bf == "unknown")
|
||||
return UnknownFormat;
|
||||
@@ -1036,13 +1036,13 @@ Abi::BinaryFormat Abi::binaryFormatFromString(const QStringRef &bf)
|
||||
return UnknownFormat;
|
||||
}
|
||||
|
||||
unsigned char Abi::wordWidthFromString(const QStringRef &w)
|
||||
unsigned char Abi::wordWidthFromString(const QString &w)
|
||||
{
|
||||
if (!w.endsWith("bit"))
|
||||
return 0;
|
||||
|
||||
bool ok = false;
|
||||
const QStringRef number = w.string()->midRef(w.position(), w.count() - 3);
|
||||
const QString number = w.left(w.size() - 3);
|
||||
const int bitCount = number.toInt(&ok);
|
||||
if (!ok)
|
||||
return 0;
|
||||
@@ -1187,7 +1187,7 @@ Abis Abi::abisOfBinary(const Utils::FilePath &path)
|
||||
const QString fileName = QString::fromLocal8Bit(data.mid(0, 16));
|
||||
quint64 fileNameOffset = 0;
|
||||
if (fileName.startsWith("#1/"))
|
||||
fileNameOffset = fileName.midRef(3).toInt();
|
||||
fileNameOffset = fileName.mid(3).toInt();
|
||||
const QString fileLength = QString::fromLatin1(data.mid(48, 10));
|
||||
|
||||
int toSkip = 60 + fileNameOffset;
|
||||
@@ -1237,19 +1237,19 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiRoundTrips()
|
||||
{
|
||||
for (int i = 0; i <= Abi::UnknownArchitecture; ++i) {
|
||||
const QString string = Abi::toString(static_cast<Abi::Architecture>(i));
|
||||
const Abi::Architecture arch = Abi::architectureFromString(QStringRef(&string));
|
||||
const Abi::Architecture arch = Abi::architectureFromString(string);
|
||||
QCOMPARE(static_cast<Abi::Architecture>(i), arch);
|
||||
}
|
||||
for (int i = 0; i <= Abi::UnknownOS; ++i) {
|
||||
const QString string = Abi::toString(static_cast<Abi::OS>(i));
|
||||
const Abi::OS os = Abi::osFromString(QStringRef(&string));
|
||||
const Abi::OS os = Abi::osFromString(string);
|
||||
QCOMPARE(static_cast<Abi::OS>(i), os);
|
||||
}
|
||||
for (const Abi::OSFlavor flavorIt : Abi::allOsFlavors()) {
|
||||
const QString string = Abi::toString(flavorIt);
|
||||
for (int os = 0; os <= Abi::UnknownOS; ++os) {
|
||||
const auto osEnum = static_cast<Abi::OS>(os);
|
||||
const Abi::OSFlavor flavor = Abi::osFlavorFromString(QStringRef(&string), osEnum);
|
||||
const Abi::OSFlavor flavor = Abi::osFlavorFromString(string, osEnum);
|
||||
if (isGenericFlavor(flavorIt) && flavor != Abi::UnknownFlavor)
|
||||
QVERIFY(isGenericFlavor(flavor));
|
||||
else if (flavor == Abi::UnknownFlavor && flavorIt != Abi::UnknownFlavor)
|
||||
@@ -1260,12 +1260,12 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiRoundTrips()
|
||||
}
|
||||
for (int i = 0; i <= Abi::UnknownFormat; ++i) {
|
||||
QString string = Abi::toString(static_cast<Abi::BinaryFormat>(i));
|
||||
Abi::BinaryFormat format = Abi::binaryFormatFromString(QStringRef(&string));
|
||||
Abi::BinaryFormat format = Abi::binaryFormatFromString(string);
|
||||
QCOMPARE(static_cast<Abi::BinaryFormat>(i), format);
|
||||
}
|
||||
for (unsigned char i : {0, 8, 16, 32, 64}) {
|
||||
QString string = Abi::toString(i);
|
||||
unsigned char wordwidth = Abi::wordWidthFromString(QStringRef(&string));
|
||||
unsigned char wordwidth = Abi::wordWidthFromString(string);
|
||||
QCOMPARE(i, wordwidth);
|
||||
}
|
||||
}
|
||||
|
@@ -168,11 +168,11 @@ public:
|
||||
static QString toString(const BinaryFormat &bf);
|
||||
static QString toString(int w);
|
||||
|
||||
static Architecture architectureFromString(const QStringRef &a);
|
||||
static OS osFromString(const QStringRef &o);
|
||||
static OSFlavor osFlavorFromString(const QStringRef &of, const OS os);
|
||||
static BinaryFormat binaryFormatFromString(const QStringRef &bf);
|
||||
static unsigned char wordWidthFromString(const QStringRef &w);
|
||||
static Architecture architectureFromString(const QString &a);
|
||||
static OS osFromString(const QString &o);
|
||||
static OSFlavor osFlavorFromString(const QString &of, const OS os);
|
||||
static BinaryFormat binaryFormatFromString(const QString &bf);
|
||||
static unsigned char wordWidthFromString(const QString &w);
|
||||
|
||||
static OSFlavor registerOsFlavor(const std::vector<OS> &oses, const QString &flavorName);
|
||||
static QList<OSFlavor> flavorsForOs(const OS &o);
|
||||
|
@@ -247,7 +247,7 @@ static inline bool assignLanguageElementText(QXmlStreamReader &reader,
|
||||
const QString &desiredLanguage,
|
||||
QString *target)
|
||||
{
|
||||
const QStringRef elementLanguage = reader.attributes().value(QLatin1String(langAttributeC));
|
||||
const auto elementLanguage = reader.attributes().value(QLatin1String(langAttributeC));
|
||||
if (elementLanguage.isEmpty()) {
|
||||
// Try to find a translation for our built-in Wizards
|
||||
*target = QCoreApplication::translate("ProjectExplorer::CustomWizard", reader.readElementText().toLatin1().constData());
|
||||
@@ -268,7 +268,7 @@ static bool parseCustomProjectElement(QXmlStreamReader &reader,
|
||||
const QString &language,
|
||||
CustomWizardParameters *p)
|
||||
{
|
||||
const QStringRef elementName = reader.name();
|
||||
const auto elementName = reader.name();
|
||||
if (elementName == QLatin1String(iconElementC)) {
|
||||
const QString path = reader.readElementText();
|
||||
const QIcon icon = wizardIcon(configFileFullPath, path);
|
||||
@@ -308,7 +308,7 @@ static inline QMap<QString, QString> attributesToStringMap(const QXmlStreamAttri
|
||||
}
|
||||
|
||||
// Switch parser state depending on opening element name.
|
||||
static ParseState nextOpeningState(ParseState in, const QStringRef &name)
|
||||
static ParseState nextOpeningState(ParseState in, const QStringView &name)
|
||||
{
|
||||
switch (in) {
|
||||
case ParseBeginning:
|
||||
@@ -375,7 +375,7 @@ static ParseState nextOpeningState(ParseState in, const QStringRef &name)
|
||||
}
|
||||
|
||||
// Switch parser state depending on closing element name.
|
||||
static ParseState nextClosingState(ParseState in, const QStringRef &name)
|
||||
static ParseState nextClosingState(ParseState in, const QStringView &name)
|
||||
{
|
||||
switch (in) {
|
||||
case ParseBeginning:
|
||||
@@ -443,7 +443,7 @@ static ParseState nextClosingState(ParseState in, const QStringRef &name)
|
||||
// Parse kind attribute
|
||||
static inline IWizardFactory::WizardKind kindAttribute(const QXmlStreamReader &r)
|
||||
{
|
||||
const QStringRef value = r.attributes().value(QLatin1String(kindAttributeC));
|
||||
const auto value = r.attributes().value(QLatin1String(kindAttributeC));
|
||||
if (value == QLatin1String("file") || value == QLatin1String("class"))
|
||||
return IWizardFactory::FileWizard;
|
||||
return IWizardFactory::ProjectWizard;
|
||||
@@ -462,7 +462,7 @@ static inline QSet<Id> readRequiredFeatures(const QXmlStreamReader &reader)
|
||||
static inline IWizardFactory::WizardFlags wizardFlags(const QXmlStreamReader &reader)
|
||||
{
|
||||
IWizardFactory::WizardFlags flags;
|
||||
const QStringRef value = reader.attributes().value(QLatin1String(platformIndependentC));
|
||||
const auto value = reader.attributes().value(QLatin1String(platformIndependentC));
|
||||
|
||||
if (!value.isEmpty() && value == QLatin1String("true"))
|
||||
flags |= IWizardFactory::PlatformIndependent;
|
||||
@@ -481,7 +481,7 @@ static inline QString msgError(const QXmlStreamReader &reader,
|
||||
static inline bool booleanAttributeValue(const QXmlStreamReader &r, const char *nameC,
|
||||
bool defaultValue)
|
||||
{
|
||||
const QStringRef attributeValue = r.attributes().value(QLatin1String(nameC));
|
||||
const auto attributeValue = r.attributes().value(QLatin1String(nameC));
|
||||
if (attributeValue.isEmpty())
|
||||
return defaultValue;
|
||||
return attributeValue == QLatin1String("true");
|
||||
@@ -489,7 +489,7 @@ static inline bool booleanAttributeValue(const QXmlStreamReader &r, const char *
|
||||
|
||||
static inline int integerAttributeValue(const QXmlStreamReader &r, const char *name, int defaultValue)
|
||||
{
|
||||
const QStringRef sValue = r.attributes().value(QLatin1String(name));
|
||||
const auto sValue = r.attributes().value(QLatin1String(name));
|
||||
if (sValue.isEmpty())
|
||||
return defaultValue;
|
||||
bool ok;
|
||||
|
@@ -174,7 +174,7 @@ static QList<DeviceProcessItem> getLocalProcessesUsingPs()
|
||||
if (cmdSep > 0) {
|
||||
const int argsSep = line.indexOf(blank, cmdSep + 1);
|
||||
DeviceProcessItem procData;
|
||||
procData.pid = line.leftRef(pidSep).toInt();
|
||||
procData.pid = line.left(pidSep).toInt();
|
||||
procData.cmdLine = line.mid(cmdSep + 1);
|
||||
if (argsSep == -1)
|
||||
procData.exe = line.mid(cmdSep + 1);
|
||||
|
@@ -25,6 +25,8 @@
|
||||
|
||||
#include "expanddata.h"
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
|
||||
|
@@ -86,7 +86,7 @@ void ExtraAbi::load()
|
||||
const QStringList osNames = it.value().toStringList();
|
||||
std::vector<Abi::OS> oses;
|
||||
for (const QString &osName : osNames) {
|
||||
Abi::OS os = Abi::osFromString(&osName);
|
||||
Abi::OS os = Abi::osFromString(osName);
|
||||
if (Abi::toString(os) != osName)
|
||||
qWarning() << "Invalid OS found when registering extra abi flavor" << it.key();
|
||||
else
|
||||
|
@@ -51,7 +51,7 @@ static QPair<FilePath, int> parseFileName(const QString &input)
|
||||
if (endPos < 0)
|
||||
endPos = fileName.size() - 1;
|
||||
bool ok = false;
|
||||
const int n = fileName.midRef(pos + 1, endPos - pos - 1).toInt(&ok);
|
||||
const int n = fileName.mid(pos + 1, endPos - pos - 1).toInt(&ok);
|
||||
if (ok) {
|
||||
fileName = fileName.left(pos);
|
||||
linenumber = n;
|
||||
|
@@ -2117,9 +2117,9 @@ MsvcToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag, WarningFl
|
||||
}
|
||||
bool ok = false;
|
||||
if (m_doesEnable)
|
||||
m_warningCode = flag.midRef(2).toInt(&ok);
|
||||
m_warningCode = flag.mid(2).toInt(&ok);
|
||||
else
|
||||
m_warningCode = flag.midRef(3).toInt(&ok);
|
||||
m_warningCode = flag.mid(3).toInt(&ok);
|
||||
if (!ok)
|
||||
m_triggered = true;
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ static inline QString xmlFromClassName(const QString &name)
|
||||
if (!name.isEmpty()) {
|
||||
rc += name.left(1).toLower();
|
||||
if (name.size() > 1)
|
||||
rc += name.midRef(1);
|
||||
rc += name.mid(1);
|
||||
}
|
||||
rc += QLatin1String("\">\n</widget>\n");
|
||||
return rc;
|
||||
|
@@ -782,7 +782,10 @@ QPair<ProFile *, QStringList> QmakePriFile::readProFile()
|
||||
QMakeVfs vfs;
|
||||
QtSupport::ProMessageHandler handler;
|
||||
QMakeParser parser(nullptr, &vfs, &handler);
|
||||
includeFile = parser.parsedProBlock(QStringRef(&contents), 0, filePath().toString(), 1);
|
||||
includeFile = parser.parsedProBlock(Utils::make_stringview(contents),
|
||||
0,
|
||||
filePath().toString(),
|
||||
1);
|
||||
}
|
||||
return qMakePair(includeFile, lines);
|
||||
}
|
||||
@@ -828,13 +831,11 @@ bool QmakePriFile::renameFile(const QString &oldName, const QString &newName, Ch
|
||||
|
||||
// Reparse necessary due to changed contents.
|
||||
QMakeParser parser(nullptr, nullptr, nullptr);
|
||||
ProFile * const proFile = parser.parsedProBlock(
|
||||
QStringRef(¤tContents),
|
||||
0,
|
||||
filePath().toString(),
|
||||
1,
|
||||
QMakeParser::FullGrammar
|
||||
);
|
||||
ProFile *const proFile = parser.parsedProBlock(Utils::make_stringview(currentContents),
|
||||
0,
|
||||
filePath().toString(),
|
||||
1,
|
||||
QMakeParser::FullGrammar);
|
||||
QTC_ASSERT(proFile, return); // The file should still be valid after what we did.
|
||||
|
||||
ProWriter::addFiles(proFile, ¤tLines, {newName}, loc.first, continuationIndent());
|
||||
|
@@ -97,7 +97,7 @@ private:
|
||||
continue;
|
||||
}
|
||||
bool ok;
|
||||
const int pid = elements.first().midRef(6).toInt(&ok);
|
||||
const int pid = elements.first().mid(6).toInt(&ok);
|
||||
if (!ok) {
|
||||
qDebug("%s: Expected number in %s. Line was '%s'.", Q_FUNC_INFO,
|
||||
qPrintable(elements.first()), qPrintable(visualizeNull(line)));
|
||||
|
@@ -799,7 +799,7 @@ void IosDeviceManagerPrivate::deviceWithId(QString deviceId, int timeout,
|
||||
pendingLookup->timer.setSingleShot(true);
|
||||
pendingLookup->timer.setInterval(timeout);
|
||||
QObject::connect(&(pendingLookup->timer), &QTimer::timeout, q, &IosDeviceManager::checkPendingLookups);
|
||||
m_pendingLookups.insertMulti(deviceId, pendingLookup);
|
||||
m_pendingLookups.insert(deviceId, pendingLookup);
|
||||
pendingLookup->timer.start();
|
||||
}
|
||||
enum GdbServerStatus {
|
||||
|
@@ -521,7 +521,6 @@ IosTool::IosTool(QObject *parent):
|
||||
{
|
||||
outFile.open(stdout, QIODevice::WriteOnly, QFileDevice::DontCloseHandle);
|
||||
out.setAutoFormatting(true);
|
||||
out.setCodec("UTF-8");
|
||||
}
|
||||
|
||||
IosTool::~IosTool()
|
||||
|
Reference in New Issue
Block a user