forked from qt-creator/qt-creator
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -413,7 +413,7 @@ void NodeInstanceClientProxy::readDataStream()
|
||||
break;
|
||||
}
|
||||
|
||||
for (const QVariant &command : qAsConst(commandList))
|
||||
for (const QVariant &command : std::as_const(commandList))
|
||||
dispatchCommand(command);
|
||||
}
|
||||
|
||||
|
@@ -206,7 +206,7 @@ QVector4D GeneralHelper::focusNodesToCamera(QQuick3DCamera *camera, float defaul
|
||||
totalMinBound = {-halfExtent, -halfExtent, -halfExtent};
|
||||
totalMaxBound = {halfExtent, halfExtent, halfExtent};
|
||||
}
|
||||
for (const auto node : qAsConst(nodeList)) {
|
||||
for (const auto node : std::as_const(nodeList)) {
|
||||
auto model = qobject_cast<QQuick3DModel *>(node);
|
||||
qreal maxExtent = defaultExtent;
|
||||
QVector3D center = node->scenePosition();
|
||||
@@ -345,7 +345,7 @@ void GeneralHelper::alignCameras(QQuick3DCamera *camera, const QVariant &nodes)
|
||||
nodeList.append(cameraNode);
|
||||
}
|
||||
|
||||
for (QQuick3DCamera *node : qAsConst(nodeList)) {
|
||||
for (QQuick3DCamera *node : std::as_const(nodeList)) {
|
||||
node->setPosition(camera->position());
|
||||
node->setRotation(camera->rotation());
|
||||
}
|
||||
@@ -587,7 +587,7 @@ void GeneralHelper::setMultiSelectionTargets(QQuick3DNode *multiSelectRootNode,
|
||||
// Filter selection to contain only topmost parent nodes in the selection
|
||||
m_multiSelDataMap.clear();
|
||||
m_multiSelNodes.clear();
|
||||
for (auto &connection : qAsConst(m_multiSelectConnections))
|
||||
for (auto &connection : std::as_const(m_multiSelectConnections))
|
||||
disconnect(connection);
|
||||
m_multiSelectConnections.clear();
|
||||
m_multiSelectRootNode = multiSelectRootNode;
|
||||
@@ -599,7 +599,7 @@ void GeneralHelper::setMultiSelectionTargets(QQuick3DNode *multiSelectRootNode,
|
||||
if (node)
|
||||
selNodes.insert(node);
|
||||
}
|
||||
for (const auto selNode : qAsConst(selNodes)) {
|
||||
for (const auto selNode : std::as_const(selNodes)) {
|
||||
bool found = false;
|
||||
QQuick3DNode *parent = selNode->parentNode();
|
||||
while (parent) {
|
||||
@@ -617,7 +617,7 @@ void GeneralHelper::setMultiSelectionTargets(QQuick3DNode *multiSelectRootNode,
|
||||
// The new selection should be notified by creator immediately after anyway.
|
||||
m_multiSelDataMap.clear();
|
||||
m_multiSelNodes.clear();
|
||||
for (auto &connection : qAsConst(m_multiSelectConnections))
|
||||
for (auto &connection : std::as_const(m_multiSelectConnections))
|
||||
disconnect(connection);
|
||||
m_multiSelectConnections.clear();
|
||||
}));
|
||||
@@ -643,7 +643,7 @@ void GeneralHelper::resetMultiSelectionNode()
|
||||
|
||||
m_multiSelNodeData = {};
|
||||
if (!m_multiSelDataMap.isEmpty()) {
|
||||
for (const auto &data : qAsConst(m_multiSelDataMap))
|
||||
for (const auto &data : std::as_const(m_multiSelDataMap))
|
||||
m_multiSelNodeData.startScenePos += data.startScenePos;
|
||||
m_multiSelNodeData.startScenePos /= m_multiSelDataMap.size();
|
||||
}
|
||||
@@ -880,9 +880,9 @@ bool GeneralHelper::getBounds(QQuick3DViewport *view3D, QQuick3DNode *node, QVec
|
||||
};
|
||||
|
||||
// Combine all child bounds
|
||||
for (const auto &newBounds : qAsConst(minBoundsVec))
|
||||
for (const auto &newBounds : std::as_const(minBoundsVec))
|
||||
combineMinBounds(localMinBounds, newBounds);
|
||||
for (const auto &newBounds : qAsConst(maxBoundsVec))
|
||||
for (const auto &newBounds : std::as_const(maxBoundsVec))
|
||||
combineMaxBounds(localMaxBounds, newBounds);
|
||||
|
||||
if (qobject_cast<QQuick3DModel *>(node)) {
|
||||
|
@@ -31,7 +31,7 @@ SelectionBoxGeometry::SelectionBoxGeometry()
|
||||
|
||||
SelectionBoxGeometry::~SelectionBoxGeometry()
|
||||
{
|
||||
for (auto &connection : qAsConst(m_connections))
|
||||
for (auto &connection : std::as_const(m_connections))
|
||||
QObject::disconnect(connection);
|
||||
m_connections.clear();
|
||||
}
|
||||
@@ -145,7 +145,7 @@ void SelectionBoxGeometry::doUpdateGeometry()
|
||||
|
||||
GeometryBase::doUpdateGeometry();
|
||||
|
||||
for (auto &connection : qAsConst(m_connections))
|
||||
for (auto &connection : std::as_const(m_connections))
|
||||
QObject::disconnect(connection);
|
||||
m_connections.clear();
|
||||
|
||||
@@ -278,9 +278,9 @@ void SelectionBoxGeometry::getBounds(
|
||||
};
|
||||
|
||||
// Combine all child bounds
|
||||
for (const auto &newBounds : qAsConst(minBoundsVec))
|
||||
for (const auto &newBounds : std::as_const(minBoundsVec))
|
||||
combineMinBounds(localMinBounds, newBounds);
|
||||
for (const auto &newBounds : qAsConst(maxBoundsVec))
|
||||
for (const auto &newBounds : std::as_const(maxBoundsVec))
|
||||
combineMaxBounds(localMaxBounds, newBounds);
|
||||
|
||||
if (qobject_cast<QQuick3DModel *>(node)) {
|
||||
|
@@ -1424,9 +1424,9 @@ Qt5InformationNodeInstanceServer::~Qt5InformationNodeInstanceServer()
|
||||
if (m_editView3DData.rootItem)
|
||||
m_editView3DData.rootItem->disconnect(this);
|
||||
|
||||
for (auto view : qAsConst(m_view3Ds))
|
||||
for (auto view : std::as_const(m_view3Ds))
|
||||
view->disconnect();
|
||||
for (auto node : qAsConst(m_3DSceneMap))
|
||||
for (auto node : std::as_const(m_3DSceneMap))
|
||||
node->disconnect();
|
||||
|
||||
if (m_editView3DData.rootItem)
|
||||
@@ -1720,7 +1720,7 @@ QObject *Qt5InformationNodeInstanceServer::findView3DForInstance(
|
||||
// If no ancestor View3D was found, check if the scene root is specified as importScene in
|
||||
// some View3D.
|
||||
QObject *sceneRoot = find3DSceneRoot(instance);
|
||||
for (const auto &view3D : qAsConst(m_view3Ds)) {
|
||||
for (const auto &view3D : std::as_const(m_view3Ds)) {
|
||||
auto view = qobject_cast<QQuick3DViewport *>(view3D);
|
||||
if (view && sceneRoot == view->importScene())
|
||||
return view3D;
|
||||
@@ -1740,7 +1740,7 @@ QObject *Qt5InformationNodeInstanceServer::findView3DForSceneRoot(
|
||||
return findView3DForInstance(instanceForObject(sceneRoot));
|
||||
} else {
|
||||
// No instance, so the scene root must be scene property of one of the views
|
||||
for (const auto &view3D : qAsConst(m_view3Ds)) {
|
||||
for (const auto &view3D : std::as_const(m_view3Ds)) {
|
||||
auto view = qobject_cast<QQuick3DViewport *>(view3D);
|
||||
if (view && sceneRoot == view->scene())
|
||||
return view3D;
|
||||
@@ -1825,7 +1825,7 @@ QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot([[maybe_unused]] QObj
|
||||
return find3DSceneRoot(instanceForObject(obj));
|
||||
|
||||
// If there is no instance, obj could be a scene in a View3D
|
||||
for (const auto &viewObj : qAsConst(m_view3Ds)) {
|
||||
for (const auto &viewObj : std::as_const(m_view3Ds)) {
|
||||
const auto view = qobject_cast<QQuick3DViewport *>(viewObj);
|
||||
if (view && view->scene() == obj)
|
||||
return obj;
|
||||
@@ -2684,7 +2684,7 @@ void Qt5InformationNodeInstanceServer::handlePickTarget(
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto childItem : qAsConst(childItems)) {
|
||||
for (auto childItem : std::as_const(childItems)) {
|
||||
if (!hasInstanceForObject(childItem)) {
|
||||
// Children of components do not have instances, but will still need to be pickable
|
||||
// and redirect their pick to the component
|
||||
|
@@ -63,7 +63,7 @@ void Qt5PreviewNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
||||
stateInstances.append(instance.stateInstances());
|
||||
}
|
||||
|
||||
for (ServerNodeInstance instance : qAsConst(stateInstances)) {
|
||||
for (ServerNodeInstance instance : std::as_const(stateInstances)) {
|
||||
instance.activateState();
|
||||
QImage previewImage = renderPreviewImage();
|
||||
if (!previewImage.isNull())
|
||||
|
@@ -584,7 +584,7 @@ int main(int argc, char **argv)
|
||||
if (!overrideLanguage.isEmpty())
|
||||
uiLanguages.prepend(overrideLanguage);
|
||||
const QString &creatorTrPath = resourcePath() + "/translations";
|
||||
for (QString locale : qAsConst(uiLanguages)) {
|
||||
for (QString locale : std::as_const(uiLanguages)) {
|
||||
locale = QLocale(locale).name();
|
||||
if (translator.load("qtcreator_" + locale, creatorTrPath)) {
|
||||
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||
|
2
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
2
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
@@ -2019,7 +2019,7 @@ bool Bind::visit(SimpleDeclarationAST *ast)
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto &nameAndLoc : qAsConst(namesAndLocations)) {
|
||||
for (const auto &nameAndLoc : std::as_const(namesAndLocations)) {
|
||||
const int sourceLocation = nameAndLoc.second;
|
||||
Declaration *decl = control()->newDeclaration(sourceLocation, nameAndLoc.first);
|
||||
if (const Type * const t = declTy.type(); t && declTy.isTypedef() && t->asClassType()
|
||||
|
@@ -381,7 +381,7 @@ namespace ADS
|
||||
{
|
||||
DockWidget* dockWidget = d->m_tabBar->currentTab()->dockWidget();
|
||||
if (!d->m_dockWidgetActionsButtons.isEmpty()) {
|
||||
for (auto button : qAsConst(d->m_dockWidgetActionsButtons)) {
|
||||
for (auto button : std::as_const(d->m_dockWidgetActionsButtons)) {
|
||||
d->m_layout->removeWidget(button);
|
||||
delete button;
|
||||
}
|
||||
|
@@ -204,7 +204,7 @@ namespace ADS
|
||||
return;
|
||||
|
||||
m_visibleDockAreaCount = 0;
|
||||
for (auto dockArea : qAsConst(m_dockAreas))
|
||||
for (auto dockArea : std::as_const(m_dockAreas))
|
||||
m_visibleDockAreaCount += dockArea->isHidden() ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -1110,7 +1110,7 @@ namespace ADS
|
||||
|
||||
DockAreaWidget *DockContainerWidget::dockAreaAt(const QPoint &globalPosition) const
|
||||
{
|
||||
for (auto dockArea : qAsConst(d->m_dockAreas)) {
|
||||
for (auto dockArea : std::as_const(d->m_dockAreas)) {
|
||||
if (dockArea->isVisible()
|
||||
&& dockArea->rect().contains(dockArea->mapFromGlobal(globalPosition)))
|
||||
return dockArea;
|
||||
@@ -1131,7 +1131,7 @@ namespace ADS
|
||||
int DockContainerWidget::visibleDockAreaCount() const
|
||||
{
|
||||
int result = 0;
|
||||
for (auto dockArea : qAsConst(d->m_dockAreas))
|
||||
for (auto dockArea : std::as_const(d->m_dockAreas))
|
||||
result += dockArea->isHidden() ? 0 : 1;
|
||||
|
||||
return result;
|
||||
@@ -1221,7 +1221,7 @@ namespace ADS
|
||||
QList<DockAreaWidget *> DockContainerWidget::openedDockAreas() const
|
||||
{
|
||||
QList<DockAreaWidget *> result;
|
||||
for (auto dockArea : qAsConst(d->m_dockAreas)) {
|
||||
for (auto dockArea : std::as_const(d->m_dockAreas)) {
|
||||
if (!dockArea->isHidden())
|
||||
result.append(dockArea);
|
||||
}
|
||||
@@ -1361,7 +1361,7 @@ namespace ADS
|
||||
QList<DockWidget *> DockContainerWidget::dockWidgets() const
|
||||
{
|
||||
QList<DockWidget *> result;
|
||||
for (const auto dockArea : qAsConst(d->m_dockAreas))
|
||||
for (const auto dockArea : std::as_const(d->m_dockAreas))
|
||||
result.append(dockArea->dockWidgets());
|
||||
|
||||
return result;
|
||||
@@ -1370,7 +1370,7 @@ namespace ADS
|
||||
DockWidget::DockWidgetFeatures DockContainerWidget::features() const
|
||||
{
|
||||
DockWidget::DockWidgetFeatures features(DockWidget::AllDockWidgetFeatures);
|
||||
for (const auto dockArea : qAsConst(d->m_dockAreas))
|
||||
for (const auto dockArea : std::as_const(d->m_dockAreas))
|
||||
features &= dockArea->features();
|
||||
|
||||
return features;
|
||||
@@ -1383,7 +1383,7 @@ namespace ADS
|
||||
|
||||
void DockContainerWidget::closeOtherAreas(DockAreaWidget *keepOpenArea)
|
||||
{
|
||||
for (const auto dockArea : qAsConst(d->m_dockAreas)) {
|
||||
for (const auto dockArea : std::as_const(d->m_dockAreas)) {
|
||||
if (dockArea == keepOpenArea)
|
||||
continue;
|
||||
|
||||
|
@@ -106,13 +106,13 @@ namespace ADS
|
||||
void hideFloatingWidgets()
|
||||
{
|
||||
// Hide updates of floating widgets from user
|
||||
for (auto floatingWidget : qAsConst(m_floatingWidgets))
|
||||
for (auto floatingWidget : std::as_const(m_floatingWidgets))
|
||||
floatingWidget->hide();
|
||||
}
|
||||
|
||||
void markDockWidgetsDirty()
|
||||
{
|
||||
for (auto dockWidget : qAsConst(m_dockWidgetsMap))
|
||||
for (auto dockWidget : std::as_const(m_dockWidgetsMap))
|
||||
dockWidget->setProperty("dirty", true);
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace ADS
|
||||
// function are invisible to the user now and have no assigned dock area
|
||||
// They do not belong to any dock container, until the user toggles the
|
||||
// toggle view action the next time
|
||||
for (auto dockWidget : qAsConst(m_dockWidgetsMap)) {
|
||||
for (auto dockWidget : std::as_const(m_dockWidgetsMap)) {
|
||||
if (dockWidget->property(internal::dirtyProperty).toBool()) {
|
||||
dockWidget->flagAsUnassigned();
|
||||
emit dockWidget->viewToggled(false);
|
||||
@@ -233,7 +233,7 @@ namespace ADS
|
||||
// The dock areas because the previous toggleView() action has changed
|
||||
// the dock area index
|
||||
int count = 0;
|
||||
for (auto dockContainer : qAsConst(m_containers)) {
|
||||
for (auto dockContainer : std::as_const(m_containers)) {
|
||||
count++;
|
||||
for (int i = 0; i < dockContainer->dockAreaCount(); ++i) {
|
||||
DockAreaWidget *dockArea = dockContainer->dockArea(i);
|
||||
@@ -259,7 +259,7 @@ namespace ADS
|
||||
{
|
||||
// Finally we need to send the topLevelChanged() signals for all dock
|
||||
// widgets if top level changed
|
||||
for (auto dockContainer : qAsConst(m_containers)) {
|
||||
for (auto dockContainer : std::as_const(m_containers)) {
|
||||
DockWidget *topLevelDockWidget = dockContainer->topLevelDockWidget();
|
||||
if (topLevelDockWidget) {
|
||||
topLevelDockWidget->emitTopLevelChanged(true);
|
||||
@@ -329,7 +329,7 @@ namespace ADS
|
||||
// Using a temporal vector since the destructor of
|
||||
// FloatingDockWidgetContainer alters d->m_floatingWidgets.
|
||||
std::vector<FloatingDockContainer *> aboutToDeletes;
|
||||
for (auto floatingWidget : qAsConst(d->m_floatingWidgets)) {
|
||||
for (auto floatingWidget : std::as_const(d->m_floatingWidgets)) {
|
||||
if (floatingWidget)
|
||||
aboutToDeletes.push_back(floatingWidget);
|
||||
}
|
||||
@@ -483,7 +483,7 @@ namespace ADS
|
||||
stream.writeAttribute("version", QString::number(CurrentVersion));
|
||||
stream.writeAttribute("userVersion", QString::number(version));
|
||||
stream.writeAttribute("containers", QString::number(d->m_containers.count()));
|
||||
for (auto container : qAsConst(d->m_containers))
|
||||
for (auto container : std::as_const(d->m_containers))
|
||||
container->saveState(stream);
|
||||
|
||||
stream.writeEndElement();
|
||||
@@ -527,7 +527,7 @@ namespace ADS
|
||||
if (d->m_uninitializedFloatingWidgets.empty())
|
||||
return;
|
||||
|
||||
for (auto floatingWidget : qAsConst(d->m_uninitializedFloatingWidgets))
|
||||
for (auto floatingWidget : std::as_const(d->m_uninitializedFloatingWidgets))
|
||||
floatingWidget->show();
|
||||
|
||||
d->m_uninitializedFloatingWidgets.clear();
|
||||
|
@@ -592,7 +592,7 @@ namespace ADS {
|
||||
if (windowHandle()->devicePixelRatio() == d->m_lastDevicePixelRatio) // TODO
|
||||
return;
|
||||
|
||||
for (auto widget : qAsConst(d->m_dropIndicatorWidgets))
|
||||
for (auto widget : std::as_const(d->m_dropIndicatorWidgets))
|
||||
d->updateDropIndicatorIcon(widget);
|
||||
|
||||
d->m_lastDevicePixelRatio = devicePixelRatioF();
|
||||
|
@@ -176,7 +176,7 @@ Aggregate::~Aggregate()
|
||||
QList<QObject *> components;
|
||||
{
|
||||
QWriteLocker locker(&lock());
|
||||
for (QObject *component : qAsConst(m_components)) {
|
||||
for (QObject *component : std::as_const(m_components)) {
|
||||
disconnect(component, &QObject::destroyed, this, &Aggregate::deleteSelf);
|
||||
aggregateMap().remove(component);
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ public:
|
||||
|
||||
template <typename T> T *component() {
|
||||
QReadLocker locker(&lock());
|
||||
for (QObject *component : qAsConst(m_components)) {
|
||||
for (QObject *component : std::as_const(m_components)) {
|
||||
if (T *result = qobject_cast<T *>(component))
|
||||
return result;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
template <typename T> QList<T *> components() {
|
||||
QReadLocker locker(&lock());
|
||||
QList<T *> results;
|
||||
for (QObject *component : qAsConst(m_components)) {
|
||||
for (QObject *component : std::as_const(m_components)) {
|
||||
if (T *result = qobject_cast<T *>(component)) {
|
||||
results << result;
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ public:
|
||||
return true;
|
||||
|
||||
SafeMatcher matcher;
|
||||
for (const T *existingItem : qAsConst(_container)) {
|
||||
for (const T *existingItem : std::as_const(_container)) {
|
||||
if (Matcher::match(existingItem, item, &matcher))
|
||||
return true;
|
||||
}
|
||||
|
@@ -299,7 +299,7 @@ void Document::setLastModified(const QDateTime &lastModified)
|
||||
QStringList Document::includedFiles() const
|
||||
{
|
||||
QStringList files;
|
||||
for (const Include &i : qAsConst(_resolvedIncludes))
|
||||
for (const Include &i : std::as_const(_resolvedIncludes))
|
||||
files.append(i.resolvedFileName());
|
||||
files.removeDuplicates();
|
||||
return files;
|
||||
@@ -488,7 +488,7 @@ Symbol *Document::lastVisibleSymbolAt(int line, int column) const
|
||||
|
||||
const Macro *Document::findMacroDefinitionAt(int line) const
|
||||
{
|
||||
for (const Macro ¯o : qAsConst(_definedMacros)) {
|
||||
for (const Macro ¯o : std::as_const(_definedMacros)) {
|
||||
if (macro.line() == line)
|
||||
return ¯o;
|
||||
}
|
||||
@@ -497,7 +497,7 @@ const Macro *Document::findMacroDefinitionAt(int line) const
|
||||
|
||||
const Document::MacroUse *Document::findMacroUseAt(int utf16charsOffset) const
|
||||
{
|
||||
for (const Document::MacroUse &use : qAsConst(_macroUses)) {
|
||||
for (const Document::MacroUse &use : std::as_const(_macroUses)) {
|
||||
if (use.containsUtf16charOffset(utf16charsOffset)
|
||||
&& (utf16charsOffset < use.utf16charsBegin() + use.macro().nameToQString().size())) {
|
||||
return &use;
|
||||
@@ -508,7 +508,7 @@ const Document::MacroUse *Document::findMacroUseAt(int utf16charsOffset) const
|
||||
|
||||
const Document::UndefinedMacroUse *Document::findUndefinedMacroUseAt(int utf16charsOffset) const
|
||||
{
|
||||
for (const Document::UndefinedMacroUse &use : qAsConst(_undefinedMacroUses)) {
|
||||
for (const Document::UndefinedMacroUse &use : std::as_const(_undefinedMacroUses)) {
|
||||
if (use.containsUtf16charOffset(utf16charsOffset)
|
||||
&& (utf16charsOffset < use.utf16charsBegin()
|
||||
+ QString::fromUtf8(use.name(), use.name().size()).length()))
|
||||
|
@@ -399,7 +399,7 @@ private:
|
||||
if (!klass) {
|
||||
if (const auto namedType = baseExprType->asNamedType()) {
|
||||
items = context.lookup(namedType->name(), item->scope());
|
||||
for (const LookupItem &item : qAsConst(items)) {
|
||||
for (const LookupItem &item : std::as_const(items)) {
|
||||
if ((klass = item.type()->asClassType()))
|
||||
break;
|
||||
}
|
||||
@@ -410,7 +410,7 @@ private:
|
||||
items = context.lookup(memberAccess->member_name->name, klass);
|
||||
if (items.isEmpty())
|
||||
return Usage::Type::Other;
|
||||
for (const LookupItem &item : qAsConst(items)) {
|
||||
for (const LookupItem &item : std::as_const(items)) {
|
||||
if (item.type()->asFunctionType()) {
|
||||
if (item.type().isConst())
|
||||
return Usage::Type::Read;
|
||||
|
@@ -1357,7 +1357,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
|
||||
for (int i = 0; i < argumentCountOfSpecialization; ++i)
|
||||
templParams.insert(templateSpecialization->templateParameterAt(i)->name(), i);
|
||||
|
||||
for (const Name *baseName : qAsConst(allBases)) {
|
||||
for (const Name *baseName : std::as_const(allBases)) {
|
||||
ClassOrNamespace *baseBinding = nullptr;
|
||||
|
||||
if (const Identifier *nameId = baseName->asNameId()) {
|
||||
@@ -1435,7 +1435,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
|
||||
|
||||
// Find the missing bases for regular (non-template) types.
|
||||
// Ex.: class A : public B<Some>::Type {};
|
||||
for (const Name *baseName : qAsConst(allBases)) {
|
||||
for (const Name *baseName : std::as_const(allBases)) {
|
||||
ClassOrNamespace *binding = this;
|
||||
if (const QualifiedNameId *qBaseName = baseName->asQualifiedNameId()) {
|
||||
if (const Name *qualification = qBaseName->base())
|
||||
|
@@ -47,7 +47,7 @@ QString Macro::decoratedName() const
|
||||
if (f._functionLike) {
|
||||
text += QLatin1Char('(');
|
||||
bool first = true;
|
||||
for (const QByteArray &formal : qAsConst(_formals)) {
|
||||
for (const QByteArray &formal : std::as_const(_formals)) {
|
||||
if (! first)
|
||||
text += QLatin1String(", ");
|
||||
else
|
||||
|
@@ -522,7 +522,7 @@ QString MatchingText::insertMatchingBrace(const QTextCursor &cursor, const QStri
|
||||
}
|
||||
|
||||
QString result;
|
||||
for (const QChar &ch : qAsConst(text)) {
|
||||
for (const QChar &ch : std::as_const(text)) {
|
||||
if (ch == QLatin1Char('(')) result += QLatin1Char(')');
|
||||
else if (ch == QLatin1Char('[')) result += QLatin1Char(']');
|
||||
else if (ch == QLatin1Char('{')) result += QLatin1Char('}');
|
||||
|
@@ -176,7 +176,7 @@ bool OptionsParser::checkForLoadOption()
|
||||
return false;
|
||||
if (nextToken(RequiredToken)) {
|
||||
if (m_currentArg == QLatin1String("all")) {
|
||||
for (PluginSpec *spec : qAsConst(m_pmPrivate->pluginSpecs))
|
||||
for (PluginSpec *spec : std::as_const(m_pmPrivate->pluginSpecs))
|
||||
spec->d->setForceEnabled(true);
|
||||
m_isDependencyRefreshNeeded = true;
|
||||
} else {
|
||||
@@ -203,7 +203,7 @@ bool OptionsParser::checkForNoLoadOption()
|
||||
return false;
|
||||
if (nextToken(RequiredToken)) {
|
||||
if (m_currentArg == QLatin1String("all")) {
|
||||
for (PluginSpec *spec : qAsConst(m_pmPrivate->pluginSpecs))
|
||||
for (PluginSpec *spec : std::as_const(m_pmPrivate->pluginSpecs))
|
||||
spec->d->setForceDisabled(true);
|
||||
m_isDependencyRefreshNeeded = true;
|
||||
} else {
|
||||
@@ -287,7 +287,7 @@ void OptionsParser::forceDisableAllPluginsExceptTestedAndForceEnabled()
|
||||
{
|
||||
for (const PluginManagerPrivate::TestSpec &testSpec : m_pmPrivate->testSpecs)
|
||||
testSpec.pluginSpec->d->setForceEnabled(true);
|
||||
for (PluginSpec *spec : qAsConst(m_pmPrivate->pluginSpecs)) {
|
||||
for (PluginSpec *spec : std::as_const(m_pmPrivate->pluginSpecs)) {
|
||||
if (!spec->isForceEnabled() && !spec->isRequired())
|
||||
spec->d->setForceDisabled(true);
|
||||
}
|
||||
|
@@ -579,7 +579,7 @@ QString PluginManager::serializedArguments()
|
||||
if (!rc.isEmpty())
|
||||
rc += separator;
|
||||
rc += QLatin1String(argumentKeywordC);
|
||||
for (const QString &argument : qAsConst(d->arguments))
|
||||
for (const QString &argument : std::as_const(d->arguments))
|
||||
rc += separator + argument;
|
||||
}
|
||||
return rc;
|
||||
@@ -746,7 +746,7 @@ void PluginManager::formatOptions(QTextStream &str, int optionIndentation, int d
|
||||
void PluginManager::formatPluginOptions(QTextStream &str, int optionIndentation, int descriptionIndentation)
|
||||
{
|
||||
// Check plugins for options
|
||||
for (PluginSpec *ps : qAsConst(d->pluginSpecs)) {
|
||||
for (PluginSpec *ps : std::as_const(d->pluginSpecs)) {
|
||||
const PluginSpec::PluginArgumentDescriptions pargs = ps->argumentDescriptions();
|
||||
if (!pargs.empty()) {
|
||||
str << "\nPlugin: " << ps->name() << '\n';
|
||||
@@ -761,7 +761,7 @@ void PluginManager::formatPluginOptions(QTextStream &str, int optionIndentation,
|
||||
*/
|
||||
void PluginManager::formatPluginVersions(QTextStream &str)
|
||||
{
|
||||
for (PluginSpec *ps : qAsConst(d->pluginSpecs))
|
||||
for (PluginSpec *ps : std::as_const(d->pluginSpecs))
|
||||
str << " " << ps->name() << ' ' << ps->version() << ' ' << ps->description() << '\n';
|
||||
}
|
||||
|
||||
@@ -993,7 +993,7 @@ void PluginManagerPrivate::writeSettings()
|
||||
return;
|
||||
QStringList tempDisabledPlugins;
|
||||
QStringList tempForceEnabledPlugins;
|
||||
for (PluginSpec *spec : qAsConst(pluginSpecs)) {
|
||||
for (PluginSpec *spec : std::as_const(pluginSpecs)) {
|
||||
if (spec->isEnabledByDefault() && !spec->isEnabledBySettings())
|
||||
tempDisabledPlugins.append(spec->name());
|
||||
if (!spec->isEnabledByDefault() && spec->isEnabledBySettings())
|
||||
@@ -1203,7 +1203,7 @@ static TestPlan generateCustomTestPlan(IPlugin *plugin,
|
||||
|
||||
} else {
|
||||
// Add all matching test functions of all remaining test objects
|
||||
for (QObject *testObject : qAsConst(remainingTestObjectsOfPlugin)) {
|
||||
for (QObject *testObject : std::as_const(remainingTestObjectsOfPlugin)) {
|
||||
const QStringList allFunctions = testFunctions(testObject->metaObject());
|
||||
const QStringList matchingFunctions = matchingTestFunctions(allFunctions,
|
||||
matchText);
|
||||
@@ -1250,7 +1250,7 @@ void PluginManagerPrivate::startTests()
|
||||
}
|
||||
|
||||
int failedTests = 0;
|
||||
for (const TestSpec &testSpec : qAsConst(testSpecs)) {
|
||||
for (const TestSpec &testSpec : std::as_const(testSpecs)) {
|
||||
IPlugin *plugin = testSpec.pluginSpec->plugin();
|
||||
if (!plugin)
|
||||
continue; // plugin not loaded
|
||||
@@ -1395,7 +1395,7 @@ void PluginManagerPrivate::shutdown()
|
||||
const QVector<PluginSpec *> PluginManagerPrivate::loadQueue()
|
||||
{
|
||||
QVector<PluginSpec *> queue;
|
||||
for (PluginSpec *spec : qAsConst(pluginSpecs)) {
|
||||
for (PluginSpec *spec : std::as_const(pluginSpecs)) {
|
||||
QVector<PluginSpec *> circularityCheckQueue;
|
||||
loadQueue(spec, queue, circularityCheckQueue);
|
||||
}
|
||||
@@ -1702,13 +1702,13 @@ void PluginManagerPrivate::readPluginPaths()
|
||||
|
||||
void PluginManagerPrivate::resolveDependencies()
|
||||
{
|
||||
for (PluginSpec *spec : qAsConst(pluginSpecs))
|
||||
for (PluginSpec *spec : std::as_const(pluginSpecs))
|
||||
spec->d->resolveDependencies(pluginSpecs);
|
||||
}
|
||||
|
||||
void PluginManagerPrivate::enableDependenciesIndirectly()
|
||||
{
|
||||
for (PluginSpec *spec : qAsConst(pluginSpecs))
|
||||
for (PluginSpec *spec : std::as_const(pluginSpecs))
|
||||
spec->d->enabledIndirectly = false;
|
||||
// cannot use reverse loadQueue here, because test dependencies can introduce circles
|
||||
QVector<PluginSpec *> queue = Utils::filtered(pluginSpecs, &PluginSpec::isEffectivelyEnabled);
|
||||
@@ -1723,7 +1723,7 @@ PluginSpec *PluginManagerPrivate::pluginForOption(const QString &option, bool *r
|
||||
{
|
||||
// Look in the plugins for an option
|
||||
*requiresArgument = false;
|
||||
for (PluginSpec *spec : qAsConst(pluginSpecs)) {
|
||||
for (PluginSpec *spec : std::as_const(pluginSpecs)) {
|
||||
PluginArgumentDescription match = Utils::findOrDefault(spec->argumentDescriptions(),
|
||||
[option](PluginArgumentDescription pad) {
|
||||
return pad.name == option;
|
||||
|
@@ -998,7 +998,7 @@ bool PluginSpecPrivate::resolveDependencies(const QVector<PluginSpec *> &specs)
|
||||
return false;
|
||||
}
|
||||
QHash<PluginDependency, PluginSpec *> resolvedDependencies;
|
||||
for (const PluginDependency &dependency : qAsConst(dependencies)) {
|
||||
for (const PluginDependency &dependency : std::as_const(dependencies)) {
|
||||
PluginSpec * const found = Utils::findOrDefault(specs, [&dependency](PluginSpec *spec) {
|
||||
return spec->provides(dependency.name, dependency.version);
|
||||
});
|
||||
|
@@ -358,7 +358,7 @@ void PluginView::updatePlugins()
|
||||
}
|
||||
Utils::sort(collections, &CollectionItem::m_name);
|
||||
|
||||
for (CollectionItem *collection : qAsConst(collections))
|
||||
for (CollectionItem *collection : std::as_const(collections))
|
||||
m_model->rootItem()->appendChild(collection);
|
||||
|
||||
emit m_model->layoutChanged();
|
||||
|
@@ -535,7 +535,7 @@ void DiagramController::onBeginResetModel()
|
||||
void DiagramController::onEndResetModel()
|
||||
{
|
||||
updateAllDiagramsList();
|
||||
for (MDiagram *diagram : qAsConst(m_allDiagrams)) {
|
||||
for (MDiagram *diagram : std::as_const(m_allDiagrams)) {
|
||||
const QList<DElement *> elements = diagram->diagramElements();
|
||||
// remove all elements which are not longer part of the model
|
||||
for (int i = elements.size() - 1; i >= 0; --i) {
|
||||
|
@@ -230,7 +230,7 @@ ObjectItem *DiagramSceneModel::findTopmostObjectItem(const QPointF &scenePos) co
|
||||
{
|
||||
// fetch affected items from scene in correct drawing order to find topmost element
|
||||
const QList<QGraphicsItem *> items = m_graphicsScene->items(scenePos);
|
||||
for (QGraphicsItem *item : qAsConst(items)) {
|
||||
for (QGraphicsItem *item : std::as_const(items)) {
|
||||
if (m_graphicsItems.contains(item)) {
|
||||
DObject *object = dynamic_cast<DObject *>(m_itemToElementMap.value(item));
|
||||
if (object)
|
||||
@@ -807,7 +807,7 @@ void DiagramSceneModel::onEndRemoveElement(int row, const MDiagram *diagram)
|
||||
Q_UNUSED(diagram)
|
||||
QMT_CHECK(m_busyState == RemoveElement);
|
||||
// update elements from store (see above)
|
||||
for (const Uid &end_uid : qAsConst(m_relationEndsUid)) {
|
||||
for (const Uid &end_uid : std::as_const(m_relationEndsUid)) {
|
||||
DElement *dEnd = m_diagramController->findElement(end_uid, diagram);
|
||||
if (dEnd)
|
||||
updateGraphicsItem(graphicsItem(dEnd), dEnd);
|
||||
@@ -854,11 +854,11 @@ void DiagramSceneModel::onSelectionChanged()
|
||||
}
|
||||
|
||||
// select more items secondarily
|
||||
for (QGraphicsItem *selectedItem : qAsConst(m_selectedItems)) {
|
||||
for (QGraphicsItem *selectedItem : std::as_const(m_selectedItems)) {
|
||||
if (auto selectable = dynamic_cast<ISelectable *>(selectedItem)) {
|
||||
QRectF boundary = selectable->getSecondarySelectionBoundary();
|
||||
if (!boundary.isEmpty()) {
|
||||
for (QGraphicsItem *item : qAsConst(m_graphicsItems)) {
|
||||
for (QGraphicsItem *item : std::as_const(m_graphicsItems)) {
|
||||
if (auto secondarySelectable = dynamic_cast<ISelectable *>(item)) {
|
||||
if (!item->isSelected() && !secondarySelectable->isSecondarySelected()) {
|
||||
secondarySelectable->setBoundarySelected(boundary, true);
|
||||
@@ -1023,7 +1023,7 @@ void DiagramSceneModel::restoreSelectedStatusAfterExport(const DiagramSceneModel
|
||||
void DiagramSceneModel::recalcSceneRectSize()
|
||||
{
|
||||
QRectF sceneRect = m_originItem->mapRectToScene(m_originItem->boundingRect());
|
||||
for (QGraphicsItem *item : qAsConst(m_graphicsItems)) {
|
||||
for (QGraphicsItem *item : std::as_const(m_graphicsItems)) {
|
||||
// TODO use an interface to update sceneRect by item
|
||||
if (!dynamic_cast<SwimlaneItem *>(item))
|
||||
sceneRect |= item->mapRectToScene(item->boundingRect());
|
||||
|
@@ -554,7 +554,7 @@ QByteArray DependencyInfo::calculateFingerprint(const ImportDependencies &deps)
|
||||
hash.addData("/", 1);
|
||||
QList<ImportKey> imports = Utils::toList(allImports);
|
||||
std::sort(imports.begin(), imports.end());
|
||||
for (const ImportKey &k : qAsConst(imports))
|
||||
for (const ImportKey &k : std::as_const(imports))
|
||||
k.addToHash(hash);
|
||||
return hash.result();
|
||||
}
|
||||
|
@@ -2565,7 +2565,7 @@ const ObjectValue *Imports::resolveAliasAndMarkUsed(const QString &name) const
|
||||
{
|
||||
if (const ObjectValue *value = m_aliased.value(name, nullptr)) {
|
||||
// mark all respective ImportInfo objects to avoid dropping imports (QmlDesigner) on rewrite
|
||||
for (const Import &i : qAsConst(m_imports)) {
|
||||
for (const Import &i : std::as_const(m_imports)) {
|
||||
const ImportInfo &info = i.info;
|
||||
if (info.as() == name)
|
||||
i.used = true; // FIXME: This evilly modifies a 'const' object
|
||||
|
@@ -212,7 +212,7 @@ Context::ImportsPerDocument LinkPrivate::linkImports()
|
||||
importsPerDocument.insert(document.data(), QSharedPointer<Imports>(imports));
|
||||
}
|
||||
|
||||
for (const Document::Ptr &doc : qAsConst(m_snapshot)) {
|
||||
for (const Document::Ptr &doc : std::as_const(m_snapshot)) {
|
||||
if (doc == document)
|
||||
continue;
|
||||
|
||||
@@ -413,7 +413,7 @@ Import LinkPrivate::importNonFile(const Document::Ptr &doc, const ImportInfo &im
|
||||
}
|
||||
|
||||
if (!importFound) {
|
||||
for (const Utils::FilePath &dir : qAsConst(m_applicationDirectories)) {
|
||||
for (const Utils::FilePath &dir : std::as_const(m_applicationDirectories)) {
|
||||
auto qmltypes = dir.dirEntries(
|
||||
Utils::FileFilter(QStringList{"*.qmltypes"}, QDir::Files));
|
||||
|
||||
|
@@ -278,9 +278,9 @@ void ModelManagerInterface::loadQmlTypeDescriptionsInternal(const QString &resou
|
||||
for (auto it = objs.cbegin(); it != objs.cend(); ++it)
|
||||
CppQmlTypesLoader::defaultLibraryObjects.insert(it.key(), it.value());
|
||||
|
||||
for (const QString &error : qAsConst(errors))
|
||||
for (const QString &error : std::as_const(errors))
|
||||
writeMessageInternal(error);
|
||||
for (const QString &warning : qAsConst(warnings))
|
||||
for (const QString &warning : std::as_const(warnings))
|
||||
writeMessageInternal(warning);
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ void ModelManagerInterface::iterateQrcFiles(
|
||||
}
|
||||
|
||||
QSet<Utils::FilePath> pathsChecked;
|
||||
for (const ModelManagerInterface::ProjectInfo &pInfo : qAsConst(pInfos)) {
|
||||
for (const ModelManagerInterface::ProjectInfo &pInfo : std::as_const(pInfos)) {
|
||||
QList<Utils::FilePath> qrcFilePaths;
|
||||
if (resources == ActiveQrcResources)
|
||||
qrcFilePaths = pInfo.activeResourceFiles;
|
||||
@@ -470,7 +470,7 @@ void ModelManagerInterface::iterateQrcFiles(
|
||||
qrcFilePaths = pInfo.allResourceFiles;
|
||||
for (const Utils::FilePath &p : generatedQrc(pInfo.applicationDirectories))
|
||||
qrcFilePaths.append(p);
|
||||
for (const Utils::FilePath &qrcFilePath : qAsConst(qrcFilePaths)) {
|
||||
for (const Utils::FilePath &qrcFilePath : std::as_const(qrcFilePaths)) {
|
||||
if (pathsChecked.contains(qrcFilePath))
|
||||
continue;
|
||||
pathsChecked.insert(qrcFilePath);
|
||||
@@ -566,19 +566,19 @@ void ModelManagerInterface::updateProjectInfo(const ProjectInfo &pinfo, ProjectE
|
||||
|
||||
// remove files that are no longer in the project and have been deleted
|
||||
QList<Utils::FilePath> deletedFiles;
|
||||
for (const Utils::FilePath &oldFile : qAsConst(oldInfo.sourceFiles)) {
|
||||
for (const Utils::FilePath &oldFile : std::as_const(oldInfo.sourceFiles)) {
|
||||
if (snapshot.document(oldFile) && !pinfo.sourceFiles.contains(oldFile)
|
||||
&& !oldFile.exists()) {
|
||||
deletedFiles += oldFile;
|
||||
}
|
||||
}
|
||||
removeFiles(deletedFiles);
|
||||
for (const Utils::FilePath &oldFile : qAsConst(deletedFiles))
|
||||
for (const Utils::FilePath &oldFile : std::as_const(deletedFiles))
|
||||
m_fileToProject.remove(oldFile, p);
|
||||
|
||||
// parse any files not yet in the snapshot
|
||||
QList<Utils::FilePath> newFiles;
|
||||
for (const Utils::FilePath &file : qAsConst(pinfo.sourceFiles)) {
|
||||
for (const Utils::FilePath &file : std::as_const(pinfo.sourceFiles)) {
|
||||
if (!m_fileToProject.contains(file, p))
|
||||
m_fileToProject.insert(file, p);
|
||||
if (!snapshot.document(file))
|
||||
@@ -589,11 +589,11 @@ void ModelManagerInterface::updateProjectInfo(const ProjectInfo &pinfo, ProjectE
|
||||
|
||||
// update qrc cache
|
||||
m_qrcContents = pinfo.resourceFileContents;
|
||||
for (const Utils::FilePath &newQrc : qAsConst(pinfo.allResourceFiles))
|
||||
for (const Utils::FilePath &newQrc : std::as_const(pinfo.allResourceFiles))
|
||||
m_qrcCache.addPath(newQrc.toString(), m_qrcContents.value(newQrc));
|
||||
for (const Utils::FilePath &newQrc : generatedQrc(pinfo.applicationDirectories))
|
||||
m_qrcCache.addPath(newQrc.toString(), m_qrcContents.value(newQrc));
|
||||
for (const Utils::FilePath &oldQrc : qAsConst(oldInfo.allResourceFiles))
|
||||
for (const Utils::FilePath &oldQrc : std::as_const(oldInfo.allResourceFiles))
|
||||
m_qrcCache.removePath(oldQrc.toString());
|
||||
|
||||
m_pluginDumper->loadBuiltinTypes(pinfo);
|
||||
@@ -654,7 +654,7 @@ QList<ModelManagerInterface::ProjectInfo> ModelManagerInterface::allProjectInfos
|
||||
projects = m_fileToProject.values(path.canonicalPath());
|
||||
}
|
||||
QList<ProjectInfo> infos;
|
||||
for (ProjectExplorer::Project *project : qAsConst(projects)) {
|
||||
for (ProjectExplorer::Project *project : std::as_const(projects)) {
|
||||
ProjectInfo info = projectInfo(project);
|
||||
if (!info.project.isNull())
|
||||
infos.append(info);
|
||||
@@ -1011,7 +1011,7 @@ void ModelManagerInterface::parseLoop(QSet<Utils::FilePath> &scannedPaths,
|
||||
}
|
||||
|
||||
// add new files to parse list
|
||||
for (const Utils::FilePath &file : qAsConst(importedFiles)) {
|
||||
for (const Utils::FilePath &file : std::as_const(importedFiles)) {
|
||||
if (!files.contains(file))
|
||||
files.append(file);
|
||||
}
|
||||
@@ -1200,7 +1200,7 @@ static QList<Utils::FilePath> minimalPrefixPaths(const QList<Utils::FilePath> &p
|
||||
{
|
||||
QList<Utils::FilePath> sortedPaths;
|
||||
// find minimal prefix, ensure '/' at end
|
||||
for (Utils::FilePath path : qAsConst(paths)) {
|
||||
for (Utils::FilePath path : std::as_const(paths)) {
|
||||
if (!path.endsWith("/"))
|
||||
path = path.withNewPath(path.path() + "/");
|
||||
if (path.path().length() > 1)
|
||||
@@ -1226,7 +1226,7 @@ void ModelManagerInterface::updateImportPaths()
|
||||
QList<Utils::FilePath> allApplicationDirectories;
|
||||
QmlLanguageBundles activeBundles;
|
||||
QmlLanguageBundles extendedBundles;
|
||||
for (const ProjectInfo &pInfo : qAsConst(m_projects)) {
|
||||
for (const ProjectInfo &pInfo : std::as_const(m_projects)) {
|
||||
for (const auto &importPath : pInfo.importPaths) {
|
||||
const FilePath canonicalPath = importPath.path().canonicalPath();
|
||||
if (!canonicalPath.isEmpty())
|
||||
@@ -1235,13 +1235,13 @@ void ModelManagerInterface::updateImportPaths()
|
||||
allApplicationDirectories.append(pInfo.applicationDirectories);
|
||||
}
|
||||
|
||||
for (const ViewerContext &vContext : qAsConst(m_defaultVContexts)) {
|
||||
for (const ViewerContext &vContext : std::as_const(m_defaultVContexts)) {
|
||||
for (const Utils::FilePath &path : vContext.paths)
|
||||
allImportPaths.maybeInsert(path, vContext.language);
|
||||
allApplicationDirectories.append(vContext.applicationDirectories);
|
||||
}
|
||||
|
||||
for (const ProjectInfo &pInfo : qAsConst(m_projects)) {
|
||||
for (const ProjectInfo &pInfo : std::as_const(m_projects)) {
|
||||
activeBundles.mergeLanguageBundles(pInfo.activeBundle);
|
||||
const auto languages = pInfo.activeBundle.languages();
|
||||
for (Dialect l : languages) {
|
||||
@@ -1254,7 +1254,7 @@ void ModelManagerInterface::updateImportPaths()
|
||||
}
|
||||
}
|
||||
|
||||
for (const ProjectInfo &pInfo : qAsConst(m_projects)) {
|
||||
for (const ProjectInfo &pInfo : std::as_const(m_projects)) {
|
||||
if (!pInfo.qtQmlPath.isEmpty())
|
||||
allImportPaths.maybeInsert(pInfo.qtQmlPath, Dialect::QmlQtQuick2);
|
||||
}
|
||||
@@ -1269,7 +1269,7 @@ void ModelManagerInterface::updateImportPaths()
|
||||
allImportPaths.maybeInsert(importPath);
|
||||
}
|
||||
|
||||
for (const Utils::FilePath &path : qAsConst(m_defaultImportPaths))
|
||||
for (const Utils::FilePath &path : std::as_const(m_defaultImportPaths))
|
||||
allImportPaths.maybeInsert(path, Dialect::Qml);
|
||||
allImportPaths.compact();
|
||||
allApplicationDirectories = Utils::filteredUnique(allApplicationDirectories);
|
||||
@@ -1288,9 +1288,9 @@ void ModelManagerInterface::updateImportPaths()
|
||||
QList<Utils::FilePath> importedFiles;
|
||||
QSet<Utils::FilePath> scannedPaths;
|
||||
QSet<Utils::FilePath> newLibraries;
|
||||
for (const Document::Ptr &doc : qAsConst(snapshot))
|
||||
for (const Document::Ptr &doc : std::as_const(snapshot))
|
||||
findNewLibraryImports(doc, snapshot, this, &importedFiles, &scannedPaths, &newLibraries);
|
||||
for (const Utils::FilePath &path : qAsConst(allApplicationDirectories)) {
|
||||
for (const Utils::FilePath &path : std::as_const(allApplicationDirectories)) {
|
||||
allImportPaths.maybeInsert(path, Dialect::Qml);
|
||||
findNewQmlApplicationInPath(path, snapshot, this, &newLibraries);
|
||||
}
|
||||
@@ -1381,9 +1381,9 @@ bool rescanExports(const QString &fileName, FindExportedCppTypes &finder,
|
||||
}
|
||||
if (!hasNewInfo) {
|
||||
QHash<QString, QByteArray> newFingerprints;
|
||||
for (const auto &newType : qAsConst(exported))
|
||||
for (const auto &newType : std::as_const(exported))
|
||||
newFingerprints[newType->className()]=newType->fingerprint();
|
||||
for (const auto &oldType : qAsConst(data.exportedTypes)) {
|
||||
for (const auto &oldType : std::as_const(data.exportedTypes)) {
|
||||
if (newFingerprints.value(oldType->className()) != oldType->fingerprint()) {
|
||||
hasNewInfo = true;
|
||||
break;
|
||||
@@ -1521,7 +1521,7 @@ ViewerContext ModelManagerInterface::getVContext(const ViewerContext &vCtx,
|
||||
Q_FALLTHROUGH();
|
||||
case ViewerContext::AddAllPaths:
|
||||
{
|
||||
for (const Utils::FilePath &path : qAsConst(defaultVCtx.paths))
|
||||
for (const Utils::FilePath &path : std::as_const(defaultVCtx.paths))
|
||||
maybeAddPath(res, path);
|
||||
switch (res.language.dialect()) {
|
||||
case Dialect::AnyLanguage:
|
||||
@@ -1552,7 +1552,7 @@ ViewerContext ModelManagerInterface::getVContext(const ViewerContext &vCtx,
|
||||
allProjects = m_projects.values();
|
||||
}
|
||||
std::sort(allProjects.begin(), allProjects.end(), &pInfoLessThanImports);
|
||||
for (const ProjectInfo &pInfo : qAsConst(allProjects))
|
||||
for (const ProjectInfo &pInfo : std::as_const(allProjects))
|
||||
addPathsOnLanguageMatch(pInfo.importPaths);
|
||||
}
|
||||
const auto environmentPaths = environmentImportPaths();
|
||||
@@ -1574,7 +1574,7 @@ ViewerContext ModelManagerInterface::getVContext(const ViewerContext &vCtx,
|
||||
res.selectors.append(defaultVCtx.selectors);
|
||||
Q_FALLTHROUGH();
|
||||
case ViewerContext::AddDefaultPaths:
|
||||
for (const Utils::FilePath &path : qAsConst(defaultVCtx.paths))
|
||||
for (const Utils::FilePath &path : std::as_const(defaultVCtx.paths))
|
||||
maybeAddPath(res, path);
|
||||
if (res.language == Dialect::AnyLanguage || res.language == Dialect::Qml)
|
||||
maybeAddPath(res, info.qtQmlPath);
|
||||
@@ -1692,7 +1692,7 @@ void ModelManagerInterface::resetCodeModel()
|
||||
QMutexLocker locker(&m_mutex);
|
||||
|
||||
// find all documents currently in the code model
|
||||
for (const Document::Ptr &doc : qAsConst(m_validSnapshot))
|
||||
for (const Document::Ptr &doc : std::as_const(m_validSnapshot))
|
||||
documents.append(doc->fileName());
|
||||
|
||||
// reset the snapshot
|
||||
|
@@ -151,7 +151,7 @@ void PluginDumper::onLoadPluginTypes(const Utils::FilePath &libraryPath,
|
||||
|
||||
// watch library qmltypes file
|
||||
if (!plugin.typeInfoPaths.isEmpty()) {
|
||||
for (const FilePath &path : qAsConst(plugin.typeInfoPaths)) {
|
||||
for (const FilePath &path : std::as_const(plugin.typeInfoPaths)) {
|
||||
if (!path.exists())
|
||||
continue;
|
||||
if (!pluginWatcher()->watchesFile(path.toString()))
|
||||
|
@@ -198,7 +198,7 @@ void TimelineTraceManager::setAggregateTraces(bool aggregateTraces)
|
||||
|
||||
void TimelineTraceManager::initialize()
|
||||
{
|
||||
for (const Initializer &initializer : qAsConst(d->initializers))
|
||||
for (const Initializer &initializer : std::as_const(d->initializers))
|
||||
initializer();
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ void TimelineTraceManager::finalize()
|
||||
// Load notes after the timeline models have been initialized ...
|
||||
// which happens on stateChanged(Done).
|
||||
|
||||
for (const Finalizer &finalizer : qAsConst(d->finalizers))
|
||||
for (const Finalizer &finalizer : std::as_const(d->finalizers))
|
||||
finalizer();
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ void TimelineTraceManager::TimelineTraceManagerPrivate::reset()
|
||||
traceStart = -1;
|
||||
traceEnd = -1;
|
||||
|
||||
for (const Clearer &clearer : qAsConst(clearers))
|
||||
for (const Clearer &clearer : std::as_const(clearers))
|
||||
clearer();
|
||||
|
||||
numEvents = 0;
|
||||
|
@@ -180,7 +180,7 @@ bool BaseAspect::isVisible() const
|
||||
void BaseAspect::setVisible(bool visible)
|
||||
{
|
||||
d->m_visible = visible;
|
||||
for (QWidget *w : qAsConst(d->m_subWidgets)) {
|
||||
for (QWidget *w : std::as_const(d->m_subWidgets)) {
|
||||
QTC_ASSERT(w, continue);
|
||||
// This may happen during layout building. Explicit setting visibility here
|
||||
// may create a show a toplevel widget for a moment until it is parented
|
||||
@@ -274,7 +274,7 @@ QString BaseAspect::toolTip() const
|
||||
void BaseAspect::setToolTip(const QString &tooltip)
|
||||
{
|
||||
d->m_tooltip = tooltip;
|
||||
for (QWidget *w : qAsConst(d->m_subWidgets)) {
|
||||
for (QWidget *w : std::as_const(d->m_subWidgets)) {
|
||||
QTC_ASSERT(w, continue);
|
||||
w->setToolTip(tooltip);
|
||||
}
|
||||
@@ -288,7 +288,7 @@ bool BaseAspect::isEnabled() const
|
||||
void BaseAspect::setEnabled(bool enabled)
|
||||
{
|
||||
d->m_enabled = enabled;
|
||||
for (QWidget *w : qAsConst(d->m_subWidgets)) {
|
||||
for (QWidget *w : std::as_const(d->m_subWidgets)) {
|
||||
QTC_ASSERT(w, continue);
|
||||
w->setEnabled(enabled);
|
||||
}
|
||||
@@ -313,7 +313,7 @@ bool BaseAspect::isReadOnly() const
|
||||
void BaseAspect::setReadOnly(bool readOnly)
|
||||
{
|
||||
d->m_readOnly = readOnly;
|
||||
for (QWidget *w : qAsConst(d->m_subWidgets)) {
|
||||
for (QWidget *w : std::as_const(d->m_subWidgets)) {
|
||||
QTC_ASSERT(w, continue);
|
||||
if (auto lineEdit = qobject_cast<QLineEdit *>(w))
|
||||
lineEdit->setReadOnly(readOnly);
|
||||
@@ -1661,7 +1661,7 @@ void MultiSelectionAspect::addToLayout(LayoutBuilder &builder)
|
||||
switch (d->m_displayStyle) {
|
||||
case DisplayStyle::ListView:
|
||||
d->m_listView = createSubWidget<QListWidget>();
|
||||
for (const QString &val : qAsConst(d->m_allValues)) {
|
||||
for (const QString &val : std::as_const(d->m_allValues)) {
|
||||
auto item = new QListWidgetItem(val, d->m_listView);
|
||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||
item->setCheckState(value().contains(item->text()) ? Qt::Checked : Qt::Unchecked);
|
||||
@@ -2239,7 +2239,7 @@ void AspectContainer::registerAspect(BaseAspect *aspect)
|
||||
|
||||
void AspectContainer::registerAspects(const AspectContainer &aspects)
|
||||
{
|
||||
for (BaseAspect *aspect : qAsConst(aspects.d->m_items))
|
||||
for (BaseAspect *aspect : std::as_const(aspects.d->m_items))
|
||||
registerAspect(aspect);
|
||||
}
|
||||
|
||||
@@ -2270,7 +2270,7 @@ const QList<BaseAspect *> &AspectContainer::aspects() const
|
||||
|
||||
void AspectContainer::fromMap(const QVariantMap &map)
|
||||
{
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items))
|
||||
for (BaseAspect *aspect : std::as_const(d->m_items))
|
||||
aspect->fromMap(map);
|
||||
|
||||
emit fromMapFinished();
|
||||
@@ -2279,7 +2279,7 @@ void AspectContainer::fromMap(const QVariantMap &map)
|
||||
|
||||
void AspectContainer::toMap(QVariantMap &map) const
|
||||
{
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items))
|
||||
for (BaseAspect *aspect : std::as_const(d->m_items))
|
||||
aspect->toMap(map);
|
||||
}
|
||||
|
||||
@@ -2288,7 +2288,7 @@ void AspectContainer::readSettings(QSettings *settings)
|
||||
for (const QString &group : d->m_settingsGroup)
|
||||
settings->beginGroup(group);
|
||||
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items))
|
||||
for (BaseAspect *aspect : std::as_const(d->m_items))
|
||||
aspect->readSettings(settings);
|
||||
|
||||
for (int i = 0; i != d->m_settingsGroup.size(); ++i)
|
||||
@@ -2300,7 +2300,7 @@ void AspectContainer::writeSettings(QSettings *settings) const
|
||||
for (const QString &group : d->m_settingsGroup)
|
||||
settings->beginGroup(group);
|
||||
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items))
|
||||
for (BaseAspect *aspect : std::as_const(d->m_items))
|
||||
aspect->writeSettings(settings);
|
||||
|
||||
for (int i = 0; i != d->m_settingsGroup.size(); ++i)
|
||||
@@ -2319,7 +2319,7 @@ void AspectContainer::setSettingsGroups(const QString &groupKey, const QString &
|
||||
|
||||
void AspectContainer::apply()
|
||||
{
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items))
|
||||
for (BaseAspect *aspect : std::as_const(d->m_items))
|
||||
aspect->apply();
|
||||
|
||||
emit applied();
|
||||
@@ -2327,26 +2327,26 @@ void AspectContainer::apply()
|
||||
|
||||
void AspectContainer::cancel()
|
||||
{
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items))
|
||||
for (BaseAspect *aspect : std::as_const(d->m_items))
|
||||
aspect->cancel();
|
||||
}
|
||||
|
||||
void AspectContainer::finish()
|
||||
{
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items))
|
||||
for (BaseAspect *aspect : std::as_const(d->m_items))
|
||||
aspect->finish();
|
||||
}
|
||||
|
||||
void AspectContainer::reset()
|
||||
{
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items))
|
||||
for (BaseAspect *aspect : std::as_const(d->m_items))
|
||||
aspect->setValueQuietly(aspect->defaultValue());
|
||||
}
|
||||
|
||||
void AspectContainer::setAutoApply(bool on)
|
||||
{
|
||||
d->m_autoApply = on;
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items))
|
||||
for (BaseAspect *aspect : std::as_const(d->m_items))
|
||||
aspect->setAutoApply(on);
|
||||
}
|
||||
|
||||
@@ -2357,7 +2357,7 @@ void AspectContainer::setOwnsSubAspects(bool on)
|
||||
|
||||
bool AspectContainer::isDirty() const
|
||||
{
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items)) {
|
||||
for (BaseAspect *aspect : std::as_const(d->m_items)) {
|
||||
if (aspect->isDirty())
|
||||
return true;
|
||||
}
|
||||
@@ -2382,7 +2382,7 @@ void AspectContainer::copyFrom(const AspectContainer &other)
|
||||
|
||||
void AspectContainer::forEachAspect(const std::function<void(BaseAspect *)> &run) const
|
||||
{
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items)) {
|
||||
for (BaseAspect *aspect : std::as_const(d->m_items)) {
|
||||
if (auto container = dynamic_cast<AspectContainer *>(aspect))
|
||||
container->forEachAspect(run);
|
||||
else
|
||||
|
@@ -64,7 +64,7 @@ static void qtSection(const QStringList &qtIncludes, QTextStream &str)
|
||||
{
|
||||
QStringList sorted = qtIncludes;
|
||||
sort(sorted);
|
||||
for (const QString &inc : qAsConst(sorted)) {
|
||||
for (const QString &inc : std::as_const(sorted)) {
|
||||
if (!inc.isEmpty())
|
||||
str << QStringLiteral("#include <%1>\n").arg(inc);
|
||||
}
|
||||
|
@@ -509,7 +509,7 @@ void FancyLineEdit::validate()
|
||||
|
||||
// Check buttons.
|
||||
if (d->m_oldText.isEmpty() || t.isEmpty()) {
|
||||
for (auto &button : qAsConst(d->m_iconbutton)) {
|
||||
for (auto &button : std::as_const(d->m_iconbutton)) {
|
||||
if (button->hasAutoHide())
|
||||
button->animateShow(!t.isEmpty());
|
||||
}
|
||||
|
@@ -518,7 +518,7 @@ void FancyMainWindow::addDockActionsToMenu(QMenu *menu)
|
||||
QTC_ASSERT(action2, return false);
|
||||
return stripAccelerator(action1->text()).toLower() < stripAccelerator(action2->text()).toLower();
|
||||
});
|
||||
for (QAction *action : qAsConst(actions))
|
||||
for (QAction *action : std::as_const(actions))
|
||||
menu->addAction(action);
|
||||
menu->addAction(&d->m_showCentralWidget);
|
||||
menu->addAction(&d->m_menuSeparator1);
|
||||
|
@@ -416,9 +416,9 @@ void FileInfoGatherer::run()
|
||||
condition.wait(&mutex);
|
||||
if (abort.loadRelaxed())
|
||||
return;
|
||||
const QString thisPath = qAsConst(path).front();
|
||||
const QString thisPath = std::as_const(path).front();
|
||||
path.pop_front();
|
||||
const QStringList thisList = qAsConst(files).front();
|
||||
const QStringList thisList = std::as_const(files).front();
|
||||
files.pop_front();
|
||||
locker.unlock();
|
||||
|
||||
@@ -659,7 +659,7 @@ public:
|
||||
void updateIcon(QFileIconProvider *iconProvider, const QString &path) {
|
||||
if (info)
|
||||
info->icon = iconProvider->icon(QFileInfo(path));
|
||||
for (FileSystemNode *child : qAsConst(children)) {
|
||||
for (FileSystemNode *child : std::as_const(children)) {
|
||||
//On windows the root (My computer) has no path so we don't want to add a / for nothing (e.g. /C:/)
|
||||
if (!path.isEmpty()) {
|
||||
if (path.endsWith(QLatin1Char('/')))
|
||||
@@ -674,7 +674,7 @@ public:
|
||||
void retranslateStrings(QFileIconProvider *iconProvider, const QString &path) {
|
||||
if (info)
|
||||
info->displayType = iconProvider->type(QFileInfo(path));
|
||||
for (FileSystemNode *child : qAsConst(children)) {
|
||||
for (FileSystemNode *child : std::as_const(children)) {
|
||||
//On windows the root (My computer) has no path so we don't want to add a / for nothing (e.g. /C:/)
|
||||
if (!path.isEmpty()) {
|
||||
if (path.endsWith(QLatin1Char('/')))
|
||||
@@ -2454,7 +2454,7 @@ void FileSystemModelPrivate::_q_fileSystemChanged(const QString &path,
|
||||
std::sort(rowsToUpdate.begin(), rowsToUpdate.end());
|
||||
PathKey min;
|
||||
PathKey max;
|
||||
for (const PathKey &value : qAsConst(rowsToUpdate)) {
|
||||
for (const PathKey &value : std::as_const(rowsToUpdate)) {
|
||||
//##TODO is there a way to bundle signals with QString as the content of the list?
|
||||
/*if (min.isEmpty()) {
|
||||
min = value;
|
||||
|
@@ -175,10 +175,10 @@ void FileSystemWatcherPrivate::autoReloadPostponed(bool postponed)
|
||||
return;
|
||||
m_postponed = postponed;
|
||||
if (!postponed) {
|
||||
for (const QString &file : qAsConst(m_postponedFiles))
|
||||
for (const QString &file : std::as_const(m_postponedFiles))
|
||||
emit q->fileChanged(file);
|
||||
m_postponedFiles.clear();
|
||||
for (const QString &directory : qAsConst(m_postponedDirectories))
|
||||
for (const QString &directory : std::as_const(m_postponedDirectories))
|
||||
emit q->directoryChanged(directory);
|
||||
m_postponedDirectories.clear();
|
||||
}
|
||||
@@ -450,7 +450,7 @@ void FileSystemWatcher::slotDirectoryChanged(const QString &path)
|
||||
toReadd.removeOne(rejected);
|
||||
|
||||
// If we've successfully added the file, that means it was deleted and replaced.
|
||||
for (const QString &reAdded : qAsConst(toReadd))
|
||||
for (const QString &reAdded : std::as_const(toReadd))
|
||||
d->fileChanged(reAdded);
|
||||
}
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ bool FutureSynchronizer::isCancelOnWait() const
|
||||
void FutureSynchronizer::flushFinishedFutures()
|
||||
{
|
||||
QList<QFuture<void>> newFutures;
|
||||
for (const QFuture<void> &future : qAsConst(m_futures)) {
|
||||
for (const QFuture<void> &future : std::as_const(m_futures)) {
|
||||
if (!future.isFinished())
|
||||
newFutures.append(future);
|
||||
}
|
||||
|
@@ -266,7 +266,7 @@ void InfoBarDisplay::infoBarDestroyed()
|
||||
|
||||
void InfoBarDisplay::update()
|
||||
{
|
||||
for (QWidget *widget : qAsConst(m_infoWidgets)) {
|
||||
for (QWidget *widget : std::as_const(m_infoWidgets)) {
|
||||
widget->disconnect(this); // We want no destroyed() signal now
|
||||
delete widget;
|
||||
}
|
||||
@@ -275,7 +275,7 @@ void InfoBarDisplay::update()
|
||||
if (!m_infoBar)
|
||||
return;
|
||||
|
||||
for (const InfoBarEntry &info : qAsConst(m_infoBar->m_infoBarEntries)) {
|
||||
for (const InfoBarEntry &info : std::as_const(m_infoBar->m_infoBarEntries)) {
|
||||
auto infoWidget = new InfoBarWidget(m_edge);
|
||||
|
||||
auto hbox = new QHBoxLayout;
|
||||
@@ -319,7 +319,7 @@ void InfoBarDisplay::update()
|
||||
if (!info.m_combo.entries.isEmpty()) {
|
||||
auto cb = new QComboBox();
|
||||
cb->setToolTip(info.m_combo.tooltip);
|
||||
for (const InfoBarEntry::ComboInfo &comboInfo : qAsConst(info.m_combo.entries))
|
||||
for (const InfoBarEntry::ComboInfo &comboInfo : std::as_const(info.m_combo.entries))
|
||||
cb->addItem(comboInfo.displayText, comboInfo.data);
|
||||
if (info.m_combo.currentIndex >= 0 && info.m_combo.currentIndex < cb->count())
|
||||
cb->setCurrentIndex(info.m_combo.currentIndex);
|
||||
@@ -330,7 +330,7 @@ void InfoBarDisplay::update()
|
||||
hbox->addWidget(cb);
|
||||
}
|
||||
|
||||
for (const InfoBarEntry::Button &button : qAsConst(info.m_buttons)) {
|
||||
for (const InfoBarEntry::Button &button : std::as_const(info.m_buttons)) {
|
||||
auto infoWidgetButton = new QToolButton;
|
||||
infoWidgetButton->setText(button.text);
|
||||
infoWidgetButton->setToolTip(button.tooltip);
|
||||
|
@@ -13,7 +13,7 @@ using namespace Utils;
|
||||
|
||||
JsonMemoryPool::~JsonMemoryPool()
|
||||
{
|
||||
for (char *obj : qAsConst(_objs)) {
|
||||
for (char *obj : std::as_const(_objs)) {
|
||||
reinterpret_cast<JsonValue *>(obj)->~JsonValue();
|
||||
delete[] obj;
|
||||
}
|
||||
@@ -657,7 +657,7 @@ JsonSchemaManager::JsonSchemaManager(const QStringList &searchPaths)
|
||||
|
||||
JsonSchemaManager::~JsonSchemaManager()
|
||||
{
|
||||
for (const JsonSchemaData &schemaData : qAsConst(m_schemas))
|
||||
for (const JsonSchemaData &schemaData : std::as_const(m_schemas))
|
||||
delete schemaData.m_schema;
|
||||
}
|
||||
|
||||
|
@@ -79,7 +79,7 @@ bool CallerHandle::flushFor(SignalType signalType)
|
||||
{
|
||||
QMutexLocker locker(&m_mutex);
|
||||
const QList<SignalType> storedSignals =
|
||||
Utils::transform(qAsConst(m_signals), [](const LauncherSignal *launcherSignal) {
|
||||
Utils::transform(std::as_const(m_signals), [](const LauncherSignal *launcherSignal) {
|
||||
return launcherSignal->signalType();
|
||||
});
|
||||
|
||||
@@ -102,7 +102,7 @@ bool CallerHandle::flushFor(SignalType signalType)
|
||||
}
|
||||
}
|
||||
bool signalMatched = false;
|
||||
for (const LauncherSignal *storedSignal : qAsConst(oldSignals)) {
|
||||
for (const LauncherSignal *storedSignal : std::as_const(oldSignals)) {
|
||||
const SignalType storedSignalType = storedSignal->signalType();
|
||||
if (storedSignalType == signalType)
|
||||
signalMatched = true;
|
||||
@@ -653,7 +653,7 @@ void LauncherSocket::handleRequests()
|
||||
m_requests.clear();
|
||||
}
|
||||
|
||||
for (const QByteArray &request : qAsConst(requests))
|
||||
for (const QByteArray &request : std::as_const(requests))
|
||||
socket->write(request);
|
||||
}
|
||||
|
||||
|
@@ -128,7 +128,7 @@ protected:
|
||||
return;
|
||||
const double progressPerMap = MAX_PROGRESS / double(m_size);
|
||||
double progress = m_successfullyFinishedMapCount * progressPerMap;
|
||||
for (const QFutureWatcher<MapResult> *watcher : qAsConst(m_mapWatcher)) {
|
||||
for (const QFutureWatcher<MapResult> *watcher : std::as_const(m_mapWatcher)) {
|
||||
if (watcher->progressMinimum() != watcher->progressMaximum()) {
|
||||
const double range = watcher->progressMaximum() - watcher->progressMinimum();
|
||||
progress += (watcher->progressValue() - watcher->progressMinimum()) / range * progressPerMap;
|
||||
@@ -139,7 +139,7 @@ protected:
|
||||
|
||||
void cancelAll()
|
||||
{
|
||||
for (QFutureWatcher<MapResult> *watcher : qAsConst(m_mapWatcher))
|
||||
for (QFutureWatcher<MapResult> *watcher : std::as_const(m_mapWatcher))
|
||||
watcher->cancel();
|
||||
}
|
||||
|
||||
|
@@ -167,7 +167,7 @@ MimeType MimeDatabasePrivate::mimeTypeForFileNameAndData(const QString &fileName
|
||||
return candidateByData;
|
||||
}
|
||||
// If there is a glob match that is a sub class of sniffedMime, use it
|
||||
for (const QString &m : qAsConst(candidatesByName)) {
|
||||
for (const QString &m : std::as_const(candidatesByName)) {
|
||||
if (inherits(m, sniffedMime)) {
|
||||
// We have magic + pattern pointing to this, so it's a pretty good match
|
||||
*accuracyPtr = 100;
|
||||
@@ -425,7 +425,7 @@ QList<MimeType> MimeDatabase::mimeTypesForFileName(const QString &fileName) cons
|
||||
QStringList matches = d->mimeTypeForFileName(fileName);
|
||||
QList<MimeType> mimes;
|
||||
matches.sort(); // Make it deterministic
|
||||
for (const QString &mime : qAsConst(matches))
|
||||
for (const QString &mime : std::as_const(matches))
|
||||
mimes.append(d->mimeTypeForName(mime));
|
||||
return mimes;
|
||||
}
|
||||
|
@@ -252,7 +252,7 @@ bool MimeProviderBase::shouldCheck()
|
||||
// const QString lowerFileName = fileName.toLower();
|
||||
// MimeGlobMatchResult result;
|
||||
// // TODO this parses in the order (local, global). Check that it handles "NOGLOBS" correctly.
|
||||
// for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {
|
||||
// for (CacheFile *cacheFile : std::as_const(m_cacheFiles)) {
|
||||
// matchGlobList(result, cacheFile, cacheFile->getUint32(PosLiteralListOffset), fileName);
|
||||
// matchGlobList(result, cacheFile, cacheFile->getUint32(PosGlobListOffset), fileName);
|
||||
// const int reverseSuffixTreeOffset = cacheFile->getUint32(PosReverseSuffixTreeOffset);
|
||||
@@ -364,7 +364,7 @@ bool MimeProviderBase::shouldCheck()
|
||||
//MimeType MimeBinaryProvider::findByMagic(const QByteArray &data, int *accuracyPtr)
|
||||
//{
|
||||
// checkCache();
|
||||
// for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {
|
||||
// for (CacheFile *cacheFile : std::as_const(m_cacheFiles)) {
|
||||
// const int magicListOffset = cacheFile->getUint32(PosMagicListOffset);
|
||||
// const int numMatches = cacheFile->getUint32(magicListOffset);
|
||||
// //const int maxExtent = cacheFile->getUint32(magicListOffset + 4);
|
||||
@@ -392,7 +392,7 @@ bool MimeProviderBase::shouldCheck()
|
||||
// checkCache();
|
||||
// const QByteArray mimeStr = mime.toLatin1();
|
||||
// QStringList result;
|
||||
// for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {
|
||||
// for (CacheFile *cacheFile : std::as_const(m_cacheFiles)) {
|
||||
// const int parentListOffset = cacheFile->getUint32(PosParentListOffset);
|
||||
// const int numEntries = cacheFile->getUint32(parentListOffset);
|
||||
|
||||
@@ -432,7 +432,7 @@ bool MimeProviderBase::shouldCheck()
|
||||
//{
|
||||
// checkCache();
|
||||
// const QByteArray input = name.toLatin1();
|
||||
// for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {
|
||||
// for (CacheFile *cacheFile : std::as_const(m_cacheFiles)) {
|
||||
// const int aliasListOffset = cacheFile->getUint32(PosAliasListOffset);
|
||||
// const int numEntries = cacheFile->getUint32(aliasListOffset);
|
||||
// int begin = 0;
|
||||
@@ -463,7 +463,7 @@ bool MimeProviderBase::shouldCheck()
|
||||
// checkCache();
|
||||
// QStringList result;
|
||||
// const QByteArray input = name.toLatin1();
|
||||
// for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {
|
||||
// for (CacheFile *cacheFile : std::as_const(m_cacheFiles)) {
|
||||
// const int aliasListOffset = cacheFile->getUint32(PosAliasListOffset);
|
||||
// const int numEntries = cacheFile->getUint32(aliasListOffset);
|
||||
// for (int pos = 0; pos < numEntries; ++pos) {
|
||||
@@ -641,7 +641,7 @@ bool MimeProviderBase::shouldCheck()
|
||||
//{
|
||||
// checkCache();
|
||||
// const QByteArray inputMime = data.name.toLatin1();
|
||||
// for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {
|
||||
// for (CacheFile *cacheFile : std::as_const(m_cacheFiles)) {
|
||||
// const QString icon = iconForMime(cacheFile, PosIconsListOffset, inputMime);
|
||||
// if (!icon.isEmpty()) {
|
||||
// data.iconName = icon;
|
||||
@@ -654,7 +654,7 @@ bool MimeProviderBase::shouldCheck()
|
||||
//{
|
||||
// checkCache();
|
||||
// const QByteArray inputMime = data.name.toLatin1();
|
||||
// for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {
|
||||
// for (CacheFile *cacheFile : std::as_const(m_cacheFiles)) {
|
||||
// const QString icon = iconForMime(cacheFile, PosGenericIconsListOffset, inputMime);
|
||||
// if (!icon.isEmpty()) {
|
||||
// data.genericIconName = icon;
|
||||
@@ -696,7 +696,7 @@ MimeType MimeXMLProvider::findByMagic(const QByteArray &data, int *accuracyPtr)
|
||||
|
||||
QString candidate;
|
||||
|
||||
for (const MimeMagicRuleMatcher &matcher : qAsConst(m_magicMatchers)) {
|
||||
for (const MimeMagicRuleMatcher &matcher : std::as_const(m_magicMatchers)) {
|
||||
if (matcher.matches(data)) {
|
||||
const int priority = matcher.priority();
|
||||
if (priority > *accuracyPtr) {
|
||||
@@ -711,7 +711,7 @@ MimeType MimeXMLProvider::findByMagic(const QByteArray &data, int *accuracyPtr)
|
||||
QMap<int, QList<MimeMagicRule> > MimeXMLProvider::magicRulesForMimeType(const MimeType &mimeType)
|
||||
{
|
||||
QMap<int, QList<MimeMagicRule> > result;
|
||||
for (const MimeMagicRuleMatcher &matcher : qAsConst(m_magicMatchers)) {
|
||||
for (const MimeMagicRuleMatcher &matcher : std::as_const(m_magicMatchers)) {
|
||||
if (mimeType.matchesName(matcher.mimetype()))
|
||||
result[matcher.priority()].append(matcher.magicRules());
|
||||
}
|
||||
@@ -775,7 +775,7 @@ void MimeXMLProvider::ensureLoaded()
|
||||
}
|
||||
}
|
||||
|
||||
for (const QString &file : qAsConst(allFiles))
|
||||
for (const QString &file : std::as_const(allFiles))
|
||||
load(file);
|
||||
}
|
||||
}
|
||||
|
@@ -327,7 +327,7 @@ QStringList MimeType::suffixes() const
|
||||
MimeDatabasePrivate::instance()->provider()->loadMimeTypePrivate(*d);
|
||||
|
||||
QStringList result;
|
||||
for (const QString &pattern : qAsConst(d->globPatterns)) {
|
||||
for (const QString &pattern : std::as_const(d->globPatterns)) {
|
||||
const QString suffix = suffixFromPattern(pattern);
|
||||
if (!suffix.isEmpty())
|
||||
result.append(suffix);
|
||||
|
@@ -431,7 +431,7 @@ MimeType MimeDatabasePrivate::mimeTypeForFileNameAndData(const QString &fileName
|
||||
*accuracyPtr = 100;
|
||||
return candidateByData;
|
||||
}
|
||||
for (const QString &m : qAsConst(candidatesByName.m_allMatchingMimeTypes)) {
|
||||
for (const QString &m : std::as_const(candidatesByName.m_allMatchingMimeTypes)) {
|
||||
if (inherits(m, sniffedMime)) {
|
||||
// We have magic + pattern pointing to this, so it's a pretty good match
|
||||
*accuracyPtr = 100;
|
||||
|
@@ -479,10 +479,10 @@ void MimeBinaryProvider::addAllMimeTypes(QList<MimeType> &result)
|
||||
loadMimeTypeList();
|
||||
if (result.isEmpty()) {
|
||||
result.reserve(m_mimetypeNames.count());
|
||||
for (const QString &name : qAsConst(m_mimetypeNames))
|
||||
for (const QString &name : std::as_const(m_mimetypeNames))
|
||||
result.append(mimeTypeForNameUnchecked(name));
|
||||
} else {
|
||||
for (const QString &name : qAsConst(m_mimetypeNames))
|
||||
for (const QString &name : std::as_const(m_mimetypeNames))
|
||||
if (std::find_if(result.constBegin(), result.constEnd(), [name](const MimeType &mime) -> bool { return mime.name() == name; })
|
||||
== result.constEnd())
|
||||
result.append(mimeTypeForNameUnchecked(name));
|
||||
@@ -720,7 +720,7 @@ void MimeXMLProvider::findByMagic(const QByteArray &data, int *accuracyPtr, Mime
|
||||
{
|
||||
QString candidateName;
|
||||
bool foundOne = false;
|
||||
for (const MimeMagicRuleMatcher &matcher : qAsConst(m_magicMatchers)) {
|
||||
for (const MimeMagicRuleMatcher &matcher : std::as_const(m_magicMatchers)) {
|
||||
if (m_overriddenMimeTypes.contains(matcher.mimetype()))
|
||||
continue;
|
||||
if (matcher.matches(data)) {
|
||||
@@ -758,7 +758,7 @@ void MimeXMLProvider::ensureLoaded()
|
||||
|
||||
//qDebug() << "Loading" << m_allFiles;
|
||||
|
||||
for (const QString &file : qAsConst(allFiles))
|
||||
for (const QString &file : std::as_const(allFiles))
|
||||
load(file);
|
||||
}
|
||||
|
||||
|
@@ -234,7 +234,7 @@ QString MimeType::comment() const
|
||||
languageList << QLocale().name();
|
||||
languageList << QLocale().uiLanguages();
|
||||
languageList << QLatin1String("default"); // use the default locale if possible.
|
||||
for (const QString &language : qAsConst(languageList)) {
|
||||
for (const QString &language : std::as_const(languageList)) {
|
||||
const QString lang = language == QLatin1String("C") ? QLatin1String("en_US") : language;
|
||||
const QString comm = d->localeComments.value(lang);
|
||||
if (!comm.isEmpty())
|
||||
@@ -419,7 +419,7 @@ QStringList MimeType::suffixes() const
|
||||
MimeDatabasePrivate::instance()->loadMimeTypePrivate(const_cast<MimeTypePrivate&>(*d));
|
||||
|
||||
QStringList result;
|
||||
for (const QString &pattern : qAsConst(d->globPatterns)) {
|
||||
for (const QString &pattern : std::as_const(d->globPatterns)) {
|
||||
const QString suffix = suffixFromPattern(pattern);
|
||||
if (!suffix.isEmpty())
|
||||
result.append(suffix);
|
||||
|
@@ -40,7 +40,7 @@ void MinimizableInfoBars::setSettingsGroup(const QString &settingsGroup)
|
||||
void MinimizableInfoBars::createActions()
|
||||
{
|
||||
QTC_CHECK(m_actions.isEmpty());
|
||||
for (const Utils::InfoBarEntry &entry : qAsConst(m_infoEntries)) {
|
||||
for (const Utils::InfoBarEntry &entry : std::as_const(m_infoEntries)) {
|
||||
const Id id = entry.id();
|
||||
auto action = new QAction(this);
|
||||
action->setToolTip(entry.text());
|
||||
|
@@ -28,7 +28,7 @@ public:
|
||||
m_resultNameValueDictionary.modify(m_items);
|
||||
// Add removed variables again and mark them as "<UNSET>" so
|
||||
// that the user can actually see those removals:
|
||||
for (const NameValueItem &item : qAsConst(m_items)) {
|
||||
for (const NameValueItem &item : std::as_const(m_items)) {
|
||||
if (item.operation == NameValueItem::Unset)
|
||||
m_resultNameValueDictionary.set(item.name, NameValueModel::tr("<UNSET>"));
|
||||
}
|
||||
|
@@ -240,7 +240,7 @@ void OutputFormatter::setLineParsers(const QList<OutputLineParser *> &parsers)
|
||||
|
||||
void OutputFormatter::addLineParsers(const QList<OutputLineParser *> &parsers)
|
||||
{
|
||||
for (OutputLineParser * const p : qAsConst(parsers))
|
||||
for (OutputLineParser * const p : std::as_const(parsers))
|
||||
addLineParser(p);
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ void OutputFormatter::setFileFinder(const FileInProjectFinder &finder)
|
||||
|
||||
void OutputFormatter::setDemoteErrorsToWarnings(bool demote)
|
||||
{
|
||||
for (OutputLineParser * const p : qAsConst(d->lineParsers))
|
||||
for (OutputLineParser * const p : std::as_const(d->lineParsers))
|
||||
p->setDemoteErrorsToWarnings(demote);
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ void OutputFormatter::doAppendMessage(const QString &text, OutputFormat format)
|
||||
if (linkified.isEmpty())
|
||||
append({}, charFmt); // This might cause insertion of a newline character.
|
||||
|
||||
for (OutputLineParser * const p : qAsConst(involvedParsers)) {
|
||||
for (OutputLineParser * const p : std::as_const(involvedParsers)) {
|
||||
if (d->postPrintAction)
|
||||
d->postPrintAction(p);
|
||||
else
|
||||
@@ -340,7 +340,7 @@ OutputLineParser::Result OutputFormatter::handleMessage(const QString &text, Out
|
||||
}
|
||||
}
|
||||
QTC_CHECK(!d->nextParser);
|
||||
for (OutputLineParser * const parser : qAsConst(d->lineParsers)) {
|
||||
for (OutputLineParser * const parser : std::as_const(d->lineParsers)) {
|
||||
if (parser == oldNextParser) // We tried that one already.
|
||||
continue;
|
||||
const OutputLineParser::Result res
|
||||
@@ -532,7 +532,7 @@ void OutputFormatter::handleLink(const QString &href)
|
||||
// to the line parsers.
|
||||
if (handleFileLink(href))
|
||||
return;
|
||||
for (OutputLineParser * const f : qAsConst(d->lineParsers)) {
|
||||
for (OutputLineParser * const f : std::as_const(d->lineParsers)) {
|
||||
if (f->handleLink(href))
|
||||
return;
|
||||
}
|
||||
@@ -575,7 +575,7 @@ void OutputFormatter::flush()
|
||||
flushIncompleteLine();
|
||||
flushTrailingNewline();
|
||||
d->escapeCodeHandler.endFormatScope();
|
||||
for (OutputLineParser * const p : qAsConst(d->lineParsers))
|
||||
for (OutputLineParser * const p : std::as_const(d->lineParsers))
|
||||
p->flush();
|
||||
if (d->nextParser)
|
||||
d->nextParser->runPostPrintActions(plainTextEdit());
|
||||
@@ -590,13 +590,13 @@ bool OutputFormatter::hasFatalErrors() const
|
||||
|
||||
void OutputFormatter::addSearchDir(const FilePath &dir)
|
||||
{
|
||||
for (OutputLineParser * const p : qAsConst(d->lineParsers))
|
||||
for (OutputLineParser * const p : std::as_const(d->lineParsers))
|
||||
p->addSearchDir(dir);
|
||||
}
|
||||
|
||||
void OutputFormatter::dropSearchDir(const FilePath &dir)
|
||||
{
|
||||
for (OutputLineParser * const p : qAsConst(d->lineParsers))
|
||||
for (OutputLineParser * const p : std::as_const(d->lineParsers))
|
||||
p->dropSearchDir(dir);
|
||||
}
|
||||
|
||||
|
@@ -141,7 +141,7 @@ bool PortList::hasMore() const { return !d->ranges.isEmpty(); }
|
||||
|
||||
bool PortList::contains(Port port) const
|
||||
{
|
||||
for (const Internal::Range &r : qAsConst(d->ranges)) {
|
||||
for (const Internal::Range &r : std::as_const(d->ranges)) {
|
||||
if (port >= r.first && port <= r.second)
|
||||
return true;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ bool PortList::contains(Port port) const
|
||||
int PortList::count() const
|
||||
{
|
||||
int n = 0;
|
||||
for (const Internal::Range &r : qAsConst(d->ranges))
|
||||
for (const Internal::Range &r : std::as_const(d->ranges))
|
||||
n += r.second.number() - r.first.number() + 1;
|
||||
return n;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ Port PortList::getNext()
|
||||
QString PortList::toString() const
|
||||
{
|
||||
QString stringRep;
|
||||
for (const Internal::Range &range : qAsConst(d->ranges)) {
|
||||
for (const Internal::Range &range : std::as_const(d->ranges)) {
|
||||
stringRep += QString::number(range.first.number());
|
||||
if (range.second != range.first)
|
||||
stringRep += QLatin1Char('-') + QString::number(range.second.number());
|
||||
|
@@ -839,7 +839,7 @@ QList<ProcessInterfaceSignal *> GeneralProcessBlockingImpl::takeSignalsFor(Proce
|
||||
return takeAllSignals();
|
||||
|
||||
QMutexLocker locker(&m_mutex);
|
||||
const QList<ProcessSignalType> storedSignals = transform(qAsConst(m_signals),
|
||||
const QList<ProcessSignalType> storedSignals = transform(std::as_const(m_signals),
|
||||
[](const ProcessInterfaceSignal *aSignal) {
|
||||
return aSignal->signalType();
|
||||
});
|
||||
@@ -866,7 +866,7 @@ bool GeneralProcessBlockingImpl::flushSignals(const QList<ProcessInterfaceSignal
|
||||
ProcessSignalType *signalType)
|
||||
{
|
||||
bool signalMatched = false;
|
||||
for (const ProcessInterfaceSignal *storedSignal : qAsConst(signalList)) {
|
||||
for (const ProcessInterfaceSignal *storedSignal : std::as_const(signalList)) {
|
||||
const ProcessSignalType storedSignalType = storedSignal->signalType();
|
||||
if (signalType && storedSignalType == *signalType)
|
||||
signalMatched = true;
|
||||
|
@@ -388,7 +388,7 @@ void Wizard::showVariables()
|
||||
QHash<QString, QVariant> vars = variables();
|
||||
QList<QString> keys = vars.keys();
|
||||
sort(keys);
|
||||
for (const QString &key : qAsConst(keys)) {
|
||||
for (const QString &key : std::as_const(keys)) {
|
||||
const QVariant &v = vars.value(key);
|
||||
result += QLatin1String(" <tr><td>")
|
||||
+ key + QLatin1String("</td><td>")
|
||||
|
@@ -212,11 +212,11 @@ static AndroidDeviceInfoList listVirtualDevices(const AndroidConfig &config)
|
||||
avdErrorPaths.clear();
|
||||
avdList = parseAvdList(output, &avdErrorPaths);
|
||||
allAvdErrorPaths << avdErrorPaths;
|
||||
for (const QString &avdPathStr : qAsConst(avdErrorPaths))
|
||||
for (const QString &avdPathStr : std::as_const(avdErrorPaths))
|
||||
avdConfigEditManufacturerTag(avdPathStr); // comment out manufacturer tag
|
||||
} while (!avdErrorPaths.isEmpty()); // try again
|
||||
|
||||
for (const QString &avdPathStr : qAsConst(allAvdErrorPaths))
|
||||
for (const QString &avdPathStr : std::as_const(allAvdErrorPaths))
|
||||
avdConfigEditManufacturerTag(avdPathStr, true); // re-add manufacturer tag
|
||||
|
||||
return avdList;
|
||||
|
@@ -673,7 +673,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(QString *error) const
|
||||
|
||||
// workaround for '????????????' serial numbers:
|
||||
// can use "adb -d" when only one usb device attached
|
||||
for (const QString &device : qAsConst(adbDevs)) {
|
||||
for (const QString &device : std::as_const(adbDevs)) {
|
||||
const QString serialNo = device.left(device.indexOf('\t')).trimmed();
|
||||
const QString deviceType = device.mid(device.indexOf('\t')).trimmed();
|
||||
AndroidDeviceInfo dev;
|
||||
@@ -1538,7 +1538,7 @@ FilePath AndroidConfig::getJdkPath()
|
||||
// Look for the highest existing JDK
|
||||
allVersions.sort();
|
||||
std::reverse(allVersions.begin(), allVersions.end()); // Order descending
|
||||
for (const QString &version : qAsConst(allVersions)) {
|
||||
for (const QString &version : std::as_const(allVersions)) {
|
||||
settings.beginGroup(version);
|
||||
jdkHome = FilePath::fromUserInput(settings.value("JavaHome").toString());
|
||||
settings.endGroup();
|
||||
|
@@ -1052,7 +1052,7 @@ void AndroidManifestEditorWidget::parseManifest(QXmlStreamReader &reader, QXmlSt
|
||||
writer.writeComment(QLatin1String(" %%INSERT_FEATURES "));
|
||||
|
||||
if (!permissions.isEmpty()) {
|
||||
for (const QString &permission : qAsConst(permissions)) {
|
||||
for (const QString &permission : std::as_const(permissions)) {
|
||||
writer.writeEmptyElement(QLatin1String("uses-permission"));
|
||||
writer.writeAttribute(QLatin1String("android:name"), permission);
|
||||
}
|
||||
|
@@ -123,7 +123,7 @@ void AndroidPackageInstallationStep::setupOutputFormatter(OutputFormatter *forma
|
||||
void AndroidPackageInstallationStep::doRun()
|
||||
{
|
||||
QString error;
|
||||
for (const QString &dir : qAsConst(m_androidDirsToClean)) {
|
||||
for (const QString &dir : std::as_const(m_androidDirsToClean)) {
|
||||
FilePath androidDir = FilePath::fromString(dir);
|
||||
if (!dir.isEmpty() && androidDir.exists()) {
|
||||
emit addOutput(Tr::tr("Removing directory %1").arg(dir), OutputFormat::NormalMessage);
|
||||
|
@@ -416,7 +416,7 @@ void AndroidRunnerWorker::logcatProcess(const QByteArray &text, QByteArray &buff
|
||||
}
|
||||
|
||||
QString pidString = QString::number(m_processPID);
|
||||
for (const QByteArray &msg : qAsConst(lines)) {
|
||||
for (const QByteArray &msg : std::as_const(lines)) {
|
||||
const QString line = QString::fromUtf8(msg).trimmed() + QLatin1Char('\n');
|
||||
if (!line.contains(pidString))
|
||||
continue;
|
||||
@@ -526,7 +526,7 @@ void AndroidRunnerWorker::asyncStartHelper()
|
||||
forceStop();
|
||||
asyncStartLogcat();
|
||||
|
||||
for (const QString &entry : qAsConst(m_beforeStartAdbCommands))
|
||||
for (const QString &entry : std::as_const(m_beforeStartAdbCommands))
|
||||
runAdb(entry.split(' ', Qt::SkipEmptyParts));
|
||||
|
||||
QStringList args({"shell", "am", "start"});
|
||||
@@ -823,7 +823,7 @@ void AndroidRunnerWorker::onProcessIdChanged(qint64 pid)
|
||||
m_debugServerProcess.reset();
|
||||
|
||||
// Run adb commands after application quit.
|
||||
for (const QString &entry: qAsConst(m_afterFinishAdbCommands))
|
||||
for (const QString &entry: std::as_const(m_afterFinishAdbCommands))
|
||||
runAdb(entry.split(' ', Qt::SkipEmptyParts));
|
||||
} else {
|
||||
// In debugging cases this will be funneled to the engine to actually start
|
||||
|
@@ -536,7 +536,7 @@ void SdkManagerOutputParser::compilePackageAssociations()
|
||||
deleteAlreadyInstalled(images);
|
||||
|
||||
// Associate the system images with sdk platforms.
|
||||
for (AndroidSdkPackage *image : qAsConst(images)) {
|
||||
for (AndroidSdkPackage *image : std::as_const(images)) {
|
||||
int imageApi = m_systemImages[image];
|
||||
auto itr = std::find_if(m_packages.begin(), m_packages.end(),
|
||||
[imageApi](const AndroidSdkPackage *p) {
|
||||
@@ -651,7 +651,7 @@ bool SdkManagerOutputParser::parseAbstractData(SdkManagerOutputParser::GenericPa
|
||||
keys << installLocationKey << revisionKey << descriptionKey;
|
||||
for (const QString &line : input) {
|
||||
QString value;
|
||||
for (const auto &key: qAsConst(keys)) {
|
||||
for (const auto &key: std::as_const(keys)) {
|
||||
if (valueForKey(key, line, &value)) {
|
||||
if (key == installLocationKey)
|
||||
output.installedLocation = Utils::FilePath::fromUserInput(value);
|
||||
@@ -1123,7 +1123,7 @@ void AndroidSdkManagerPrivate::parseCommonArguments(QFutureInterface<QString> &f
|
||||
|
||||
void AndroidSdkManagerPrivate::clearPackages()
|
||||
{
|
||||
for (AndroidSdkPackage *p : qAsConst(m_allPackages))
|
||||
for (AndroidSdkPackage *p : std::as_const(m_allPackages))
|
||||
delete p;
|
||||
m_allPackages.clear();
|
||||
}
|
||||
|
@@ -281,7 +281,7 @@ void AndroidSdkModel::selectMissingEssentials()
|
||||
}
|
||||
|
||||
// Select SDK platform
|
||||
for (const SdkPlatform *platform : qAsConst(m_sdkPlatforms)) {
|
||||
for (const SdkPlatform *platform : std::as_const(m_sdkPlatforms)) {
|
||||
if (!platform->installedLocation().isEmpty()) {
|
||||
pendingPkgs.removeOne(platform->sdkStylePath());
|
||||
} else if (pendingPkgs.contains(platform->sdkStylePath()) &&
|
||||
|
@@ -133,7 +133,7 @@ SdkPlatform::SdkPlatform(const QVersionNumber &version, const QString &sdkStyleP
|
||||
|
||||
SdkPlatform::~SdkPlatform()
|
||||
{
|
||||
for (SystemImage *image : qAsConst(m_systemImages))
|
||||
for (SystemImage *image : std::as_const(m_systemImages))
|
||||
delete image;
|
||||
m_systemImages.clear();
|
||||
}
|
||||
|
@@ -235,7 +235,7 @@ void AvdDialog::updateDeviceDefinitionComboBox()
|
||||
m_deviceDefinitionTypeComboBox->currentText());
|
||||
|
||||
m_deviceDefinitionComboBox->clear();
|
||||
for (const DeviceDefinitionStruct &item : qAsConst(m_deviceDefinitionsList)) {
|
||||
for (const DeviceDefinitionStruct &item : std::as_const(m_deviceDefinitionsList)) {
|
||||
if (item.deviceType == curDeviceType)
|
||||
m_deviceDefinitionComboBox->addItem(item.name_id);
|
||||
}
|
||||
@@ -289,7 +289,7 @@ void AvdDialog::updateApiLevelComboBox()
|
||||
});
|
||||
|
||||
m_targetApiComboBox->clear();
|
||||
for (SystemImage *image : qAsConst(filteredList)) {
|
||||
for (SystemImage *image : std::as_const(filteredList)) {
|
||||
QString imageString = "android-" % QString::number(image->apiLevel());
|
||||
const QStringList imageSplits = image->sdkStylePath().split(';');
|
||||
if (imageSplits.size() == 4)
|
||||
|
@@ -182,7 +182,7 @@ QList<ITestConfiguration *> BoostTestTreeItem::getAllTestConfigurations() const
|
||||
});
|
||||
|
||||
for (auto it = testsPerProjectfile.begin(), end = testsPerProjectfile.end(); it != end; ++it) {
|
||||
for (const QString &target : qAsConst(it.value().internalTargets)) {
|
||||
for (const QString &target : std::as_const(it.value().internalTargets)) {
|
||||
BoostTestConfiguration *config = new BoostTestConfiguration(framework());
|
||||
config->setProject(project);
|
||||
config->setProjectFile(it.key());
|
||||
|
@@ -250,7 +250,7 @@ QList<ITestConfiguration *> CatchTreeItem::getFailedTestConfigurations() const
|
||||
collectFailedTestInfo(this, testCasesForProFile);
|
||||
|
||||
for (auto it = testCasesForProFile.begin(), end = testCasesForProFile.end(); it != end; ++it) {
|
||||
for (const QString &target : qAsConst(it.value().internalTargets)) {
|
||||
for (const QString &target : std::as_const(it.value().internalTargets)) {
|
||||
CatchConfiguration *tc = new CatchConfiguration(framework());
|
||||
tc->setTestCases(it.value().names);
|
||||
tc->setProjectFile(it.key());
|
||||
@@ -321,7 +321,7 @@ QList<ITestConfiguration *> CatchTreeItem::getTestConfigurations(bool ignoreChec
|
||||
collectTestInfo(childItem(row), testCasesForProfile, ignoreCheckState);
|
||||
|
||||
for (auto it = testCasesForProfile.begin(), end = testCasesForProfile.end(); it != end; ++it) {
|
||||
for (const QString &target : qAsConst(it.value().internalTargets)) {
|
||||
for (const QString &target : std::as_const(it.value().internalTargets)) {
|
||||
CatchConfiguration *tc = new CatchConfiguration(framework());
|
||||
tc->setTestCases(it.value().names);
|
||||
if (ignoreCheckState)
|
||||
|
@@ -261,7 +261,7 @@ QList<ITestConfiguration *> GTestTreeItem::getTestConfigurations(bool ignoreChec
|
||||
}
|
||||
|
||||
for (auto it = testCasesForProFile.begin(), end = testCasesForProFile.end(); it != end; ++it) {
|
||||
for (const QString &target : qAsConst(it.value().internalTargets)) {
|
||||
for (const QString &target : std::as_const(it.value().internalTargets)) {
|
||||
GTestConfiguration *tc = new GTestConfiguration(framework());
|
||||
if (!ignoreCheckState)
|
||||
tc->setTestCases(it.value().filters);
|
||||
@@ -297,7 +297,7 @@ QList<ITestConfiguration *> GTestTreeItem::getFailedTestConfigurations() const
|
||||
collectFailedTestInfo(this, testCasesForProFile);
|
||||
|
||||
for (auto it = testCasesForProFile.begin(), end = testCasesForProFile.end(); it != end; ++it) {
|
||||
for (const QString &target : qAsConst(it.value().internalTargets)) {
|
||||
for (const QString &target : std::as_const(it.value().internalTargets)) {
|
||||
GTestConfiguration *tc = new GTestConfiguration(framework());
|
||||
tc->setTestCases(it.value().filters);
|
||||
tc->setTestCaseCount(tc->testCaseCount() + it.value().testSetCount);
|
||||
@@ -331,7 +331,7 @@ QList<ITestConfiguration *> GTestTreeItem::getTestConfigurationsForFile(const Ut
|
||||
}
|
||||
});
|
||||
for (auto it = testCases.begin(), end = testCases.end(); it != end; ++it) {
|
||||
for (const QString &target : qAsConst(it.value().internalTargets)) {
|
||||
for (const QString &target : std::as_const(it.value().internalTargets)) {
|
||||
GTestConfiguration *tc = new GTestConfiguration(framework());
|
||||
tc->setTestCases(it.value().filters);
|
||||
tc->setProjectFile(it.key());
|
||||
|
@@ -111,7 +111,7 @@ void ProjectTestSettingsWidget::populateFrameworks(const QHash<ITestFramework *,
|
||||
item->setData(0, BaseTypeRole, frameworkOrTestTool->type());
|
||||
};
|
||||
|
||||
for (ITestFramework *framework : qAsConst(sortedFrameworks))
|
||||
for (ITestFramework *framework : std::as_const(sortedFrameworks))
|
||||
generateItem(framework, frameworks.value(framework));
|
||||
|
||||
// FIXME: testTools aren't sorted and we cannot use priority here
|
||||
|
@@ -163,7 +163,7 @@ static CPlusPlus::Document::Ptr declaringDocument(CPlusPlus::Document::Ptr doc,
|
||||
}
|
||||
}
|
||||
|
||||
for (const CPlusPlus::LookupItem &item : qAsConst(lookupItems)) {
|
||||
for (const CPlusPlus::LookupItem &item : std::as_const(lookupItems)) {
|
||||
if (CPlusPlus::Symbol *symbol = item.declaration()) {
|
||||
if (CPlusPlus::Class *toeClass = symbol->asClass()) {
|
||||
const QString declFileName = QLatin1String(toeClass->fileId()->chars(),
|
||||
|
@@ -180,7 +180,7 @@ QList<Document::Ptr> QuickTestParser::scanDirectoryForQuickTestQmlFiles(const Ut
|
||||
|
||||
QList<Document::Ptr> foundDocs;
|
||||
|
||||
for (const Utils::FilePath &path : qAsConst(dirs)) {
|
||||
for (const Utils::FilePath &path : std::as_const(dirs)) {
|
||||
const QList<Document::Ptr> docs = snapshot.documentsInDirectory(path);
|
||||
for (const Document::Ptr &doc : docs) {
|
||||
Utils::FilePath fi = doc->fileName();
|
||||
|
@@ -318,11 +318,11 @@ void TestCodeParser::scanForTests(const Utils::FilePaths &fileList,
|
||||
}
|
||||
} else if (!parsers.isEmpty()) {
|
||||
for (ITestParser *parser: parsers) {
|
||||
for (const Utils::FilePath &filePath : qAsConst(list))
|
||||
for (const Utils::FilePath &filePath : std::as_const(list))
|
||||
parser->framework()->rootNode()->markForRemovalRecursively(filePath);
|
||||
}
|
||||
} else {
|
||||
for (const Utils::FilePath &filePath : qAsConst(list))
|
||||
for (const Utils::FilePath &filePath : std::as_const(list))
|
||||
emit requestRemoval(filePath);
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ void TestCodeParser::parsePostponedFiles()
|
||||
|
||||
void TestCodeParser::releaseParserInternals()
|
||||
{
|
||||
for (ITestParser *parser : qAsConst(m_testCodeParsers))
|
||||
for (ITestParser *parser : std::as_const(m_testCodeParsers))
|
||||
parser->release();
|
||||
}
|
||||
|
||||
|
@@ -210,7 +210,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
|
||||
QList<RunConfiguration *> runConfigurations = target->runConfigurations();
|
||||
runConfigurations.removeOne(target->activeRunConfiguration());
|
||||
runConfigurations.prepend(target->activeRunConfiguration());
|
||||
for (RunConfiguration *runConfig : qAsConst(runConfigurations)) {
|
||||
for (RunConfiguration *runConfig : std::as_const(runConfigurations)) {
|
||||
qCDebug(LOG) << "RunConfiguration" << runConfig->id();
|
||||
if (!isLocal(target)) { // TODO add device support
|
||||
qCDebug(LOG) << " Skipped as not being local";
|
||||
|
@@ -51,11 +51,11 @@ bool TestFrameworkManager::registerTestTool(ITestTool *testTool)
|
||||
void TestFrameworkManager::activateFrameworksAndToolsFromSettings(
|
||||
const Internal::TestSettings *settings)
|
||||
{
|
||||
for (ITestFramework *framework : qAsConst(s_instance->m_registeredFrameworks)) {
|
||||
for (ITestFramework *framework : std::as_const(s_instance->m_registeredFrameworks)) {
|
||||
framework->setActive(settings->frameworks.value(framework->id(), false));
|
||||
framework->setGrouping(settings->frameworksGrouping.value(framework->id(), false));
|
||||
}
|
||||
for (ITestTool *testTool : qAsConst(s_instance->m_registeredTestTools))
|
||||
for (ITestTool *testTool : std::as_const(s_instance->m_registeredTestTools))
|
||||
testTool->setActive(settings->tools.value(testTool->id(), false));
|
||||
}
|
||||
|
||||
@@ -99,11 +99,11 @@ ITestTool *TestFrameworkManager::testToolForBuildSystemId(Id buildSystemId)
|
||||
void TestFrameworkManager::synchronizeSettings(QSettings *s)
|
||||
{
|
||||
Internal::AutotestPlugin::settings()->fromSettings(s);
|
||||
for (ITestFramework *framework : qAsConst(m_registeredFrameworks)) {
|
||||
for (ITestFramework *framework : std::as_const(m_registeredFrameworks)) {
|
||||
if (ITestSettings *fSettings = framework->testSettings())
|
||||
fSettings->readSettings(s);
|
||||
}
|
||||
for (ITestTool *testTool : qAsConst(m_registeredTestTools)) {
|
||||
for (ITestTool *testTool : std::as_const(m_registeredTestTools)) {
|
||||
if (ITestSettings *tSettings = testTool->testSettings())
|
||||
tSettings->readSettings(s);
|
||||
}
|
||||
|
@@ -338,7 +338,7 @@ void TestResultModel::recalculateMaxWidthOfFileName(const QFont &font)
|
||||
{
|
||||
const QFontMetrics fm(font);
|
||||
m_maxWidthOfFileName = 0;
|
||||
for (const QString &fileName : qAsConst(m_fileNames)) {
|
||||
for (const QString &fileName : std::as_const(m_fileNames)) {
|
||||
m_maxWidthOfFileName = qMax(m_maxWidthOfFileName, fm.horizontalAdvance(fileName));
|
||||
}
|
||||
}
|
||||
|
@@ -462,7 +462,7 @@ int TestRunner::precheckTestConfigurations()
|
||||
{
|
||||
const bool omitWarnings = AutotestPlugin::settings()->omitRunConfigWarn;
|
||||
int testCaseCount = 0;
|
||||
for (ITestConfiguration *itc : qAsConst(m_selectedTests)) {
|
||||
for (ITestConfiguration *itc : std::as_const(m_selectedTests)) {
|
||||
if (itc->testBase()->type() == ITestBase::Tool) {
|
||||
if (itc->project()) {
|
||||
testCaseCount += itc->testCaseCount();
|
||||
@@ -509,7 +509,7 @@ void TestRunner::runTests()
|
||||
{
|
||||
QList<ITestConfiguration *> toBeRemoved;
|
||||
bool projectChanged = false;
|
||||
for (ITestConfiguration *itc : qAsConst(m_selectedTests)) {
|
||||
for (ITestConfiguration *itc : std::as_const(m_selectedTests)) {
|
||||
if (itc->testBase()->type() == ITestBase::Tool) {
|
||||
if (itc->project() != SessionManager::startupProject()) {
|
||||
projectChanged = true;
|
||||
|
@@ -374,7 +374,7 @@ void TestTreeModel::synchronizeTestTools()
|
||||
for (ITestTreeItem *oldFrameworkRoot : oldFrameworkRoots)
|
||||
takeItem(oldFrameworkRoot); // do NOT delete the ptr is still held by TestFrameworkManager
|
||||
|
||||
for (ITestTool *testTool : qAsConst(tools)) {
|
||||
for (ITestTool *testTool : std::as_const(tools)) {
|
||||
ITestTreeItem *testToolRootNode = testTool->rootNode();
|
||||
invisibleRoot->appendChild(testToolRootNode);
|
||||
if (!oldFrameworkRoots.removeOne(testToolRootNode))
|
||||
|
@@ -93,7 +93,7 @@ void AutotoolsBuildSystem::makefileParsingFinished()
|
||||
}
|
||||
|
||||
auto newRoot = std::make_unique<ProjectNode>(project()->projectDirectory());
|
||||
for (const QString &f : qAsConst(m_files)) {
|
||||
for (const QString &f : std::as_const(m_files)) {
|
||||
const Utils::FilePath path = Utils::FilePath::fromString(f);
|
||||
newRoot->addNestedNode(std::make_unique<FileNode>(path,
|
||||
FileNode::fileTypeForFileName(path)));
|
||||
|
@@ -239,7 +239,7 @@ void MakefileParser::parseSubDirs()
|
||||
|
||||
// Delegate the parsing of all sub directories to a local
|
||||
// makefile parser and merge the results
|
||||
for (const QString &subDir : qAsConst(subDirs)) {
|
||||
for (const QString &subDir : std::as_const(subDirs)) {
|
||||
const QChar slash = QLatin1Char('/');
|
||||
const QString subDirMakefile = path + slash + subDir
|
||||
+ slash + makefileName;
|
||||
|
@@ -103,7 +103,7 @@ void DebugServerProviderManager::restoreProviders()
|
||||
map[key.mid(lastDot + 1)] = map[key];
|
||||
}
|
||||
bool restored = false;
|
||||
for (IDebugServerProviderFactory *f : qAsConst(m_factories)) {
|
||||
for (IDebugServerProviderFactory *f : std::as_const(m_factories)) {
|
||||
if (f->canRestore(map)) {
|
||||
if (IDebugServerProvider *p = f->restore(map)) {
|
||||
registerProvider(p);
|
||||
@@ -127,7 +127,7 @@ void DebugServerProviderManager::saveProviders()
|
||||
data.insert(fileVersionKeyC, 1);
|
||||
|
||||
int count = 0;
|
||||
for (const IDebugServerProvider *p : qAsConst(m_providers)) {
|
||||
for (const IDebugServerProvider *p : std::as_const(m_providers)) {
|
||||
if (p->isValid()) {
|
||||
const QVariantMap tmp = p->toMap();
|
||||
if (tmp.isEmpty())
|
||||
@@ -179,7 +179,7 @@ bool DebugServerProviderManager::registerProvider(IDebugServerProvider *provider
|
||||
{
|
||||
if (!provider || m_instance->m_providers.contains(provider))
|
||||
return true;
|
||||
for (const IDebugServerProvider *current : qAsConst(m_instance->m_providers)) {
|
||||
for (const IDebugServerProvider *current : std::as_const(m_instance->m_providers)) {
|
||||
if (*provider == *current)
|
||||
return false;
|
||||
QTC_ASSERT(current->id() != provider->id(), return false);
|
||||
|
@@ -146,7 +146,7 @@ DebugServerProviderNode *DebugServerProviderModel::nodeForIndex(const QModelInde
|
||||
void DebugServerProviderModel::apply()
|
||||
{
|
||||
// Remove unused providers
|
||||
for (IDebugServerProvider *provider : qAsConst(m_providersToRemove))
|
||||
for (IDebugServerProvider *provider : std::as_const(m_providersToRemove))
|
||||
DebugServerProviderManager::deregisterProvider(provider);
|
||||
QTC_ASSERT(m_providersToRemove.isEmpty(), m_providersToRemove.clear());
|
||||
|
||||
@@ -166,7 +166,7 @@ void DebugServerProviderModel::apply()
|
||||
|
||||
// Add new (and already updated) providers
|
||||
QStringList skippedProviders;
|
||||
for (IDebugServerProvider *provider: qAsConst(m_providersToAdd)) {
|
||||
for (IDebugServerProvider *provider: std::as_const(m_providersToAdd)) {
|
||||
if (!DebugServerProviderManager::registerProvider(provider))
|
||||
skippedProviders << provider->displayName();
|
||||
}
|
||||
|
@@ -73,7 +73,7 @@ static void extractAllFiles(const DebuggerRunTool *runTool, QStringList &include
|
||||
return;
|
||||
const QVector<ProjectPart::ConstPtr> parts = info->projectParts();
|
||||
for (const ProjectPart::ConstPtr &part : parts) {
|
||||
for (const ProjectFile &file : qAsConst(part->files)) {
|
||||
for (const ProjectFile &file : std::as_const(part->files)) {
|
||||
if (!file.active)
|
||||
continue;
|
||||
const auto path = FilePath::fromString(file.path);
|
||||
@@ -84,7 +84,7 @@ static void extractAllFiles(const DebuggerRunTool *runTool, QStringList &include
|
||||
else if (file.path.endsWith(".s") && !assemblers.contains(path))
|
||||
assemblers.push_back(path);
|
||||
}
|
||||
for (const HeaderPath &include : qAsConst(part->headerPaths)) {
|
||||
for (const HeaderPath &include : std::as_const(part->headerPaths)) {
|
||||
if (!includes.contains(include.path))
|
||||
includes.push_back(include.path);
|
||||
}
|
||||
|
@@ -215,7 +215,7 @@ void DeviceSelectionModel::fillAllPacks(const FilePath &toolsIniFile)
|
||||
|
||||
if (allPackFiles.isEmpty())
|
||||
return;
|
||||
for (const QString &packFile : qAsConst(allPackFiles))
|
||||
for (const QString &packFile : std::as_const(allPackFiles))
|
||||
parsePackage(packFile);
|
||||
}
|
||||
|
||||
|
@@ -78,7 +78,7 @@ QVariantMap DeviceSelection::toMap() const
|
||||
map.insert(deviceMpuKeyC, cpu.mpu);
|
||||
// Device MEMORY.
|
||||
QVariantList memoryList;
|
||||
for (const DeviceSelection::Memory &memory : qAsConst(memories)) {
|
||||
for (const DeviceSelection::Memory &memory : std::as_const(memories)) {
|
||||
QVariantMap m;
|
||||
m.insert(deviceMemoryIdKeyC, memory.id);
|
||||
m.insert(deviceMemoryStartKeyC, memory.start);
|
||||
@@ -88,7 +88,7 @@ QVariantMap DeviceSelection::toMap() const
|
||||
map.insert(deviceMemoryKeyC, memoryList);
|
||||
// Device ALGORITHM.
|
||||
QVariantList algorithmList;
|
||||
for (const DeviceSelection::Algorithm &algorithm : qAsConst(algorithms)) {
|
||||
for (const DeviceSelection::Algorithm &algorithm : std::as_const(algorithms)) {
|
||||
QVariantMap m;
|
||||
m.insert(deviceAlgorithmPathKeyC, algorithm.path);
|
||||
m.insert(deviceAlgorithmFlashStartKeyC, algorithm.flashStart);
|
||||
|
@@ -123,13 +123,13 @@ void DriverSelectionModel::fillDrivers(const FilePath &toolsIniFile,
|
||||
if (!collectCpuDllsAndDrivers(&f, allCpuDlls, allDrivers))
|
||||
return;
|
||||
|
||||
for (const Dll &dll : qAsConst(allDrivers)) {
|
||||
for (const Dll &dll : std::as_const(allDrivers)) {
|
||||
if (!supportedDrivers.contains(dll.path))
|
||||
continue;
|
||||
const auto item = new DriverSelectionItem(dll.index);
|
||||
item->m_dll = dll.path;
|
||||
item->m_name = dll.content;
|
||||
for (const Dll &cpu : qAsConst(allCpuDlls)) {
|
||||
for (const Dll &cpu : std::as_const(allCpuDlls)) {
|
||||
const QStringList mnemonics = cpu.content.split(',');
|
||||
if (mnemonics.contains(dll.mnemonic))
|
||||
item->m_cpuDlls.push_back(cpu.path);
|
||||
|
@@ -490,7 +490,7 @@ Toolchains IarToolChainFactory::autoDetectToolchains(
|
||||
{
|
||||
Toolchains result;
|
||||
|
||||
for (const Candidate &candidate : qAsConst(candidates)) {
|
||||
for (const Candidate &candidate : std::as_const(candidates)) {
|
||||
const Toolchains filtered = Utils::filtered(alreadyKnown, [candidate](ToolChain *tc) {
|
||||
return tc->typeId() == Constants::IAREW_TOOLCHAIN_TYPEID
|
||||
&& tc->compilerCommand() == candidate.compilerPath
|
||||
|
@@ -635,7 +635,7 @@ Toolchains KeilToolChainFactory::autoDetectToolchains(
|
||||
{
|
||||
Toolchains result;
|
||||
|
||||
for (const Candidate &candidate : qAsConst(candidates)) {
|
||||
for (const Candidate &candidate : std::as_const(candidates)) {
|
||||
const Toolchains filtered = Utils::filtered(
|
||||
alreadyKnown, [candidate](ToolChain *tc) {
|
||||
return tc->typeId() == Constants::IAREW_TOOLCHAIN_TYPEID
|
||||
|
@@ -346,7 +346,7 @@ Toolchains SdccToolChainFactory::autoDetectToolchains(
|
||||
{
|
||||
Toolchains result;
|
||||
|
||||
for (const Candidate &candidate : qAsConst(candidates)) {
|
||||
for (const Candidate &candidate : std::as_const(candidates)) {
|
||||
const Toolchains filtered = Utils::filtered(alreadyKnown, [candidate](ToolChain *tc) {
|
||||
return tc->typeId() == Constants::SDCC_TOOLCHAIN_TYPEID
|
||||
&& tc->compilerCommand() == candidate.compilerPath
|
||||
|
@@ -865,7 +865,7 @@ void BazaarPluginPrivate::updateActions(VcsBasePluginPrivate::ActionState as)
|
||||
m_revertFile->setParameter(filename);
|
||||
m_statusFile->setParameter(filename);
|
||||
|
||||
for (QAction *repoAction : qAsConst(m_repositoryActionList))
|
||||
for (QAction *repoAction : std::as_const(m_repositoryActionList))
|
||||
repoAction->setEnabled(repoEnabled);
|
||||
}
|
||||
|
||||
|
@@ -379,7 +379,7 @@ void AbstractSettings::readDocumentation()
|
||||
if (xml.readNext() == QXmlStreamReader::Characters) {
|
||||
m_docu << xml.text().toString();
|
||||
const int index = m_docu.size() - 1;
|
||||
for (const QString &key : qAsConst(keys))
|
||||
for (const QString &key : std::as_const(keys))
|
||||
m_options.insert(key, index);
|
||||
}
|
||||
}
|
||||
|
@@ -158,7 +158,7 @@ void ArtisticStyleSettings::createDocumentationFile() const
|
||||
// Write entry
|
||||
stream.writeStartElement(Constants::DOCUMENTATION_XMLENTRY);
|
||||
stream.writeStartElement(Constants::DOCUMENTATION_XMLKEYS);
|
||||
for (const QString &key : qAsConst(keys))
|
||||
for (const QString &key : std::as_const(keys))
|
||||
stream.writeTextElement(Constants::DOCUMENTATION_XMLKEY, key);
|
||||
stream.writeEndElement();
|
||||
const QString text = "<p><span class=\"option\">"
|
||||
|
@@ -890,7 +890,7 @@ void BinEditorWidget::paintEvent(QPaintEvent *e)
|
||||
int item_x = -xoffset + m_margin + c * m_columnWidth + m_labelWidth;
|
||||
|
||||
QColor color;
|
||||
for (const Markup &m : qAsConst(m_markup)) {
|
||||
for (const Markup &m : std::as_const(m_markup)) {
|
||||
if (m.covers(lineAddress + c)) {
|
||||
color = m.color;
|
||||
break;
|
||||
@@ -1221,7 +1221,7 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const
|
||||
str << "<html><head/><body><p align=\"center\"><b>"
|
||||
<< Tr::tr("Memory at 0x%1").arg(address, 0, 16) << "</b></p>";
|
||||
|
||||
for (const Markup &m : qAsConst(m_markup)) {
|
||||
for (const Markup &m : std::as_const(m_markup)) {
|
||||
if (m.covers(address) && !m.toolTip.isEmpty()) {
|
||||
str << "<p>" << m.toolTip << "</p><br>";
|
||||
break;
|
||||
|
@@ -319,7 +319,7 @@ private:
|
||||
}
|
||||
|
||||
const bool wasDone = m_done;
|
||||
for (const ClangdAstNode &child : qAsConst(childrenToCheck)) {
|
||||
for (const ClangdAstNode &child : std::as_const(childrenToCheck)) {
|
||||
visitNode(child);
|
||||
if (m_done && !wasDone)
|
||||
break;
|
||||
|
@@ -478,7 +478,7 @@ QList<AssistProposalItemInterface *> CustomAssistProcessor::completeInclude(
|
||||
const QStringList suffixes = mimeType.suffixes();
|
||||
|
||||
QList<AssistProposalItemInterface *> completions;
|
||||
for (const HeaderPath &headerPath : qAsConst(allHeaderPaths)) {
|
||||
for (const HeaderPath &headerPath : std::as_const(allHeaderPaths)) {
|
||||
QString realPath = headerPath.path;
|
||||
if (!directoryPrefix.isEmpty()) {
|
||||
realPath += QLatin1Char('/');
|
||||
@@ -490,7 +490,7 @@ QList<AssistProposalItemInterface *> CustomAssistProcessor::completeInclude(
|
||||
}
|
||||
|
||||
QList<QPair<AssistProposalItemInterface *, QString>> completionsForSorting;
|
||||
for (AssistProposalItemInterface * const item : qAsConst(completions)) {
|
||||
for (AssistProposalItemInterface * const item : std::as_const(completions)) {
|
||||
QString s = item->text();
|
||||
s.replace('/', QChar(0)); // The dir separator should compare less than anything else.
|
||||
completionsForSorting.push_back({item, s});
|
||||
|
@@ -129,7 +129,7 @@ void ClangdFindReferences::Private::handleFindUsagesResult(const QList<Location>
|
||||
QObject::connect(search, &SearchResult::canceled, q, [this] {
|
||||
canceled = true;
|
||||
search->disconnect(q);
|
||||
for (const MessageId &id : qAsConst(pendingAstRequests))
|
||||
for (const MessageId &id : std::as_const(pendingAstRequests))
|
||||
client()->cancelRequest(id);
|
||||
pendingAstRequests.clear();
|
||||
finishSearch();
|
||||
|
@@ -173,11 +173,11 @@ ClangdFollowSymbol::~ClangdFollowSymbol()
|
||||
d->closeTempDocuments();
|
||||
if (d->virtualFuncAssistProcessor)
|
||||
d->virtualFuncAssistProcessor->resetData(false);
|
||||
for (const MessageId &id : qAsConst(d->pendingSymbolInfoRequests))
|
||||
for (const MessageId &id : std::as_const(d->pendingSymbolInfoRequests))
|
||||
d->client->cancelRequest(id);
|
||||
for (const MessageId &id : qAsConst(d->pendingGotoImplRequests))
|
||||
for (const MessageId &id : std::as_const(d->pendingGotoImplRequests))
|
||||
d->client->cancelRequest(id);
|
||||
for (const MessageId &id : qAsConst(d->pendingGotoDefRequests))
|
||||
for (const MessageId &id : std::as_const(d->pendingGotoDefRequests))
|
||||
d->client->cancelRequest(id);
|
||||
delete d;
|
||||
}
|
||||
@@ -307,7 +307,7 @@ ClangdFollowSymbol::VirtualFunctionAssistProcessor::createProposal(bool final) c
|
||||
QList<AssistProposalItemInterface *> items;
|
||||
bool needsBaseDeclEntry = !m_followSymbol->d->defLinkNode.range()
|
||||
.contains(Position(m_followSymbol->d->cursor));
|
||||
for (const SymbolData &symbol : qAsConst(m_followSymbol->d->symbolsToDisplay)) {
|
||||
for (const SymbolData &symbol : std::as_const(m_followSymbol->d->symbolsToDisplay)) {
|
||||
Link link = symbol.second;
|
||||
if (m_followSymbol->d->defLink == link) {
|
||||
if (!needsBaseDeclEntry)
|
||||
@@ -411,7 +411,7 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult(
|
||||
newLinks = {ploc->toLink()};
|
||||
if (const auto plloc = std::get_if<QList<Location>>(&*result))
|
||||
newLinks = transform(*plloc, &Location::toLink);
|
||||
for (const Link &link : qAsConst(newLinks)) {
|
||||
for (const Link &link : std::as_const(newLinks)) {
|
||||
if (!allLinks.contains(link)) {
|
||||
allLinks << link;
|
||||
|
||||
@@ -444,7 +444,7 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult(
|
||||
// pure virtual and mark it accordingly.
|
||||
// In addition, we need to follow all override links, because for these, clangd
|
||||
// gives us the declaration instead of the definition.
|
||||
for (const Link &link : qAsConst(allLinks)) {
|
||||
for (const Link &link : std::as_const(allLinks)) {
|
||||
if (!client->documentForFilePath(link.targetFilePath) && addOpenFile(link.targetFilePath))
|
||||
client->openExtraFile(link.targetFilePath);
|
||||
const auto symbolInfoHandler = [sentinel = QPointer(q), this, link](
|
||||
@@ -525,7 +525,7 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult(
|
||||
|
||||
void ClangdFollowSymbol::Private::closeTempDocuments()
|
||||
{
|
||||
for (const FilePath &fp : qAsConst(openedFiles)) {
|
||||
for (const FilePath &fp : std::as_const(openedFiles)) {
|
||||
if (!client->documentForFilePath(fp))
|
||||
client->closeExtraFile(fp);
|
||||
}
|
||||
|
@@ -154,7 +154,7 @@ QList<Core::LocatorFilterEntry> ClangGlobalSymbolFilter::matchesFor(
|
||||
const QList<Core::LocatorFilterEntry> lspMatches = m_lspFilter->matchesFor(future, entry);
|
||||
if (!lspMatches.isEmpty()) {
|
||||
std::set<std::tuple<Utils::FilePath, int, int>> locations;
|
||||
for (const auto &entry : qAsConst(matches)) {
|
||||
for (const auto &entry : std::as_const(matches)) {
|
||||
const CppEditor::IndexItem::Ptr item
|
||||
= qvariant_cast<CppEditor::IndexItem::Ptr>(entry.internalData);
|
||||
locations.insert(std::make_tuple(Utils::FilePath::fromString(item->fileName()),
|
||||
|
@@ -102,7 +102,7 @@ static QList<BlockRange> cleanupDisabledCode(HighlightingResults &results, const
|
||||
|
||||
qCDebug(clangdLogHighlight) << "found" << ifdefedOutRanges.size() << "ifdefed-out ranges";
|
||||
if (clangdLogHighlight().isDebugEnabled()) {
|
||||
for (const BlockRange &r : qAsConst(ifdefedOutRanges))
|
||||
for (const BlockRange &r : std::as_const(ifdefedOutRanges))
|
||||
qCDebug(clangdLogHighlight) << r.first() << r.last();
|
||||
}
|
||||
|
||||
|
@@ -166,7 +166,7 @@ GenerateCompilationDbResult generateCompilationDB(QList<ProjectInfo::ConstPtr> p
|
||||
|
||||
const UsePrecompiledHeaders usePch = getPchUsage();
|
||||
const QJsonArray jsonProjectOptions = QJsonArray::fromStringList(projectOptions);
|
||||
for (const ProjectInfo::ConstPtr &projectInfo : qAsConst(projectInfoList)) {
|
||||
for (const ProjectInfo::ConstPtr &projectInfo : std::as_const(projectInfoList)) {
|
||||
for (ProjectPart::ConstPtr projectPart : projectInfo->projectParts()) {
|
||||
QTC_ASSERT(projectInfo, continue);
|
||||
QStringList args;
|
||||
|
@@ -144,7 +144,7 @@ void ClangdTest::initTestCase()
|
||||
QVERIFY(m_client);
|
||||
|
||||
// Open cpp documents.
|
||||
for (const QString &sourceFileName : qAsConst(m_sourceFileNames)) {
|
||||
for (const QString &sourceFileName : std::as_const(m_sourceFileNames)) {
|
||||
const auto sourceFilePath = Utils::FilePath::fromString(
|
||||
m_projectDir->absolutePath(sourceFileName.toLocal8Bit()));
|
||||
QVERIFY2(sourceFilePath.exists(), qPrintable(sourceFilePath.toUserOutput()));
|
||||
@@ -1854,7 +1854,7 @@ void ClangdTestCompletion::testSignalCompletion()
|
||||
|
||||
QVERIFY(proposal);
|
||||
QCOMPARE(proposal->size(), expectedSuggestions.size());
|
||||
for (const QString &expectedSuggestion : qAsConst(expectedSuggestions))
|
||||
for (const QString &expectedSuggestion : std::as_const(expectedSuggestions))
|
||||
QVERIFY2(hasItem(proposal, ' ' + expectedSuggestion), qPrintable(expectedSuggestion));
|
||||
}
|
||||
|
||||
|
@@ -250,7 +250,7 @@ public:
|
||||
QVector<DiagnosticItem *> itemsSchedulable;
|
||||
|
||||
// Construct refactoring operations
|
||||
for (DiagnosticItem *diagnosticItem : qAsConst(fileInfo.diagnosticItems)) {
|
||||
for (DiagnosticItem *diagnosticItem : std::as_const(fileInfo.diagnosticItems)) {
|
||||
const FixitStatus fixItStatus = diagnosticItem->fixItStatus();
|
||||
|
||||
const bool isScheduled = fixItStatus == FixitStatus::Scheduled;
|
||||
@@ -269,7 +269,7 @@ public:
|
||||
|
||||
// Collect replacements
|
||||
ReplacementOperations ops;
|
||||
for (DiagnosticItem *item : qAsConst(itemsScheduledOrSchedulable))
|
||||
for (DiagnosticItem *item : std::as_const(itemsScheduledOrSchedulable))
|
||||
ops += item->fixitOperations();
|
||||
|
||||
if (ops.empty())
|
||||
@@ -291,11 +291,11 @@ public:
|
||||
model->addWatchedPath(ops.first()->fileName);
|
||||
|
||||
// Update DiagnosticItem state
|
||||
for (DiagnosticItem *diagnosticItem : qAsConst(itemsScheduled))
|
||||
for (DiagnosticItem *diagnosticItem : std::as_const(itemsScheduled))
|
||||
diagnosticItem->setFixItStatus(FixitStatus::Applied);
|
||||
for (DiagnosticItem *diagnosticItem : qAsConst(itemsFailedToApply))
|
||||
for (DiagnosticItem *diagnosticItem : std::as_const(itemsFailedToApply))
|
||||
diagnosticItem->setFixItStatus(FixitStatus::FailedToApply);
|
||||
for (DiagnosticItem *diagnosticItem : qAsConst(itemsInvalidated))
|
||||
for (DiagnosticItem *diagnosticItem : std::as_const(itemsInvalidated))
|
||||
diagnosticItem->setFixItStatus(FixitStatus::Invalidated);
|
||||
}
|
||||
}
|
||||
@@ -313,7 +313,7 @@ static FileInfos sortedFileInfos(const QVector<CppEditor::ProjectPart::ConstPtr>
|
||||
if (!projectPart->selectedForBuilding)
|
||||
continue;
|
||||
|
||||
for (const CppEditor::ProjectFile &file : qAsConst(projectPart->files)) {
|
||||
for (const CppEditor::ProjectFile &file : std::as_const(projectPart->files)) {
|
||||
QTC_ASSERT(file.kind != CppEditor::ProjectFile::Unclassified, continue);
|
||||
QTC_ASSERT(file.kind != CppEditor::ProjectFile::Unsupported, continue);
|
||||
if (file.path == CppEditor::CppModelManager::configurationFileName())
|
||||
|
@@ -281,7 +281,7 @@ void ClangToolRunWorker::start()
|
||||
|
||||
void ClangToolRunWorker::stop()
|
||||
{
|
||||
for (ClangToolRunner *runner : qAsConst(m_runners)) {
|
||||
for (ClangToolRunner *runner : std::as_const(m_runners)) {
|
||||
QObject::disconnect(runner, nullptr, this, nullptr);
|
||||
delete runner;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user