forked from qt-creator/qt-creator
Fix a few {QByteArray,QList}::count related deprecation warnings
Change-Id: I493e557a2ec976560c9e37312d8ae860490a2831 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -91,7 +91,7 @@ int HighlightingItemDelegate::drawLineNumber(QPainter *painter, const QStyleOpti
|
|||||||
return 0;
|
return 0;
|
||||||
const bool isSelected = option.state & QStyle::State_Selected;
|
const bool isSelected = option.state & QStyle::State_Selected;
|
||||||
const QString lineText = QString::number(lineNumber);
|
const QString lineText = QString::number(lineNumber);
|
||||||
const int minimumLineNumberDigits = qMax(kMinimumLineNumberDigits, lineText.count());
|
const int minimumLineNumberDigits = qMax(kMinimumLineNumberDigits, lineText.size());
|
||||||
const int fontWidth =
|
const int fontWidth =
|
||||||
painter->fontMetrics().horizontalAdvance(QString(minimumLineNumberDigits, '0'));
|
painter->fontMetrics().horizontalAdvance(QString(minimumLineNumberDigits, '0'));
|
||||||
const int lineNumberAreaWidth = lineNumberAreaHorizontalPadding + fontWidth
|
const int lineNumberAreaWidth = lineNumberAreaHorizontalPadding + fontWidth
|
||||||
|
@@ -91,12 +91,12 @@ DiffSelections SelectableTextEditorWidget::polishedSelections(const DiffSelectio
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
while (j < workingList.count()) {
|
while (j < workingList.size()) {
|
||||||
const DiffSelection existingSelection = workingList.takeAt(j);
|
const DiffSelection existingSelection = workingList.takeAt(j);
|
||||||
const QList<DiffSelection> newSelection = subtractSelection(existingSelection, diffSelection);
|
const QList<DiffSelection> newSelection = subtractSelection(existingSelection, diffSelection);
|
||||||
for (int k = 0; k < newSelection.count(); k++)
|
for (int k = 0; k < newSelection.size(); k++)
|
||||||
workingList.insert(j + k, newSelection.at(k));
|
workingList.insert(j + k, newSelection.at(k));
|
||||||
j += newSelection.count();
|
j += newSelection.size();
|
||||||
}
|
}
|
||||||
workingList.append(diffSelection);
|
workingList.append(diffSelection);
|
||||||
}
|
}
|
||||||
@@ -126,8 +126,8 @@ void SelectableTextEditorWidget::paintBlock(QPainter *painter,
|
|||||||
QTextLayout::FormatRange formatRange;
|
QTextLayout::FormatRange formatRange;
|
||||||
formatRange.start = qMax(0, diffSelection.start);
|
formatRange.start = qMax(0, diffSelection.start);
|
||||||
const int end = diffSelection.end < 0
|
const int end = diffSelection.end < 0
|
||||||
? block.text().count() + 1
|
? block.text().size() + 1
|
||||||
: qMin(block.text().count(), diffSelection.end);
|
: qMin(block.text().size(), diffSelection.end);
|
||||||
|
|
||||||
formatRange.length = end - formatRange.start;
|
formatRange.length = end - formatRange.start;
|
||||||
formatRange.format = *diffSelection.format;
|
formatRange.format = *diffSelection.format;
|
||||||
|
@@ -1626,7 +1626,7 @@ QString GitClient::synchronousCurrentLocalBranch(const FilePath &workingDirector
|
|||||||
if (!branch.isEmpty()) {
|
if (!branch.isEmpty()) {
|
||||||
const QString refsHeadsPrefix = "refs/heads/";
|
const QString refsHeadsPrefix = "refs/heads/";
|
||||||
if (branch.startsWith(refsHeadsPrefix)) {
|
if (branch.startsWith(refsHeadsPrefix)) {
|
||||||
branch.remove(0, refsHeadsPrefix.count());
|
branch.remove(0, refsHeadsPrefix.size());
|
||||||
return branch;
|
return branch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -230,7 +230,7 @@ bool QtVersionManagerImpl::restoreQtVersions()
|
|||||||
if (!key.view().startsWith(keyPrefix))
|
if (!key.view().startsWith(keyPrefix))
|
||||||
continue;
|
continue;
|
||||||
bool ok;
|
bool ok;
|
||||||
int count = key.toByteArray().mid(keyPrefix.count()).toInt(&ok);
|
int count = key.toByteArray().mid(keyPrefix.size()).toInt(&ok);
|
||||||
if (!ok || count < 0)
|
if (!ok || count < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ void QtVersionManagerImpl::updateFromInstaller(bool emitSignal)
|
|||||||
if (!key.view().startsWith(keyPrefix))
|
if (!key.view().startsWith(keyPrefix))
|
||||||
continue;
|
continue;
|
||||||
bool ok;
|
bool ok;
|
||||||
int count = key.toByteArray().mid(keyPrefix.count()).toInt(&ok);
|
int count = key.toByteArray().mid(keyPrefix.size()).toInt(&ok);
|
||||||
if (!ok || count < 0)
|
if (!ok || count < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@@ -9057,7 +9057,7 @@ QMimeData *TextEditorWidget::createMimeDataFromSelection(bool withHtml) const
|
|||||||
} else {
|
} else {
|
||||||
const int startPosition = current.position() - selectionStart
|
const int startPosition = current.position() - selectionStart
|
||||||
- removedCount;
|
- removedCount;
|
||||||
int endPosition = startPosition + current.text().count();
|
int endPosition = startPosition + current.text().size();
|
||||||
if (current != last)
|
if (current != last)
|
||||||
endPosition++;
|
endPosition++;
|
||||||
removedCount += endPosition - startPosition;
|
removedCount += endPosition - startPosition;
|
||||||
|
@@ -125,7 +125,7 @@ QStringList VcsBaseClientImpl::splitLines(const QString &s)
|
|||||||
QString VcsBaseClientImpl::stripLastNewline(const QString &in)
|
QString VcsBaseClientImpl::stripLastNewline(const QString &in)
|
||||||
{
|
{
|
||||||
if (in.endsWith('\n'))
|
if (in.endsWith('\n'))
|
||||||
return in.left(in.count() - 1);
|
return in.left(in.size() - 1);
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -190,7 +190,7 @@ bool AddKitOperation::setArguments(const QStringList &args)
|
|||||||
++i; // skip next;
|
++i; // skip next;
|
||||||
|
|
||||||
const QString tmp = current.mid(2);
|
const QString tmp = current.mid(2);
|
||||||
const QString tmp2 = tmp.mid(0, tmp.count() - 9 /* toolchain */);
|
const QString tmp2 = tmp.mid(0, tmp.size() - 9 /* toolchain */);
|
||||||
const QString lang = tmp2.isEmpty() ? QString("Cxx") : tmp2;
|
const QString lang = tmp2.isEmpty() ? QString("Cxx") : tmp2;
|
||||||
|
|
||||||
if (next.isEmpty()) {
|
if (next.isEmpty()) {
|
||||||
|
Reference in New Issue
Block a user