forked from qt-creator/qt-creator
Fix some more *::count() deprecation warnings
Change-Id: Ib7d1552a6f7b167e15beb7ca1ef26c7d57e090e9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -133,7 +133,7 @@ bool FileSaverBase::write(const QByteArray &bytes)
|
||||
{
|
||||
if (m_hasError)
|
||||
return false;
|
||||
return setResult(m_file->write(bytes) == bytes.count());
|
||||
return setResult(m_file->write(bytes) == bytes.size());
|
||||
}
|
||||
|
||||
bool FileSaverBase::setResult(bool ok)
|
||||
|
@@ -77,7 +77,7 @@ public:
|
||||
MacroExpander::PrefixFunction pf = it.value();
|
||||
if (found)
|
||||
*found = true;
|
||||
return pf(QString::fromUtf8(variable.mid(it.key().count())));
|
||||
return pf(QString::fromUtf8(variable.mid(it.key().size())));
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
|
@@ -272,10 +272,10 @@ CMakeConfigItem CMakeConfigItem::fromString(const QString &s)
|
||||
|
||||
static QByteArray trimCMakeCacheLine(const QByteArray &in) {
|
||||
int start = 0;
|
||||
while (start < in.count() && (in.at(start) == ' ' || in.at(start) == '\t'))
|
||||
while (start < in.size() && (in.at(start) == ' ' || in.at(start) == '\t'))
|
||||
++start;
|
||||
|
||||
return in.mid(start, in.count() - start - 1);
|
||||
return in.mid(start, in.size() - start - 1);
|
||||
}
|
||||
|
||||
static QByteArrayList splitCMakeCacheLine(const QByteArray &line) {
|
||||
@@ -377,9 +377,9 @@ CMakeConfig CMakeConfig::fromFile(const Utils::FilePath &cacheFile, QString *err
|
||||
const QByteArray value = pieces.at(2);
|
||||
|
||||
if (key.endsWith("-ADVANCED") && value == "1") {
|
||||
advancedSet.insert(key.left(key.count() - 9 /* "-ADVANCED" */));
|
||||
advancedSet.insert(key.left(key.size() - 9 /* "-ADVANCED" */));
|
||||
} else if (key.endsWith("-STRINGS") && CMakeConfigItem::typeStringToType(type) == CMakeConfigItem::INTERNAL) {
|
||||
valuesMap[key.left(key.count() - 8) /* "-STRINGS" */] = value;
|
||||
valuesMap[key.left(key.size() - 8) /* "-STRINGS" */] = value;
|
||||
} else {
|
||||
CMakeConfigItem::Type t = CMakeConfigItem::typeStringToType(type);
|
||||
result << CMakeConfigItem(key, t, documentation, value);
|
||||
|
@@ -431,7 +431,7 @@ static QVector<ToolChainDescription> extractToolChainsFromCache(const CMakeConfi
|
||||
for (const CMakeConfigItem &i : config) {
|
||||
if (!i.key.startsWith("CMAKE_") || !i.key.endsWith("_COMPILER"))
|
||||
continue;
|
||||
const QByteArray language = i.key.mid(6, i.key.count() - 6 - 9); // skip "CMAKE_" and "_COMPILER"
|
||||
const QByteArray language = i.key.mid(6, i.key.size() - 6 - 9); // skip "CMAKE_" and "_COMPILER"
|
||||
Id languageId;
|
||||
if (language == "CXX") {
|
||||
haveCCxxCompiler = true;
|
||||
|
@@ -73,8 +73,8 @@ QByteArray encodeBreakPoint(BKTYPE type, const QString &exp, const QString &cmd)
|
||||
bkPtr->type = type;
|
||||
bkPtr->count = 1;
|
||||
bkPtr->accessSize = 0;
|
||||
bkPtr->expressionLength = asciiExp.count() + 1;
|
||||
bkPtr->commandLength = asciiCmd.count() + 1;
|
||||
bkPtr->expressionLength = asciiExp.size() + 1;
|
||||
bkPtr->commandLength = asciiCmd.size() + 1;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ QString adjustHexValue(QString hex, const QString &type)
|
||||
return QString::number(v);
|
||||
} else {
|
||||
const bool isUnsigned = type.startsWith("unsigned");
|
||||
switch (data.count()) {
|
||||
switch (data.size()) {
|
||||
case 1:
|
||||
if (isUnsigned) {
|
||||
quint8 v = 0;
|
||||
|
@@ -2101,8 +2101,7 @@ static QByteArray scanQtBinaryForBuildString(const FilePath &library)
|
||||
|
||||
static QStringList extractFieldsFromBuildString(const QByteArray &buildString)
|
||||
{
|
||||
if (buildString.isEmpty()
|
||||
|| buildString.count() > 4096)
|
||||
if (buildString.isEmpty() || buildString.size() > 4096)
|
||||
return QStringList();
|
||||
|
||||
const QRegularExpression buildStringMatcher("^Qt "
|
||||
|
@@ -581,7 +581,7 @@ void ObjectNodeInstance::refreshProperty(const PropertyName &name)
|
||||
|
||||
if (oldValue.type() == QVariant::Url) {
|
||||
QByteArray key = oldValue.toUrl().toEncoded(QUrl::UrlFormattingOption(0x100));
|
||||
QString pixmapKey = QString::fromUtf8(key.constData(), key.count());
|
||||
QString pixmapKey = QString::fromUtf8(key.constData(), key.size());
|
||||
QPixmapCache::remove(pixmapKey);
|
||||
}
|
||||
|
||||
|
@@ -316,7 +316,7 @@ bool SdkFileSaverBase::write(const QByteArray &bytes)
|
||||
{
|
||||
if (m_hasError)
|
||||
return false;
|
||||
return setResult(m_file->write(bytes) == bytes.count());
|
||||
return setResult(m_file->write(bytes) == bytes.size());
|
||||
}
|
||||
|
||||
bool SdkFileSaverBase::setResult(bool ok)
|
||||
|
Reference in New Issue
Block a user