forked from qt-creator/qt-creator
Utils: Purge asConst
Replace by qAsConst. Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
11336fb604
commit
7d3a79c696
@@ -49,8 +49,6 @@
|
||||
#include "qmt/tasks/diagramscenecontroller.h"
|
||||
#include "qmt/tasks/ielementtasks.h"
|
||||
|
||||
#include "utils/asconst.h"
|
||||
|
||||
#include <QSet>
|
||||
#include <QGraphicsItem>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
@@ -250,7 +248,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 : Utils::asConst(items)) {
|
||||
for (QGraphicsItem *item : qAsConst(items)) {
|
||||
if (m_graphicsItems.contains(item)) {
|
||||
DObject *object = dynamic_cast<DObject *>(m_itemToElementMap.value(item));
|
||||
if (object)
|
||||
@@ -852,11 +850,11 @@ void DiagramSceneModel::onSelectionChanged()
|
||||
}
|
||||
|
||||
// select more items secondarily
|
||||
for (QGraphicsItem *selectedItem : Utils::asConst(m_selectedItems)) {
|
||||
for (QGraphicsItem *selectedItem : qAsConst(m_selectedItems)) {
|
||||
if (auto selectable = dynamic_cast<ISelectable *>(selectedItem)) {
|
||||
QRectF boundary = selectable->getSecondarySelectionBoundary();
|
||||
if (!boundary.isEmpty()) {
|
||||
for (QGraphicsItem *item : Utils::asConst(m_graphicsItems)) {
|
||||
for (QGraphicsItem *item : qAsConst(m_graphicsItems)) {
|
||||
if (auto secondarySelectable = dynamic_cast<ISelectable *>(item)) {
|
||||
if (!item->isSelected() && !secondarySelectable->isSecondarySelected()) {
|
||||
secondarySelectable->setBoundarySelected(boundary, true);
|
||||
@@ -996,7 +994,7 @@ void DiagramSceneModel::restoreSelectedStatusAfterExport(const DiagramSceneModel
|
||||
void DiagramSceneModel::recalcSceneRectSize()
|
||||
{
|
||||
QRectF sceneRect = m_originItem->mapRectToScene(m_originItem->boundingRect());
|
||||
for (QGraphicsItem *item : Utils::asConst(m_graphicsItems)) {
|
||||
for (QGraphicsItem *item : qAsConst(m_graphicsItems)) {
|
||||
// TODO use an interface to update sceneRect by item
|
||||
if (!dynamic_cast<SwimlaneItem *>(item))
|
||||
sceneRect |= item->mapRectToScene(item->boundingRect());
|
||||
|
@@ -60,7 +60,6 @@
|
||||
#include "qmt/tasks/alignonrastervisitor.h"
|
||||
#include "qmt/tasks/isceneinspector.h"
|
||||
#include "qmt/tasks/voidelementtasks.h"
|
||||
#include "utils/asconst.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QFileInfo>
|
||||
|
@@ -1,41 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
template <class T>
|
||||
constexpr std::add_const_t<T> &asConst(T &t) noexcept
|
||||
{
|
||||
return t;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void asConst(const T &&) = delete;
|
||||
|
||||
} // Utils
|
@@ -26,7 +26,6 @@
|
||||
#include "settingsaccessor.h"
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "asconst.h"
|
||||
#include "qtcassert.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
@@ -244,7 +244,6 @@ HEADERS += \
|
||||
$$PWD/sizedarray.h \
|
||||
$$PWD/smallstringio.h \
|
||||
$$PWD/guard.h \
|
||||
$$PWD/asconst.h \
|
||||
$$PWD/smallstringfwd.h \
|
||||
$$PWD/optional.h \
|
||||
$$PWD/../3rdparty/optional/optional.hpp \
|
||||
|
@@ -38,7 +38,6 @@ Project {
|
||||
|
||||
files: [
|
||||
"QtConcurrentTools",
|
||||
"asconst.h",
|
||||
"algorithm.h",
|
||||
"annotateditemdelegate.cpp",
|
||||
"annotateditemdelegate.h",
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
namespace Autotest {
|
||||
@@ -179,7 +178,7 @@ QList<TestConfiguration *> GTestTreeItem::getTestConfigurations(bool ignoreCheck
|
||||
}
|
||||
|
||||
for (auto it = testCasesForProFile.begin(), end = testCasesForProFile.end(); it != end; ++it) {
|
||||
for (const QString &target : Utils::asConst(it.value().internalTargets)) {
|
||||
for (const QString &target : qAsConst(it.value().internalTargets)) {
|
||||
GTestConfiguration *tc = new GTestConfiguration;
|
||||
if (!ignoreCheckState)
|
||||
tc->setTestCases(it.value().filters);
|
||||
|
@@ -27,7 +27,6 @@
|
||||
#include "gdbserverprovidermanager.h"
|
||||
#include "baremetaldevice.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
@@ -191,7 +190,7 @@ void GdbServerProvider::unregisterDevice(BareMetalDevice *device)
|
||||
void GdbServerProvider::providerUpdated()
|
||||
{
|
||||
GdbServerProviderManager::notifyAboutUpdate(this);
|
||||
for (BareMetalDevice *device : Utils::asConst(m_devices))
|
||||
for (BareMetalDevice *device : qAsConst(m_devices))
|
||||
device->providerUpdated(this);
|
||||
}
|
||||
|
||||
|
@@ -35,7 +35,6 @@
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/persistentsettings.h>
|
||||
|
||||
@@ -180,7 +179,7 @@ bool GdbServerProviderManager::registerProvider(GdbServerProvider *provider)
|
||||
{
|
||||
if (!provider || m_instance->m_providers.contains(provider))
|
||||
return true;
|
||||
for (const GdbServerProvider *current : Utils::asConst(m_instance->m_providers)) {
|
||||
for (const GdbServerProvider *current : qAsConst(m_instance->m_providers)) {
|
||||
if (*provider == *current)
|
||||
return false;
|
||||
QTC_ASSERT(current->id() != provider->id(), return false);
|
||||
|
@@ -38,7 +38,6 @@
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/categorysortfiltermodel.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
|
@@ -50,7 +50,6 @@
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/stringutils.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
|
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "configmodel.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/theme/theme.h>
|
||||
@@ -344,7 +343,7 @@ void ConfigModel::generateTree()
|
||||
|
||||
Utils::TreeItem *root = new Utils::TreeItem;
|
||||
|
||||
for (const QString &p : Utils::asConst(prefixList)) {
|
||||
for (const QString &p : qAsConst(prefixList)) {
|
||||
const QList<Utils::TreeItem *> &prefixItemList = prefixes.value(p);
|
||||
QTC_ASSERT(!prefixItemList.isEmpty(), continue);
|
||||
|
||||
|
@@ -19,7 +19,6 @@
|
||||
#include "configmodelitemdelegate.h"
|
||||
#include "configmodel.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
#include <QComboBox>
|
||||
@@ -56,7 +55,7 @@ QWidget *ConfigModelItemDelegate::createEditor(QWidget *parent, const QStyleOpti
|
||||
} else if (!data.values.isEmpty()) {
|
||||
auto edit = new QComboBox(parent);
|
||||
edit->setFocusPolicy(Qt::StrongFocus);
|
||||
for (const QString &s : Utils::asConst(data.values))
|
||||
for (const QString &s : qAsConst(data.values))
|
||||
edit->addItem(s);
|
||||
return edit;
|
||||
} else if (data.type == ConfigModel::DataItem::BOOLEAN) {
|
||||
|
@@ -41,7 +41,6 @@
|
||||
#include <projectexplorer/taskhub.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
@@ -352,7 +351,7 @@ void ServerModeReader::generateProjectTree(CMakeProjectNode *root,
|
||||
void ServerModeReader::updateCodeModel(CppTools::RawProjectParts &rpps)
|
||||
{
|
||||
int counter = 0;
|
||||
for (const FileGroup *fg : Utils::asConst(m_fileGroups)) {
|
||||
for (const FileGroup *fg : qAsConst(m_fileGroups)) {
|
||||
++counter;
|
||||
const QStringList flags = QtcProcess::splitArgs(fg->compileFlags);
|
||||
const QStringList includes = transform(fg->includePaths, [](const IncludePath *ip) { return ip->path.toString(); });
|
||||
@@ -679,7 +678,7 @@ void ServerModeReader::fixTarget(ServerModeReader::Target *target) const
|
||||
{
|
||||
QHash<QString, const FileGroup *> languageFallbacks;
|
||||
|
||||
for (const FileGroup *group : Utils::asConst(target->fileGroups)) {
|
||||
for (const FileGroup *group : qAsConst(target->fileGroups)) {
|
||||
if (group->includePaths.isEmpty() && group->compileFlags.isEmpty()
|
||||
&& group->macros.isEmpty())
|
||||
continue;
|
||||
@@ -803,7 +802,7 @@ void ServerModeReader::addTargets(const QHash<Utils::FileName, ProjectExplorer::
|
||||
// Set up a default target path:
|
||||
FileName targetPath = t->sourceDirectory;
|
||||
targetPath.appendPath("CMakeLists.txt");
|
||||
for (CrossReference *cr : Utils::asConst(t->crossReferences)) {
|
||||
for (CrossReference *cr : qAsConst(t->crossReferences)) {
|
||||
BacktraceItem *bt = cr->backtrace.isEmpty() ? nullptr : cr->backtrace.at(0);
|
||||
if (bt) {
|
||||
const QString btName = bt->name.toLower();
|
||||
|
@@ -28,7 +28,6 @@
|
||||
#include "coreconstants.h"
|
||||
#include "fancyactionbar.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/styledbar.h>
|
||||
#include <utils/stylehelper.h>
|
||||
@@ -93,7 +92,7 @@ QSize FancyTabBar::tabSizeHint(bool minimum) const
|
||||
const int spacing = 8;
|
||||
const int width = 60 + spacing + 2;
|
||||
int maxLabelwidth = 0;
|
||||
for (auto tab : asConst(m_tabs)) {
|
||||
for (auto tab : qAsConst(m_tabs)) {
|
||||
const int width = fm.width(tab->text);
|
||||
if (width > maxLabelwidth)
|
||||
maxLabelwidth = width;
|
||||
@@ -173,7 +172,7 @@ void FancyTabBar::leaveEvent(QEvent *event)
|
||||
Q_UNUSED(event)
|
||||
m_hoverIndex = -1;
|
||||
m_hoverRect = QRect();
|
||||
for (auto tab : asConst(m_tabs))
|
||||
for (auto tab : qAsConst(m_tabs))
|
||||
tab->fadeOut();
|
||||
}
|
||||
|
||||
|
@@ -25,8 +25,6 @@
|
||||
|
||||
#include "highlightscrollbarcontroller.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
|
||||
#include <QAbstractScrollArea>
|
||||
#include <QPainter>
|
||||
#include <QResizeEvent>
|
||||
@@ -114,7 +112,7 @@ void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent)
|
||||
int previousBottom = -1;
|
||||
|
||||
QHash<Utils::Theme::Color, QVector<QRect> > highlights;
|
||||
for (const Highlight ¤tHighlight : Utils::asConst(m_cache)) {
|
||||
for (const Highlight ¤tHighlight : qAsConst(m_cache)) {
|
||||
// Calculate top and bottom
|
||||
int top = rect.top() + offset + verticalMargin
|
||||
+ float(currentHighlight.position) / range * rect.height();
|
||||
|
@@ -27,7 +27,6 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/macroexpander.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
@@ -62,7 +61,7 @@ QList<LocatorFilterEntry> ExecuteFilter::matchesFor(QFutureInterface<LocatorFilt
|
||||
value.append(LocatorFilterEntry(this, entry, QVariant()));
|
||||
QList<LocatorFilterEntry> others;
|
||||
const Qt::CaseSensitivity entryCaseSensitivity = caseSensitivity(entry);
|
||||
for (const QString &cmd : Utils::asConst(m_commandHistory)) {
|
||||
for (const QString &cmd : qAsConst(m_commandHistory)) {
|
||||
if (future.isCanceled())
|
||||
break;
|
||||
if (cmd == entry) // avoid repeated entry
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QDir>
|
||||
@@ -104,7 +103,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF
|
||||
QDir::Name|QDir::IgnoreCase|QDir::LocaleAware);
|
||||
dirs.prepend("..");
|
||||
|
||||
for (const QString &dir : Utils::asConst(dirs)) {
|
||||
for (const QString &dir : qAsConst(dirs)) {
|
||||
if (future.isCanceled())
|
||||
break;
|
||||
int index = -1;
|
||||
|
@@ -51,7 +51,6 @@
|
||||
#include <coreplugin/progressmanager/futureprogress.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/mapreduce.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/utilsicons.h>
|
||||
@@ -160,7 +159,7 @@ void Locator::loadSettings()
|
||||
settings->beginGroup("QuickOpen");
|
||||
m_refreshTimer.setInterval(settings->value("RefreshInterval", 60).toInt() * 60000);
|
||||
|
||||
for (ILocatorFilter *filter : Utils::asConst(m_filters)) {
|
||||
for (ILocatorFilter *filter : qAsConst(m_filters)) {
|
||||
if (settings->contains(filter->id().toString())) {
|
||||
const QByteArray state = settings->value(filter->id().toString()).toByteArray();
|
||||
if (!state.isEmpty())
|
||||
@@ -192,7 +191,7 @@ void Locator::updateFilterActions()
|
||||
QMap<Id, QAction *> actionCopy = m_filterActionMap;
|
||||
m_filterActionMap.clear();
|
||||
// register new actions, update existent
|
||||
for (ILocatorFilter *filter : Utils::asConst(m_filters)) {
|
||||
for (ILocatorFilter *filter : qAsConst(m_filters)) {
|
||||
if (filter->shortcutString().isEmpty() || filter->isHidden())
|
||||
continue;
|
||||
Id filterId = filter->id();
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#include "locatorfiltertest.h"
|
||||
|
||||
#include <coreplugin/testdatadir.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QDir>
|
||||
@@ -77,7 +76,7 @@ void Core::Internal::CorePlugin::test_basefilefilter()
|
||||
MyBaseFileFilter filter(testFiles);
|
||||
BasicLocatorFilterTest test(&filter);
|
||||
|
||||
for (const ReferenceData &reference : Utils::asConst(referenceDataList)) {
|
||||
for (const ReferenceData &reference : qAsConst(referenceDataList)) {
|
||||
const QList<LocatorFilterEntry> filterEntries = test.matchesFor(reference.searchText);
|
||||
const ResultDataList results = ResultData::fromFilterEntryList(filterEntries);
|
||||
// QTextStream(stdout) << "----" << endl;
|
||||
|
@@ -28,7 +28,6 @@
|
||||
#include "locator.h"
|
||||
#include "locatorwidget.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
@@ -62,7 +61,7 @@ void LocatorFiltersFilter::prepareSearch(const QString &entry)
|
||||
uniqueFilters.insert(filterId, filter);
|
||||
}
|
||||
|
||||
for (ILocatorFilter *filter : Utils::asConst(uniqueFilters)) {
|
||||
for (ILocatorFilter *filter : qAsConst(uniqueFilters)) {
|
||||
if (!filter->shortcutString().isEmpty() && !filter->isHidden() && filter->isEnabled()) {
|
||||
m_filterShortcutStrings.append(filter->shortcutString());
|
||||
m_filterDisplayNames.append(filter->displayName());
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include "locatorconstants.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/categorysortfiltermodel.h>
|
||||
#include <utils/headerviewstretcher.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -270,7 +269,7 @@ void LocatorSettingsPage::setFilter(const QString &text)
|
||||
void LocatorSettingsPage::saveFilterStates()
|
||||
{
|
||||
m_filterStates.clear();
|
||||
for (ILocatorFilter *filter : Utils::asConst(m_filters))
|
||||
for (ILocatorFilter *filter : qAsConst(m_filters))
|
||||
m_filterStates.insert(filter, filter->saveState());
|
||||
}
|
||||
|
||||
@@ -292,11 +291,11 @@ void LocatorSettingsPage::initializeModel()
|
||||
m_model->clear();
|
||||
QSet<ILocatorFilter *> customFilterSet = m_customFilters.toSet();
|
||||
auto builtIn = new CategoryItem(tr("Built-in"), 0/*order*/);
|
||||
for (ILocatorFilter *filter : Utils::asConst(m_filters))
|
||||
for (ILocatorFilter *filter : qAsConst(m_filters))
|
||||
if (!filter->isHidden() && !customFilterSet.contains(filter))
|
||||
builtIn->appendChild(new FilterItem(filter));
|
||||
m_customFilterRoot = new CategoryItem(tr("Custom"), 1/*order*/);
|
||||
for (ILocatorFilter *customFilter : Utils::asConst(m_customFilters))
|
||||
for (ILocatorFilter *customFilter : qAsConst(m_customFilters))
|
||||
m_customFilterRoot->appendChild(new FilterItem(customFilter));
|
||||
|
||||
m_model->rootItem()->appendChild(builtIn);
|
||||
|
@@ -38,7 +38,6 @@
|
||||
#include <coreplugin/mainwindow.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/appmainwindow.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/highlightingitemdelegate.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
|
@@ -30,7 +30,6 @@
|
||||
#include "coreconstants.h"
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include <projectexplorer/projectexplorericons.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/fileutils.h>
|
||||
@@ -689,7 +688,7 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
|
||||
cdbs.append(FileName::fromString(cdb64.absoluteFilePath()));
|
||||
}
|
||||
|
||||
for (const FileName &cdb : Utils::asConst(cdbs)) {
|
||||
for (const FileName &cdb : qAsConst(cdbs)) {
|
||||
if (DebuggerItemManager::findByCommand(cdb))
|
||||
continue;
|
||||
DebuggerItem item;
|
||||
|
@@ -46,7 +46,6 @@
|
||||
#include <coreplugin/designmode.h>
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <projectexplorer/jsonwizard/jsonwizardfactory.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
|
||||
#include <QAction>
|
||||
@@ -177,7 +176,7 @@ static QString otherFile()
|
||||
// Try to find existing file with desired suffix
|
||||
const QFileInfo currentFI(current);
|
||||
const QString currentBaseName = currentFI.path() + '/' + currentFI.baseName() + '.';
|
||||
for (const QString &candidateSuffix : Utils::asConst(candidateSuffixes)) {
|
||||
for (const QString &candidateSuffix : qAsConst(candidateSuffixes)) {
|
||||
const QFileInfo fi(currentBaseName + candidateSuffix);
|
||||
if (fi.isFile())
|
||||
return fi.absoluteFilePath();
|
||||
|
@@ -34,7 +34,6 @@
|
||||
#include <coreplugin/modemanager.h>
|
||||
#include <coreplugin/imode.h>
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QDesignerFormWindowInterface>
|
||||
@@ -153,7 +152,7 @@ void FormEditorStack::updateFormWindowSelectionHandles()
|
||||
if (Designer::Constants::Internal::debug)
|
||||
qDebug() << "updateFormWindowSelectionHandles";
|
||||
QDesignerFormWindowInterface *activeFormWindow = m_designerCore->formWindowManager()->activeFormWindow();
|
||||
for (const EditorData &fdm : Utils::asConst(m_formEditors)) {
|
||||
for (const EditorData &fdm : qAsConst(m_formEditors)) {
|
||||
const bool active = activeFormWindow == fdm.widgetHost->formWindow();
|
||||
fdm.widgetHost->updateFormWindowSelectionHandles(active);
|
||||
}
|
||||
@@ -184,7 +183,7 @@ void FormEditorStack::modeAboutToChange(Core::Id mode)
|
||||
|
||||
// Sync the editor when entering edit mode
|
||||
if (mode == Core::Constants::MODE_EDIT)
|
||||
for (const EditorData &data : Utils::asConst(m_formEditors))
|
||||
for (const EditorData &data : qAsConst(m_formEditors))
|
||||
data.formWindowEditor->formWindowFile()->syncXmlFromFormWindow();
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,6 @@
|
||||
|
||||
#include <cplusplus/CppDocument.h>
|
||||
#include <cplusplus/Overview.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QDesignerFormEditorInterface>
|
||||
@@ -177,7 +176,7 @@ public:
|
||||
QVERIFY(EditorManager::currentDocument()->isModified());
|
||||
|
||||
// Wait for updated documents
|
||||
for (TextEditor::BaseTextEditor *editor : Utils::asConst(editors)) {
|
||||
for (TextEditor::BaseTextEditor *editor : qAsConst(editors)) {
|
||||
const QString filePath = editor->document()->filePath().toString();
|
||||
if (auto parser = BuiltinEditorDocumentParser::get(filePath)) {
|
||||
forever {
|
||||
|
@@ -44,7 +44,6 @@
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projecttree.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -561,7 +560,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
|
||||
const Class *cl = 0;
|
||||
Document::Ptr doc;
|
||||
|
||||
for (const Document::Ptr &d : Utils::asConst(docMap)) {
|
||||
for (const Document::Ptr &d : qAsConst(docMap)) {
|
||||
LookupContext context(d, docTable);
|
||||
const ClassDocumentPtrPair cd = findClassRecursively(context, uiClass, 1u , &namespaceName);
|
||||
if (cd.first) {
|
||||
|
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <QDesignerFormWindowInterface>
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
@@ -109,7 +108,7 @@ void ResourceHandler::updateResourcesHelper(bool updateProjectResources)
|
||||
// Check if the user has chosen to update the lacking resource inside designer
|
||||
if (dirty && updateProjectResources) {
|
||||
QStringList qrcPathsToBeAdded;
|
||||
for (const QString &originalQrcPath : Utils::asConst(m_originalUiQrcPaths)) {
|
||||
for (const QString &originalQrcPath : qAsConst(m_originalUiQrcPaths)) {
|
||||
if (!projectQrcFiles.contains(originalQrcPath) && !qrcPathsToBeAdded.contains(originalQrcPath))
|
||||
qrcPathsToBeAdded.append(originalQrcPath);
|
||||
}
|
||||
|
@@ -28,7 +28,6 @@
|
||||
|
||||
#include <coreplugin/icontext.h>
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
#include <QDesignerOptionsPageInterface>
|
||||
@@ -121,7 +120,7 @@ bool SettingsPageProvider::matches(const QString &searchKeyWord) const
|
||||
for (size_t i = 0; i < itemCount; ++i)
|
||||
m_keywords << Utils::stripAccelerator(QCoreApplication::translate(uitext[i].context, uitext[i].value));
|
||||
}
|
||||
for (const QString &key : Utils::asConst(m_keywords)) {
|
||||
for (const QString &key : qAsConst(m_keywords)) {
|
||||
if (key.contains(searchKeyWord, Qt::CaseInsensitive))
|
||||
return true;
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@
|
||||
#include "differ.h"
|
||||
|
||||
#include "texteditor/fontsettings.h"
|
||||
#include "utils/asconst.h"
|
||||
|
||||
#include <QFutureInterfaceBase>
|
||||
#include <QRegularExpression>
|
||||
@@ -1286,7 +1285,7 @@ static QList<FileData> readGitPatch(QStringRef patch, bool *ok,
|
||||
QList<FileData> fileDataList;
|
||||
readOk = false;
|
||||
int i = 0;
|
||||
for (const auto &patchInfo : Utils::asConst(patches)) {
|
||||
for (const auto &patchInfo : qAsConst(patches)) {
|
||||
if (jobController) {
|
||||
if (jobController->isCanceled())
|
||||
return QList<FileData>();
|
||||
|
@@ -37,7 +37,6 @@
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <coreplugin/documentmanager.h>
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/execmenu.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
|
@@ -30,7 +30,6 @@
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcscommand.h>
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QDateTime>
|
||||
@@ -138,7 +137,7 @@ public:
|
||||
fn.append(nodes.first()->sha);
|
||||
nodes.removeFirst();
|
||||
|
||||
for (const BranchNode *n : Utils::asConst(nodes))
|
||||
for (const BranchNode *n : qAsConst(nodes))
|
||||
fn.append(n->name);
|
||||
|
||||
return fn;
|
||||
@@ -328,7 +327,7 @@ Qt::ItemFlags BranchModel::flags(const QModelIndex &index) const
|
||||
|
||||
void BranchModel::clear()
|
||||
{
|
||||
for (BranchNode *root : Utils::asConst(m_rootNode->children)) {
|
||||
for (BranchNode *root : qAsConst(m_rootNode->children)) {
|
||||
while (root->count())
|
||||
delete root->children.takeLast();
|
||||
}
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include "gitutils.h"
|
||||
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
@@ -127,7 +126,7 @@ bool BranchUtils::checkout()
|
||||
|
||||
QList<Stash> stashes;
|
||||
client->synchronousStashList(m_repository, &stashes);
|
||||
for (const Stash &stash : Utils::asConst(stashes)) {
|
||||
for (const Stash &stash : qAsConst(stashes)) {
|
||||
if (stash.message.startsWith(popMessageStart)) {
|
||||
branchCheckoutDialog.foundStashForNextBranch();
|
||||
break;
|
||||
@@ -155,7 +154,7 @@ bool BranchUtils::checkout()
|
||||
|
||||
QString stashName;
|
||||
client->synchronousStashList(m_repository, &stashes);
|
||||
for (const Stash &stash : Utils::asConst(stashes)) {
|
||||
for (const Stash &stash : qAsConst(stashes)) {
|
||||
if (stash.message.startsWith(popMessageStart)) {
|
||||
stashName = stash.name;
|
||||
break;
|
||||
|
@@ -27,7 +27,6 @@
|
||||
#include "ui_authenticationdialog.h"
|
||||
#include "gerritserver.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
|
@@ -33,7 +33,6 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/progressindicator.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
|
||||
#include <QJsonArray>
|
||||
@@ -933,7 +932,7 @@ void GerritModel::resultRetrieved(const QByteArray &output)
|
||||
std::stable_sort(changes.begin(), changes.end(), gerritChangeLessThan);
|
||||
numberIndexHash.clear();
|
||||
|
||||
for (const GerritChangePtr &c : Utils::asConst(changes)) {
|
||||
for (const GerritChangePtr &c : qAsConst(changes)) {
|
||||
// Avoid duplicate entries for example in the (unlikely)
|
||||
// case people do self-reviews.
|
||||
if (!itemForNumber(c->number)) {
|
||||
|
@@ -45,7 +45,6 @@
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/checkablemessagebox.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
@@ -1516,7 +1515,7 @@ QString GitClient::synchronousTopic(const QString &workingDirectory) const
|
||||
const QString dereference("^{}");
|
||||
QString remoteBranch;
|
||||
|
||||
for (const QString &ref : Utils::asConst(references)) {
|
||||
for (const QString &ref : qAsConst(references)) {
|
||||
int derefInd = ref.indexOf(dereference);
|
||||
if (ref.startsWith(tagStart))
|
||||
return ref.mid(tagStart.size(), (derefInd == -1) ? -1 : derefInd - tagStart.size());
|
||||
@@ -1579,7 +1578,7 @@ void GitClient::synchronousTagsForCommit(const QString &workingDirectory, const
|
||||
QStringList parents;
|
||||
QString errorMessage;
|
||||
synchronousParentRevisions(workingDirectory, revision, &parents, &errorMessage);
|
||||
for (const QString &p : Utils::asConst(parents)) {
|
||||
for (const QString &p : qAsConst(parents)) {
|
||||
const SynchronousProcessResponse resp2 = vcsFullySynchronousExec(
|
||||
workingDirectory, {"describe", "--tags", "--abbrev=0", p}, silentFlags);
|
||||
QString pf = resp2.stdOut();
|
||||
@@ -1715,7 +1714,7 @@ bool GitClient::stashNameFromMessage(const QString &workingDirectory,
|
||||
QList<Stash> stashes;
|
||||
if (!synchronousStashList(workingDirectory, &stashes, errorMessage))
|
||||
return false;
|
||||
for (const Stash &s : Utils::asConst(stashes)) {
|
||||
for (const Stash &s : qAsConst(stashes)) {
|
||||
if (s.message == message) {
|
||||
*name = s.name;
|
||||
return true;
|
||||
@@ -2081,7 +2080,7 @@ void GitClient::updateSubmodulesIfNeeded(const QString &workingDirectory, bool p
|
||||
|
||||
void GitClient::finishSubmoduleUpdate()
|
||||
{
|
||||
for (const QString &submoduleDir : Utils::asConst(m_updatedSubmodules))
|
||||
for (const QString &submoduleDir : qAsConst(m_updatedSubmodules))
|
||||
endStashScope(submoduleDir);
|
||||
m_updatedSubmodules.clear();
|
||||
}
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/filesearch.h>
|
||||
#include <utils/fileutils.h>
|
||||
@@ -121,7 +120,7 @@ public:
|
||||
QRegularExpressionMatch regexpMatch = regexp.match(line);
|
||||
single.regexpCapturedTexts = regexpMatch.capturedTexts();
|
||||
}
|
||||
for (auto match : Utils::asConst(matches)) {
|
||||
for (auto match : qAsConst(matches)) {
|
||||
single.matchStart = match.first;
|
||||
single.matchLength = match.second;
|
||||
resultList->append(single);
|
||||
|
@@ -25,7 +25,6 @@
|
||||
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include "githighlighters.h"
|
||||
@@ -138,7 +137,7 @@ void GitRebaseHighlighter::highlightBlock(const QString &text)
|
||||
changeIndex += changeLen;
|
||||
}
|
||||
} else {
|
||||
for (const RebaseAction &action : Utils::asConst(m_actions)) {
|
||||
for (const RebaseAction &action : qAsConst(m_actions)) {
|
||||
if (action.exp.indexIn(text) != -1) {
|
||||
const int len = action.exp.matchedLength();
|
||||
setFormat(0, len, formatForCategory(action.formatCategory));
|
||||
|
@@ -58,7 +58,6 @@
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
|
||||
#include <coreplugin/messagebox.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/parameteraction.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -1360,15 +1359,15 @@ void GitPlugin::updateActions(VcsBasePlugin::ActionState as)
|
||||
// Note: This menu is visible if there is no repository. Only
|
||||
// 'Create Repository'/'Show' actions should be available.
|
||||
const QString fileName = Utils::quoteAmpersands(state.currentFileName());
|
||||
for (ParameterAction *fileAction : Utils::asConst(m_fileActions))
|
||||
for (ParameterAction *fileAction : qAsConst(m_fileActions))
|
||||
fileAction->setParameter(fileName);
|
||||
// If the current file looks like a patch, offer to apply
|
||||
m_applyCurrentFilePatchAction->setParameter(state.currentPatchFileDisplayName());
|
||||
const QString projectName = state.currentProjectName();
|
||||
for (ParameterAction *projectAction : Utils::asConst(m_projectActions))
|
||||
for (ParameterAction *projectAction : qAsConst(m_projectActions))
|
||||
projectAction->setParameter(projectName);
|
||||
|
||||
for (QAction *repositoryAction : Utils::asConst(m_repositoryActions))
|
||||
for (QAction *repositoryAction : qAsConst(m_repositoryActions))
|
||||
repositoryAction->setEnabled(repositoryEnabled);
|
||||
|
||||
m_submoduleUpdateAction->setVisible(repositoryEnabled
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include <coreplugin/helpmanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include <QIcon>
|
||||
@@ -86,7 +85,7 @@ QList<LocatorFilterEntry> HelpIndexFilter::matchesFor(QFutureInterface<LocatorFi
|
||||
|| !entry.contains(m_searchTermCache)) {
|
||||
int limit = entry.size() < 2 ? 200 : INT_MAX;
|
||||
QSet<QString> results;
|
||||
for (const QString &filePath : Utils::asConst(m_helpDatabases)) {
|
||||
for (const QString &filePath : qAsConst(m_helpDatabases)) {
|
||||
if (future.isCanceled())
|
||||
return QList<LocatorFilterEntry>();
|
||||
QSet<QString> result;
|
||||
@@ -111,7 +110,7 @@ QList<LocatorFilterEntry> HelpIndexFilter::matchesFor(QFutureInterface<LocatorFi
|
||||
keywords.reserve(m_keywordCache.size());
|
||||
unsortedKeywords.reserve(m_keywordCache.size());
|
||||
QSet<QString> allresults;
|
||||
for (const QString &keyword : Utils::asConst(m_keywordCache)) {
|
||||
for (const QString &keyword : qAsConst(m_keywordCache)) {
|
||||
if (future.isCanceled())
|
||||
return QList<LocatorFilterEntry>();
|
||||
if (keyword.startsWith(entry, cs)) {
|
||||
@@ -126,7 +125,7 @@ QList<LocatorFilterEntry> HelpIndexFilter::matchesFor(QFutureInterface<LocatorFi
|
||||
keywords << unsortedKeywords;
|
||||
m_keywordCache = allresults;
|
||||
m_searchTermCache = entry;
|
||||
for (const QString &keyword : Utils::asConst(keywords)) {
|
||||
for (const QString &keyword : qAsConst(keywords)) {
|
||||
const int index = keyword.indexOf(entry, 0, cs);
|
||||
LocatorFilterEntry filterEntry(this, keyword, QVariant(), m_icon);
|
||||
filterEntry.highlightInfo = {index, entry.length()};
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include "toolchainmanager.h"
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
@@ -48,7 +48,6 @@
|
||||
#include <projectexplorer/projecttree.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -593,7 +592,7 @@ Utils::FileNameList Project::files(const Project::NodeMatcher &filter) const
|
||||
result.append(projectFilePath());
|
||||
|
||||
Utils::FileName lastAdded;
|
||||
for (const Node *n : Utils::asConst(d->m_sortedNodeList)) {
|
||||
for (const Node *n : qAsConst(d->m_sortedNodeList)) {
|
||||
if (filter && !filter(n))
|
||||
continue;
|
||||
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#include "projectconfiguration.h"
|
||||
#include "target.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
@@ -87,7 +86,7 @@ void Subscription::unsubscribe(ProjectConfiguration *pc)
|
||||
|
||||
void Subscription::unsubscribeAll()
|
||||
{
|
||||
for (const auto &c : Utils::asConst(m_connections))
|
||||
for (const auto &c : qAsConst(m_connections))
|
||||
disconnect(c);
|
||||
m_connections.clear();
|
||||
}
|
||||
|
@@ -42,7 +42,6 @@
|
||||
#include <qtsupport/profilereader.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/stringutils.h>
|
||||
@@ -199,7 +198,7 @@ QmakePriFile *QmakePriFile::findPriFile(const FileName &fileName)
|
||||
{
|
||||
if (fileName == filePath())
|
||||
return this;
|
||||
for (QmakePriFile *n : Utils::asConst(m_children)) {
|
||||
for (QmakePriFile *n : qAsConst(m_children)) {
|
||||
if (QmakePriFile *result = n->findPriFile(fileName))
|
||||
return result;
|
||||
}
|
||||
@@ -210,7 +209,7 @@ const QmakePriFile *QmakePriFile::findPriFile(const FileName &fileName) const
|
||||
{
|
||||
if (fileName == filePath())
|
||||
return this;
|
||||
for (const QmakePriFile *n : Utils::asConst(m_children)) {
|
||||
for (const QmakePriFile *n : qAsConst(m_children)) {
|
||||
if (const QmakePriFile *result = n->findPriFile(fileName))
|
||||
return result;
|
||||
}
|
||||
|
@@ -43,8 +43,6 @@
|
||||
#include <qmljstools/qmljsmodelmanager.h>
|
||||
#include <qmljstools/qmljsqtstylecodeformatter.h>
|
||||
|
||||
#include <utils/asconst.h>
|
||||
|
||||
using namespace QmlJSEditor;
|
||||
using namespace QmlJS;
|
||||
using namespace QmlJS::AST;
|
||||
@@ -627,13 +625,13 @@ void QmlJSEditorDocumentPrivate::createTextMarks(const SemanticInfo &info)
|
||||
m_semanticMarks.removeAll(mark);
|
||||
delete mark;
|
||||
};
|
||||
for (const DiagnosticMessage &diagnostic : Utils::asConst(info.semanticMessages)) {
|
||||
for (const DiagnosticMessage &diagnostic : qAsConst(info.semanticMessages)) {
|
||||
auto mark = new QmlJSTextMark(q->filePath().toString(),
|
||||
diagnostic, onMarkRemoved);
|
||||
m_semanticMarks.append(mark);
|
||||
q->addMark(mark);
|
||||
}
|
||||
for (const QmlJS::StaticAnalysis::Message &message : Utils::asConst(info.staticAnalysisMessages)) {
|
||||
for (const QmlJS::StaticAnalysis::Message &message : qAsConst(info.staticAnalysisMessages)) {
|
||||
auto mark = new QmlJSTextMark(q->filePath().toString(),
|
||||
message, onMarkRemoved);
|
||||
m_semanticMarks.append(mark);
|
||||
|
@@ -26,8 +26,6 @@
|
||||
#include "serialterminalsettings.h"
|
||||
#include "serialterminalconstants.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
|
||||
#include <QLoggingCategory>
|
||||
#include <QSettings>
|
||||
|
||||
@@ -150,7 +148,7 @@ void Settings::saveLineEndings(QSettings &settings)
|
||||
{
|
||||
settings.beginWriteArray(Constants::SETTINGS_LINE_ENDINGS, lineEndings.size());
|
||||
int i = 0;
|
||||
for (const QPair<QString, QByteArray>& value : Utils::asConst(lineEndings)) {
|
||||
for (const QPair<QString, QByteArray>& value : qAsConst(lineEndings)) {
|
||||
settings.setArrayIndex(i++);
|
||||
settings.setValue(Constants::SETTINGS_LINE_ENDING_NAME, value.first);
|
||||
settings.setValue(Constants::SETTINGS_LINE_ENDING_VALUE, value.second);
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include "iassistprocessor.h"
|
||||
#include "../snippets/snippetassistcollector.h"
|
||||
|
||||
#include "utils/asconst.h"
|
||||
#include "utils/runextensions.h"
|
||||
|
||||
#include <QElapsedTimer>
|
||||
|
@@ -30,7 +30,6 @@
|
||||
#include "fontsettings.h"
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QTextDocument>
|
||||
@@ -837,7 +836,7 @@ void SyntaxHighlighter::highlightBlock(const QString &text)
|
||||
|
||||
void SyntaxHighlighterPrivate::updateFormats(const FontSettings &fontSettings)
|
||||
{
|
||||
for (const auto &pair : Utils::asConst(formatCategories))
|
||||
for (const auto &pair : qAsConst(formatCategories))
|
||||
formats[pair.first] = fontSettings.toTextCharFormat(pair.second);
|
||||
whitespaceFormat = fontSettings.toTextCharFormat(C_VISUAL_WHITESPACE);
|
||||
}
|
||||
|
@@ -74,7 +74,6 @@
|
||||
#include <coreplugin/find/basetextfind.h>
|
||||
#include <coreplugin/find/highlightscrollbarcontroller.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/textutils.h>
|
||||
#include <utils/fixedsizeclicklabel.h>
|
||||
#include <utils/fileutils.h>
|
||||
@@ -1233,7 +1232,7 @@ void TextEditorWidgetPrivate::updateAutoCompleteHighlight()
|
||||
= q->textDocument()->fontSettings().toTextCharFormat(C_AUTOCOMPLETE);
|
||||
|
||||
QList<QTextEdit::ExtraSelection> extraSelections;
|
||||
for (const QTextCursor &cursor : Utils::asConst(m_autoCompleteHighlightPos)) {
|
||||
for (const QTextCursor &cursor : qAsConst(m_autoCompleteHighlightPos)) {
|
||||
QTextEdit::ExtraSelection sel;
|
||||
sel.cursor = cursor;
|
||||
sel.format.setBackground(matchFormat.background());
|
||||
@@ -3520,7 +3519,7 @@ bool TextEditorWidgetPrivate::processAnnotaionTooltipRequest(const QTextBlock &b
|
||||
Utils::sort(marks, [](const TextMark* mark1, const TextMark* mark2){
|
||||
return mark1->priority() > mark2->priority();
|
||||
});
|
||||
for (const TextMark *mark : Utils::asConst(marks)) {
|
||||
for (const TextMark *mark : qAsConst(marks)) {
|
||||
if (mark != annotationRect.mark)
|
||||
mark->addToToolTipLayout(layout);
|
||||
}
|
||||
@@ -7188,7 +7187,7 @@ void TextEditorWidget::rewrapParagraph()
|
||||
// keep the same indentation level as first line in paragraph.
|
||||
QString currentWord;
|
||||
|
||||
for (const QChar &ch : Utils::asConst(selectedText)) {
|
||||
for (const QChar &ch : qAsConst(selectedText)) {
|
||||
if (ch.isSpace()) {
|
||||
if (!currentWord.isEmpty()) {
|
||||
currentLength += currentWord.length() + 1;
|
||||
|
@@ -37,8 +37,6 @@
|
||||
#endif // Q_CC_MSVC
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
#include <utils/asconst.h>
|
||||
|
||||
#include <QtTest>
|
||||
#include <math.h>
|
||||
|
||||
@@ -1450,7 +1448,7 @@ void tst_Dumpers::dumper()
|
||||
|
||||
QSet<QString> expandedINames;
|
||||
expandedINames.insert("local");
|
||||
for (const Check &check : Utils::asConst(data.checks)) {
|
||||
for (const Check &check : qAsConst(data.checks)) {
|
||||
QString parent = check.iname;
|
||||
while (true) {
|
||||
parent = parentIName(parent);
|
||||
@@ -1462,7 +1460,7 @@ void tst_Dumpers::dumper()
|
||||
|
||||
QString expanded;
|
||||
QString expandedq;
|
||||
for (const QString &iname : Utils::asConst(expandedINames)) {
|
||||
for (const QString &iname : qAsConst(expandedINames)) {
|
||||
if (!expanded.isEmpty()) {
|
||||
expanded.append(',');
|
||||
expandedq.append(',');
|
||||
@@ -1641,7 +1639,7 @@ void tst_Dumpers::dumper()
|
||||
WatchItem local;
|
||||
local.iname = "local";
|
||||
|
||||
for (const GdbMi &child : Utils::asConst(actual.children())) {
|
||||
for (const GdbMi &child : qAsConst(actual.children())) {
|
||||
const QString iname = child["iname"].data();
|
||||
if (iname == "local.qtversion")
|
||||
context.qtVersion = child["value"].toInt();
|
||||
@@ -1719,7 +1717,7 @@ void tst_Dumpers::dumper()
|
||||
|
||||
if (!data.checks.isEmpty()) {
|
||||
qDebug() << "SOME TESTS NOT EXECUTED: ";
|
||||
for (const Check &check : Utils::asConst(data.checks)) {
|
||||
for (const Check &check : qAsConst(data.checks)) {
|
||||
if (check.optionallyPresent) {
|
||||
qDebug() << " OPTIONAL TEST NOT FOUND FOR INAME: " << check.iname << " IGNORED.";
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user