forked from qt-creator/qt-creator
Use qAsConst with non-const Qt containers in range-loops
... in various places Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -148,7 +148,7 @@ static CPlusPlus::Document::Ptr declaringDocument(CPlusPlus::Document::Ptr doc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const CPlusPlus::LookupItem &item : lookupItems) {
|
for (const CPlusPlus::LookupItem &item : qAsConst(lookupItems)) {
|
||||||
if (CPlusPlus::Symbol *symbol = item.declaration()) {
|
if (CPlusPlus::Symbol *symbol = item.declaration()) {
|
||||||
if (CPlusPlus::Class *toeClass = symbol->asClass()) {
|
if (CPlusPlus::Class *toeClass = symbol->asClass()) {
|
||||||
const QString declFileName = QLatin1String(toeClass->fileId()->chars(),
|
const QString declFileName = QLatin1String(toeClass->fileId()->chars(),
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ QList<Document::Ptr> QuickTestParser::scanDirectoryForQuickTestQmlFiles(const QS
|
|||||||
|
|
||||||
QList<Document::Ptr> foundDocs;
|
QList<Document::Ptr> foundDocs;
|
||||||
|
|
||||||
for (const QString &path : dirs) {
|
for (const QString &path : qAsConst(dirs)) {
|
||||||
const QList<Document::Ptr> docs = snapshot.documentsInDirectory(path);
|
const QList<Document::Ptr> docs = snapshot.documentsInDirectory(path);
|
||||||
for (const Document::Ptr &doc : docs) {
|
for (const Document::Ptr &doc : docs) {
|
||||||
const QFileInfo fi(doc->fileName());
|
const QFileInfo fi(doc->fileName());
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ void TestResultModel::recalculateMaxWidthOfFileName(const QFont &font)
|
|||||||
{
|
{
|
||||||
const QFontMetrics fm(font);
|
const QFontMetrics fm(font);
|
||||||
m_maxWidthOfFileName = 0;
|
m_maxWidthOfFileName = 0;
|
||||||
for (const QString &fileName : m_fileNames) {
|
for (const QString &fileName : qAsConst(m_fileNames)) {
|
||||||
int pos = fileName.lastIndexOf('/');
|
int pos = fileName.lastIndexOf('/');
|
||||||
m_maxWidthOfFileName = qMax(m_maxWidthOfFileName, fm.horizontalAdvance(fileName.mid(pos + 1)));
|
m_maxWidthOfFileName = qMax(m_maxWidthOfFileName, fm.horizontalAdvance(fileName.mid(pos + 1)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ void TestResultsPane::addOutputLine(const QByteArray &outputLine, OutputChannel
|
|||||||
|
|
||||||
const Utils::FormattedText formattedText
|
const Utils::FormattedText formattedText
|
||||||
= Utils::FormattedText{QString::fromUtf8(outputLine), m_defaultFormat};
|
= Utils::FormattedText{QString::fromUtf8(outputLine), m_defaultFormat};
|
||||||
QList<Utils::FormattedText> formatted = channel == OutputChannel::StdOut
|
const QList<Utils::FormattedText> formatted = channel == OutputChannel::StdOut
|
||||||
? m_stdOutHandler.parseText(formattedText)
|
? m_stdOutHandler.parseText(formattedText)
|
||||||
: m_stdErrHandler.parseText(formattedText);
|
: m_stdErrHandler.parseText(formattedText);
|
||||||
|
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ void TestTreeModel::synchronizeTestTools()
|
|||||||
for (ITestTreeItem *oldFrameworkRoot : oldFrameworkRoots)
|
for (ITestTreeItem *oldFrameworkRoot : oldFrameworkRoots)
|
||||||
takeItem(oldFrameworkRoot); // do NOT delete the ptr is still held by TestFrameworkManager
|
takeItem(oldFrameworkRoot); // do NOT delete the ptr is still held by TestFrameworkManager
|
||||||
|
|
||||||
for (ITestTool *testTool : tools) {
|
for (ITestTool *testTool : qAsConst(tools)) {
|
||||||
ITestTreeItem *testToolRootNode = testTool->rootNode();
|
ITestTreeItem *testToolRootNode = testTool->rootNode();
|
||||||
if (testTool->active()) {
|
if (testTool->active()) {
|
||||||
invisibleRoot->appendChild(testToolRootNode);
|
invisibleRoot->appendChild(testToolRootNode);
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ void AutotoolsBuildSystem::makefileParsingFinished()
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto newRoot = std::make_unique<ProjectNode>(project()->projectDirectory());
|
auto newRoot = std::make_unique<ProjectNode>(project()->projectDirectory());
|
||||||
for (const QString &f : m_files) {
|
for (const QString &f : qAsConst(m_files)) {
|
||||||
const Utils::FilePath path = Utils::FilePath::fromString(f);
|
const Utils::FilePath path = Utils::FilePath::fromString(f);
|
||||||
newRoot->addNestedNode(std::make_unique<FileNode>(path,
|
newRoot->addNestedNode(std::make_unique<FileNode>(path,
|
||||||
FileNode::fileTypeForFileName(path)));
|
FileNode::fileTypeForFileName(path)));
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ static void extractAllFiles(const DebuggerRunTool *runTool, QStringList &include
|
|||||||
const CppTools::ProjectInfo info = CppModelManager::instance()->projectInfo(project);
|
const CppTools::ProjectInfo info = CppModelManager::instance()->projectInfo(project);
|
||||||
const QVector<ProjectPart::Ptr> parts = info.projectParts();
|
const QVector<ProjectPart::Ptr> parts = info.projectParts();
|
||||||
for (const ProjectPart::Ptr &part : parts) {
|
for (const ProjectPart::Ptr &part : parts) {
|
||||||
for (const ProjectFile &file : part->files) {
|
for (const ProjectFile &file : qAsConst(part->files)) {
|
||||||
if (!file.active)
|
if (!file.active)
|
||||||
continue;
|
continue;
|
||||||
const auto path = FilePath::fromString(file.path);
|
const auto path = FilePath::fromString(file.path);
|
||||||
@@ -104,7 +104,7 @@ static void extractAllFiles(const DebuggerRunTool *runTool, QStringList &include
|
|||||||
else if (file.path.endsWith(".s") && !assemblers.contains(path))
|
else if (file.path.endsWith(".s") && !assemblers.contains(path))
|
||||||
assemblers.push_back(path);
|
assemblers.push_back(path);
|
||||||
}
|
}
|
||||||
for (const HeaderPath &include : part->headerPaths) {
|
for (const HeaderPath &include : qAsConst(part->headerPaths)) {
|
||||||
if (!includes.contains(include.path))
|
if (!includes.contains(include.path))
|
||||||
includes.push_back(include.path);
|
includes.push_back(include.path);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ void AbstractSettings::readDocumentation()
|
|||||||
if (xml.readNext() == QXmlStreamReader::Characters) {
|
if (xml.readNext() == QXmlStreamReader::Characters) {
|
||||||
m_docu << xml.text().toString();
|
m_docu << xml.text().toString();
|
||||||
const int index = m_docu.size() - 1;
|
const int index = m_docu.size() - 1;
|
||||||
for (const QString &key : keys)
|
for (const QString &key : qAsConst(keys))
|
||||||
m_options.insert(key, index);
|
m_options.insert(key, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ void ArtisticStyleSettings::createDocumentationFile() const
|
|||||||
// Write entry
|
// Write entry
|
||||||
stream.writeStartElement(Constants::DOCUMENTATION_XMLENTRY);
|
stream.writeStartElement(Constants::DOCUMENTATION_XMLENTRY);
|
||||||
stream.writeStartElement(Constants::DOCUMENTATION_XMLKEYS);
|
stream.writeStartElement(Constants::DOCUMENTATION_XMLKEYS);
|
||||||
for (const QString &key : keys)
|
for (const QString &key : qAsConst(keys))
|
||||||
stream.writeTextElement(Constants::DOCUMENTATION_XMLKEY, key);
|
stream.writeTextElement(Constants::DOCUMENTATION_XMLKEY, key);
|
||||||
stream.writeEndElement();
|
stream.writeEndElement();
|
||||||
const QString text = "<p><span class=\"option\">"
|
const QString text = "<p><span class=\"option\">"
|
||||||
|
|||||||
@@ -578,7 +578,7 @@ void CMakeBuildSystem::updateProjectData()
|
|||||||
{
|
{
|
||||||
QSet<QString> res;
|
QSet<QString> res;
|
||||||
QStringList apps;
|
QStringList apps;
|
||||||
for (const auto &target : m_buildTargets) {
|
for (const auto &target : qAsConst(m_buildTargets)) {
|
||||||
if (target.targetType == CMakeProjectManager::DynamicLibraryType) {
|
if (target.targetType == CMakeProjectManager::DynamicLibraryType) {
|
||||||
res.insert(target.executable.parentDir().toString());
|
res.insert(target.executable.parentDir().toString());
|
||||||
apps.push_back(target.executable.toUserOutput());
|
apps.push_back(target.executable.toUserOutput());
|
||||||
@@ -633,7 +633,7 @@ void CMakeBuildSystem::updateProjectData()
|
|||||||
}
|
}
|
||||||
patchedConfig.append(settingFileItem);
|
patchedConfig.append(settingFileItem);
|
||||||
|
|
||||||
for (const CMakeBuildTarget &bt : m_buildTargets) {
|
for (const CMakeBuildTarget &bt : qAsConst(m_buildTargets)) {
|
||||||
const QString buildKey = bt.title;
|
const QString buildKey = bt.title;
|
||||||
if (ProjectNode *node = p->findNodeForBuildKey(buildKey)) {
|
if (ProjectNode *node = p->findNodeForBuildKey(buildKey)) {
|
||||||
if (auto targetNode = dynamic_cast<CMakeTargetNode *>(node))
|
if (auto targetNode = dynamic_cast<CMakeTargetNode *>(node))
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ void ConfigModel::generateTree()
|
|||||||
|
|
||||||
// Generate nodes for *all* prefixes
|
// Generate nodes for *all* prefixes
|
||||||
QHash<QString, QList<Utils::TreeItem *>> prefixes;
|
QHash<QString, QList<Utils::TreeItem *>> prefixes;
|
||||||
for (const InternalDataItem &di : m_configuration) {
|
for (const InternalDataItem &di : qAsConst(m_configuration)) {
|
||||||
const QString p = prefix(di.key);
|
const QString p = prefix(di.key);
|
||||||
if (!prefixes.contains(p)) {
|
if (!prefixes.contains(p)) {
|
||||||
prefixes.insert(p, {});
|
prefixes.insert(p, {});
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ bool MenuActionContainer::updateInternal()
|
|||||||
bool hasitems = false;
|
bool hasitems = false;
|
||||||
QList<QAction *> actions = m_menu->actions();
|
QList<QAction *> actions = m_menu->actions();
|
||||||
|
|
||||||
for (const Group &group : m_groups) {
|
for (const Group &group : qAsConst(m_groups)) {
|
||||||
foreach (QObject *item, group.items) {
|
foreach (QObject *item, group.items) {
|
||||||
if (auto container = qobject_cast<ActionContainerPrivate*>(item)) {
|
if (auto container = qobject_cast<ActionContainerPrivate*>(item)) {
|
||||||
actions.removeAll(container->menu()->menuAction());
|
actions.removeAll(container->menu()->menuAction());
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ BaseFileWizard::BaseFileWizard(const BaseFileWizardFactory *factory,
|
|||||||
m_extraValues(extraValues),
|
m_extraValues(extraValues),
|
||||||
m_factory(factory)
|
m_factory(factory)
|
||||||
{
|
{
|
||||||
for (IFileWizardExtension *extension : g_fileWizardExtensions)
|
for (IFileWizardExtension *extension : qAsConst(g_fileWizardExtensions))
|
||||||
m_extensionPages += extension->extensionPages(factory);
|
m_extensionPages += extension->extensionPages(factory);
|
||||||
|
|
||||||
if (!m_extensionPages.empty())
|
if (!m_extensionPages.empty())
|
||||||
@@ -66,7 +66,7 @@ void BaseFileWizard::initializePage(int id)
|
|||||||
if (page(id) == m_firstExtensionPage) {
|
if (page(id) == m_firstExtensionPage) {
|
||||||
generateFileList();
|
generateFileList();
|
||||||
|
|
||||||
for (IFileWizardExtension *ex : g_fileWizardExtensions)
|
for (IFileWizardExtension *ex : qAsConst(g_fileWizardExtensions))
|
||||||
ex->firstExtensionPageShown(m_files, m_extraValues);
|
ex->firstExtensionPageShown(m_files, m_extraValues);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ void BaseFileWizard::accept()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (IFileWizardExtension *ex : g_fileWizardExtensions) {
|
for (IFileWizardExtension *ex : qAsConst(g_fileWizardExtensions)) {
|
||||||
for (int i = 0; i < m_files.count(); i++) {
|
for (int i = 0; i < m_files.count(); i++) {
|
||||||
ex->applyCodeStyle(&m_files[i]);
|
ex->applyCodeStyle(&m_files[i]);
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ void BaseFileWizard::accept()
|
|||||||
|
|
||||||
bool removeOpenProjectAttribute = false;
|
bool removeOpenProjectAttribute = false;
|
||||||
// Run the extensions
|
// Run the extensions
|
||||||
for (IFileWizardExtension *ex : g_fileWizardExtensions) {
|
for (IFileWizardExtension *ex : qAsConst(g_fileWizardExtensions)) {
|
||||||
bool remove;
|
bool remove;
|
||||||
if (!ex->processFiles(m_files, &remove, &errorMessage)) {
|
if (!ex->processFiles(m_files, &remove, &errorMessage)) {
|
||||||
if (!errorMessage.isEmpty())
|
if (!errorMessage.isEmpty())
|
||||||
|
|||||||
@@ -610,7 +610,7 @@ void SettingsDialog::ensureCategoryWidget(Category *category)
|
|||||||
m_model.ensurePages(category);
|
m_model.ensurePages(category);
|
||||||
auto tabWidget = new QTabWidget;
|
auto tabWidget = new QTabWidget;
|
||||||
tabWidget->tabBar()->setObjectName("qc_settings_main_tabbar"); // easier lookup in Squish
|
tabWidget->tabBar()->setObjectName("qc_settings_main_tabbar"); // easier lookup in Squish
|
||||||
for (IOptionsPage *page : category->pages) {
|
for (IOptionsPage *page : qAsConst(category->pages)) {
|
||||||
QWidget *widget = page->widget();
|
QWidget *widget = page->widget();
|
||||||
ICore::setupScreenShooter(page->displayName(), widget);
|
ICore::setupScreenShooter(page->displayName(), widget);
|
||||||
auto ssa = new SmartScrollArea(this);
|
auto ssa = new SmartScrollArea(this);
|
||||||
|
|||||||
@@ -3614,7 +3614,7 @@ bool EditorManager::restoreState(const QByteArray &state)
|
|||||||
// restore windows
|
// restore windows
|
||||||
QVector<QVariantHash> windowStates;
|
QVector<QVariantHash> windowStates;
|
||||||
stream >> windowStates;
|
stream >> windowStates;
|
||||||
for (const QVariantHash &windowState : windowStates) {
|
for (const QVariantHash &windowState : qAsConst(windowStates)) {
|
||||||
EditorWindow *window = d->createEditorWindow();
|
EditorWindow *window = d->createEditorWindow();
|
||||||
window->restoreState(windowState);
|
window->restoreState(windowState);
|
||||||
window->show();
|
window->show();
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ void ModeManagerPrivate::extensionsInitializedHelper()
|
|||||||
Utils::sort(m_modes, &IMode::priority);
|
Utils::sort(m_modes, &IMode::priority);
|
||||||
std::reverse(m_modes.begin(), m_modes.end());
|
std::reverse(m_modes.begin(), m_modes.end());
|
||||||
|
|
||||||
for (IMode *mode : m_modes)
|
for (IMode *mode : qAsConst(m_modes))
|
||||||
appendMode(mode);
|
appendMode(mode);
|
||||||
|
|
||||||
if (m_pendingFirstActiveMode.isValid())
|
if (m_pendingFirstActiveMode.isValid())
|
||||||
|
|||||||
@@ -520,7 +520,7 @@ void OutputWindow::flush()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
d->queueTimer.stop();
|
d->queueTimer.stop();
|
||||||
for (const auto &chunk : d->queuedOutput)
|
for (const auto &chunk : qAsConst(d->queuedOutput))
|
||||||
handleOutputChunk(chunk.first, chunk.second);
|
handleOutputChunk(chunk.first, chunk.second);
|
||||||
d->queuedOutput.clear();
|
d->queuedOutput.clear();
|
||||||
d->formatter.flush();
|
d->formatter.flush();
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ static void createStatusBarManager()
|
|||||||
delete statusContext;
|
delete statusContext;
|
||||||
// This is the catch-all on rampdown. Individual items may
|
// This is the catch-all on rampdown. Individual items may
|
||||||
// have been removed earlier by destroyStatusBarWidget().
|
// have been removed earlier by destroyStatusBarWidget().
|
||||||
for (const QPointer<IContext> &context : m_contexts) {
|
for (const QPointer<IContext> &context : qAsConst(m_contexts)) {
|
||||||
ICore::removeContextObject(context);
|
ICore::removeContextObject(context);
|
||||||
delete context;
|
delete context;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -611,7 +611,7 @@ bool ListItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
|
|||||||
const QPoint pos = mev->pos();
|
const QPoint pos = mev->pos();
|
||||||
if (pos.y() > option.rect.y() + GridProxyModel::TagsSeparatorY) {
|
if (pos.y() > option.rect.y() + GridProxyModel::TagsSeparatorY) {
|
||||||
//const QStringList tags = idx.data(Tags).toStringList();
|
//const QStringList tags = idx.data(Tags).toStringList();
|
||||||
for (const auto &it : m_currentTagRects) {
|
for (const auto &it : qAsConst(m_currentTagRects)) {
|
||||||
if (it.second.contains(pos))
|
if (it.second.contains(pos))
|
||||||
emit tagClicked(it.first);
|
emit tagClicked(it.first);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3113,7 +3113,7 @@ public:
|
|||||||
defaultImplTargetComboBox->insertItems(0, implTargetStrings);
|
defaultImplTargetComboBox->insertItems(0, implTargetStrings);
|
||||||
connect(defaultImplTargetComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
connect(defaultImplTargetComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
||||||
[this](int index) {
|
[this](int index) {
|
||||||
for (QComboBox * const cb : m_implTargetBoxes)
|
for (QComboBox * const cb : qAsConst(m_implTargetBoxes))
|
||||||
cb->setCurrentIndex(index);
|
cb->setCurrentIndex(index);
|
||||||
});
|
});
|
||||||
const auto defaultImplTargetLayout = new QHBoxLayout;
|
const auto defaultImplTargetLayout = new QHBoxLayout;
|
||||||
@@ -4621,7 +4621,7 @@ public:
|
|||||||
}
|
}
|
||||||
const QStringList memberFunctionsAsStrings = toStringList(memberFunctions);
|
const QStringList memberFunctionsAsStrings = toStringList(memberFunctions);
|
||||||
|
|
||||||
for (Symbol *const member : dataMembers) {
|
for (Symbol *const member : qAsConst(dataMembers)) {
|
||||||
ExistingGetterSetterData existing;
|
ExistingGetterSetterData existing;
|
||||||
existing.memberVariableName = QString::fromUtf8(member->identifier()->chars(),
|
existing.memberVariableName = QString::fromUtf8(member->identifier()->chars(),
|
||||||
member->identifier()->size());
|
member->identifier()->size());
|
||||||
@@ -8000,7 +8000,7 @@ private:
|
|||||||
processIncludes(refactoring, filePath().toString());
|
processIncludes(refactoring, filePath().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &file : m_changes)
|
for (auto &file : qAsConst(m_changes))
|
||||||
file->apply();
|
file->apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ void CppQuickFixSettingsWidget::loadSettings(CppQuickFixSettings *settings)
|
|||||||
ui->checkBox_setterSlots->setChecked(settings->setterAsSlot);
|
ui->checkBox_setterSlots->setChecked(settings->setterAsSlot);
|
||||||
ui->checkBox_signalWithNewValue->setChecked(settings->signalWithNewValue);
|
ui->checkBox_signalWithNewValue->setChecked(settings->signalWithNewValue);
|
||||||
ui->valueTypes->clear();
|
ui->valueTypes->clear();
|
||||||
for (const auto &valueType : settings->valueTypes) {
|
for (const auto &valueType : qAsConst(settings->valueTypes)) {
|
||||||
auto item = new QListWidgetItem(valueType, ui->valueTypes);
|
auto item = new QListWidgetItem(valueType, ui->valueTypes);
|
||||||
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled
|
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled
|
||||||
| Qt::ItemNeverHasChildren);
|
| Qt::ItemNeverHasChildren);
|
||||||
|
|||||||
@@ -343,9 +343,9 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
|
|||||||
using ProjectExplorer::HeaderPath;
|
using ProjectExplorer::HeaderPath;
|
||||||
using ProjectExplorer::HeaderPathType;
|
using ProjectExplorer::HeaderPathType;
|
||||||
|
|
||||||
for (const HeaderPath &headerPath : filter.userHeaderPaths)
|
for (const HeaderPath &headerPath : qAsConst(filter.userHeaderPaths))
|
||||||
addIncludeDirOptionForPath(headerPath);
|
addIncludeDirOptionForPath(headerPath);
|
||||||
for (const HeaderPath &headerPath : filter.systemHeaderPaths)
|
for (const HeaderPath &headerPath : qAsConst(filter.systemHeaderPaths))
|
||||||
addIncludeDirOptionForPath(headerPath);
|
addIncludeDirOptionForPath(headerPath);
|
||||||
|
|
||||||
if (m_useTweakedHeaderPaths != UseTweakedHeaderPaths::No) {
|
if (m_useTweakedHeaderPaths != UseTweakedHeaderPaths::No) {
|
||||||
@@ -356,7 +356,7 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
|
|||||||
m_options.prepend("-nostdinc++");
|
m_options.prepend("-nostdinc++");
|
||||||
m_options.prepend("-nostdinc");
|
m_options.prepend("-nostdinc");
|
||||||
|
|
||||||
for (const HeaderPath &headerPath : filter.builtInHeaderPaths)
|
for (const HeaderPath &headerPath : qAsConst(filter.builtInHeaderPaths))
|
||||||
addIncludeDirOptionForPath(headerPath);
|
addIncludeDirOptionForPath(headerPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -730,7 +730,7 @@ void CppModelManager::ensureUpdated()
|
|||||||
QStringList CppModelManager::internalProjectFiles() const
|
QStringList CppModelManager::internalProjectFiles() const
|
||||||
{
|
{
|
||||||
QStringList files;
|
QStringList files;
|
||||||
for (const ProjectInfo &pinfo : d->m_projectToProjectsInfo) {
|
for (const ProjectInfo &pinfo : qAsConst(d->m_projectToProjectsInfo)) {
|
||||||
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
|
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
|
||||||
foreach (const ProjectFile &file, part->files)
|
foreach (const ProjectFile &file, part->files)
|
||||||
files += file.path;
|
files += file.path;
|
||||||
@@ -743,7 +743,7 @@ QStringList CppModelManager::internalProjectFiles() const
|
|||||||
ProjectExplorer::HeaderPaths CppModelManager::internalHeaderPaths() const
|
ProjectExplorer::HeaderPaths CppModelManager::internalHeaderPaths() const
|
||||||
{
|
{
|
||||||
ProjectExplorer::HeaderPaths headerPaths;
|
ProjectExplorer::HeaderPaths headerPaths;
|
||||||
for (const ProjectInfo &pinfo : d->m_projectToProjectsInfo) {
|
for (const ProjectInfo &pinfo : qAsConst(d->m_projectToProjectsInfo)) {
|
||||||
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
|
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
|
||||||
foreach (const ProjectExplorer::HeaderPath &path, part->headerPaths) {
|
foreach (const ProjectExplorer::HeaderPath &path, part->headerPaths) {
|
||||||
ProjectExplorer::HeaderPath hp(QDir::cleanPath(path.path), path.type);
|
ProjectExplorer::HeaderPath hp(QDir::cleanPath(path.path), path.type);
|
||||||
@@ -771,7 +771,7 @@ ProjectExplorer::Macros CppModelManager::internalDefinedMacros() const
|
|||||||
{
|
{
|
||||||
ProjectExplorer::Macros macros;
|
ProjectExplorer::Macros macros;
|
||||||
QSet<ProjectExplorer::Macro> alreadyIn;
|
QSet<ProjectExplorer::Macro> alreadyIn;
|
||||||
for (const ProjectInfo &pinfo : d->m_projectToProjectsInfo) {
|
for (const ProjectInfo &pinfo : qAsConst(d->m_projectToProjectsInfo)) {
|
||||||
for (const ProjectPart::Ptr &part : pinfo.projectParts()) {
|
for (const ProjectPart::Ptr &part : pinfo.projectParts()) {
|
||||||
addUnique(part->toolChainMacros, macros, alreadyIn);
|
addUnique(part->toolChainMacros, macros, alreadyIn);
|
||||||
addUnique(part->projectMacros, macros, alreadyIn);
|
addUnique(part->projectMacros, macros, alreadyIn);
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ void CtfTraceManager::finalize()
|
|||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (CtfTimelineModel *model: m_threadModels) {
|
for (CtfTimelineModel *model: qAsConst(m_threadModels)) {
|
||||||
model->finalize(m_traceBegin, m_traceEnd,
|
model->finalize(m_traceBegin, m_traceEnd,
|
||||||
m_processNames[model->m_processId], m_threadNames[model->m_threadId]);
|
m_processNames[model->m_processId], m_threadNames[model->m_threadId]);
|
||||||
}
|
}
|
||||||
@@ -278,7 +278,7 @@ void CtfTraceManager::updateStatistics()
|
|||||||
});
|
});
|
||||||
|
|
||||||
m_statisticsModel->beginLoading();
|
m_statisticsModel->beginLoading();
|
||||||
for (auto thread : m_threadModels) {
|
for (auto thread : qAsConst(m_threadModels)) {
|
||||||
if (showAll || m_threadRestrictions[thread->tid()])
|
if (showAll || m_threadRestrictions[thread->tid()])
|
||||||
{
|
{
|
||||||
const int eventCount = thread->count();
|
const int eventCount = thread->count();
|
||||||
@@ -295,7 +295,7 @@ void CtfTraceManager::updateStatistics()
|
|||||||
void CtfTraceManager::clearAll()
|
void CtfTraceManager::clearAll()
|
||||||
{
|
{
|
||||||
m_modelAggregator->clear();
|
m_modelAggregator->clear();
|
||||||
for (CtfTimelineModel *model: m_threadModels) {
|
for (CtfTimelineModel *model: qAsConst(m_threadModels)) {
|
||||||
model->deleteLater();
|
model->deleteLater();
|
||||||
}
|
}
|
||||||
m_threadModels.clear();
|
m_threadModels.clear();
|
||||||
|
|||||||
@@ -923,7 +923,7 @@ void SideBySideDiffEditorWidget::showDiff()
|
|||||||
int blockNumber = 0;
|
int blockNumber = 0;
|
||||||
QChar separator = '\n';
|
QChar separator = '\n';
|
||||||
QHash<int, int> foldingIndent;
|
QHash<int, int> foldingIndent;
|
||||||
for (const FileData &contextFileData : m_controller.m_contextFileData) {
|
for (const FileData &contextFileData : qAsConst(m_controller.m_contextFileData)) {
|
||||||
QString leftText, rightText;
|
QString leftText, rightText;
|
||||||
|
|
||||||
foldingIndent.insert(blockNumber, 1);
|
foldingIndent.insert(blockNumber, 1);
|
||||||
|
|||||||
@@ -520,7 +520,7 @@ void UnifiedDiffEditorWidget::showDiff()
|
|||||||
|
|
||||||
QMap<int, QList<DiffSelection> > selections;
|
QMap<int, QList<DiffSelection> > selections;
|
||||||
|
|
||||||
for (const FileData &fileData : m_controller.m_contextFileData) {
|
for (const FileData &fileData : qAsConst(m_controller.m_contextFileData)) {
|
||||||
const QString leftFileInfo = "--- " + fileData.leftFileInfo.fileName + '\n';
|
const QString leftFileInfo = "--- " + fileData.leftFileInfo.fileName + '\n';
|
||||||
const QString rightFileInfo = "+++ " + fileData.rightFileInfo.fileName + '\n';
|
const QString rightFileInfo = "+++ " + fileData.rightFileInfo.fileName + '\n';
|
||||||
setFileInfo(blockNumber, fileData.leftFileInfo, fileData.rightFileInfo);
|
setFileInfo(blockNumber, fileData.leftFileInfo, fileData.rightFileInfo);
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ void XcodeProbe::setupDefaultToolchains(const QString &devPath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!clangProfile.cCompilerPath.isEmpty() || !clangProfile.cxxCompilerPath.isEmpty()) {
|
if (!clangProfile.cCompilerPath.isEmpty() || !clangProfile.cxxCompilerPath.isEmpty()) {
|
||||||
for (const QString &arch : allArchitectures) {
|
for (const QString &arch : qAsConst(allArchitectures)) {
|
||||||
const QString clangFullName = QString(QLatin1String("Apple Clang (%1)")).arg(arch)
|
const QString clangFullName = QString(QLatin1String("Apple Clang (%1)")).arg(arch)
|
||||||
+ ((devPath != defaultDeveloperPath)
|
+ ((devPath != defaultDeveloperPath)
|
||||||
? QString(QLatin1String(" in %1")).arg(devPath)
|
? QString(QLatin1String(" in %1")).arg(devPath)
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ void updateCodeActionRefactoringMarker(Client *client,
|
|||||||
} else if (optional<WorkspaceEdit::Changes> localChanges = edit.changes()) {
|
} else if (optional<WorkspaceEdit::Changes> localChanges = edit.changes()) {
|
||||||
edits = localChanges.value()[uri];
|
edits = localChanges.value()[uri];
|
||||||
}
|
}
|
||||||
for (const TextEdit &edit : edits) {
|
for (const TextEdit &edit : qAsConst(edits)) {
|
||||||
marker.cursor = endOfLineCursor(edit.range().start().toTextCursor(doc->document()));
|
marker.cursor = endOfLineCursor(edit.range().start().toTextCursor(doc->document()));
|
||||||
markers << marker;
|
markers << marker;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ void McuSupportOptionsWidget::showMcuTargetPackages()
|
|||||||
row.fieldItem->widget()->hide();
|
row.fieldItem->widget()->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto package : m_options.packages) {
|
for (auto package : qAsConst(m_options.packages)) {
|
||||||
QWidget *packageWidget = package->widget();
|
QWidget *packageWidget = package->widget();
|
||||||
if (!mcuTarget->packages().contains(package))
|
if (!mcuTarget->packages().contains(package))
|
||||||
continue;
|
continue;
|
||||||
@@ -275,7 +275,7 @@ void McuSupportOptionsWidget::apply()
|
|||||||
{
|
{
|
||||||
m_options.qtForMCUsSdkPackage->writeGeneralSettings();
|
m_options.qtForMCUsSdkPackage->writeGeneralSettings();
|
||||||
m_options.qtForMCUsSdkPackage->writeToSettings();
|
m_options.qtForMCUsSdkPackage->writeToSettings();
|
||||||
for (auto package : m_options.packages)
|
for (auto package : qAsConst(m_options.packages))
|
||||||
package->writeToSettings();
|
package->writeToSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
{
|
{
|
||||||
auto arr = get<QJsonArray>(js.object(), "projectinfo", "buildsystem_files");
|
auto arr = get<QJsonArray>(js.object(), "projectinfo", "buildsystem_files");
|
||||||
appendFiles(arr, m_files);
|
appendFiles(arr, m_files);
|
||||||
auto subprojects = get<QJsonArray>(js.object(), "projectinfo", "subprojects");
|
const auto subprojects = get<QJsonArray>(js.object(), "projectinfo", "subprojects");
|
||||||
for (const auto &subproject : *subprojects) {
|
for (const auto &subproject : *subprojects) {
|
||||||
auto arr = get<QJsonArray>(subproject.toObject(), "buildsystem_files");
|
auto arr = get<QJsonArray>(subproject.toObject(), "buildsystem_files");
|
||||||
appendFiles(arr, m_files);
|
appendFiles(arr, m_files);
|
||||||
|
|||||||
@@ -43,6 +43,14 @@ namespace Nim {
|
|||||||
|
|
||||||
const char C_NIMBLEPROJECT_TASKS[] = "Nim.NimbleProject.Tasks";
|
const char C_NIMBLEPROJECT_TASKS[] = "Nim.NimbleProject.Tasks";
|
||||||
|
|
||||||
|
static QList<QByteArray> linesFromProcessOutput(QProcess *process)
|
||||||
|
{
|
||||||
|
QList<QByteArray> lines = process->readAllStandardOutput().split('\n');
|
||||||
|
lines = Utils::transform(lines, [](const QByteArray &line){ return line.trimmed(); });
|
||||||
|
Utils::erase(lines, [](const QByteArray &line) { return line.isEmpty(); });
|
||||||
|
return lines;
|
||||||
|
}
|
||||||
|
|
||||||
static std::vector<NimbleTask> parseTasks(const QString &nimblePath, const QString &workingDirectory)
|
static std::vector<NimbleTask> parseTasks(const QString &nimblePath, const QString &workingDirectory)
|
||||||
{
|
{
|
||||||
QProcess process;
|
QProcess process;
|
||||||
@@ -52,9 +60,7 @@ static std::vector<NimbleTask> parseTasks(const QString &nimblePath, const QStri
|
|||||||
|
|
||||||
std::vector<NimbleTask> result;
|
std::vector<NimbleTask> result;
|
||||||
|
|
||||||
QList<QByteArray> lines = process.readAllStandardOutput().split('\n');
|
const QList<QByteArray> &lines = linesFromProcessOutput(&process);
|
||||||
lines = Utils::transform(lines, [](const QByteArray &line){ return line.trimmed(); });
|
|
||||||
Utils::erase(lines, [](const QByteArray &line) { return line.isEmpty(); });
|
|
||||||
|
|
||||||
for (const QByteArray &line : lines) {
|
for (const QByteArray &line : lines) {
|
||||||
QList<QByteArray> tokens = line.trimmed().split(' ');
|
QList<QByteArray> tokens = line.trimmed().split(' ');
|
||||||
@@ -76,9 +82,7 @@ static NimbleMetadata parseMetadata(const QString &nimblePath, const QString &wo
|
|||||||
|
|
||||||
NimbleMetadata result = {};
|
NimbleMetadata result = {};
|
||||||
|
|
||||||
QList<QByteArray> lines = process.readAllStandardOutput().split('\n');
|
const QList<QByteArray> &lines = linesFromProcessOutput(&process);
|
||||||
lines = Utils::transform(lines, [](const QByteArray &line){ return line.trimmed(); });
|
|
||||||
Utils::erase(lines, [](const QByteArray &line) { return line.isEmpty(); });
|
|
||||||
|
|
||||||
for (const QByteArray &line : lines) {
|
for (const QByteArray &line : lines) {
|
||||||
QList<QByteArray> tokens = line.trimmed().split(':');
|
QList<QByteArray> tokens = line.trimmed().split(':');
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ CommandLine NimCompilerBuildStep::commandLine()
|
|||||||
cmd.addArg("--out:" + outFilePath().toString());
|
cmd.addArg("--out:" + outFilePath().toString());
|
||||||
cmd.addArg("--nimCache:" + bc->cacheDirectory().toString());
|
cmd.addArg("--nimCache:" + bc->cacheDirectory().toString());
|
||||||
|
|
||||||
for (const QString &arg : m_userCompilerOptions) {
|
for (const QString &arg : qAsConst(m_userCompilerOptions)) {
|
||||||
if (!arg.isEmpty())
|
if (!arg.isEmpty())
|
||||||
cmd.addArg(arg);
|
cmd.addArg(arg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ void PerfTimelineModelManager::finalize()
|
|||||||
});
|
});
|
||||||
|
|
||||||
QVariantList modelsToAdd;
|
QVariantList modelsToAdd;
|
||||||
for (PerfTimelineModel *model : finished)
|
for (PerfTimelineModel *model : qAsConst(finished))
|
||||||
modelsToAdd.append(QVariant::fromValue(model));
|
modelsToAdd.append(QVariant::fromValue(model));
|
||||||
setModels(modelsToAdd);
|
setModels(modelsToAdd);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ void PythonBuildSystem::triggerParsing()
|
|||||||
if (modelManager) {
|
if (modelManager) {
|
||||||
auto projectInfo = modelManager->defaultProjectInfoForProject(project());
|
auto projectInfo = modelManager->defaultProjectInfoForProject(project());
|
||||||
|
|
||||||
for (const QString &importPath : m_qmlImportPaths) {
|
for (const QString &importPath : qAsConst(m_qmlImportPaths)) {
|
||||||
const Utils::FilePath filePath = Utils::FilePath::fromString(importPath);
|
const Utils::FilePath filePath = Utils::FilePath::fromString(importPath);
|
||||||
projectInfo.importPaths.maybeInsert(filePath, QmlJS::Dialect::Qml);
|
projectInfo.importPaths.maybeInsert(filePath, QmlJS::Dialect::Qml);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ void InterpreterAspect::updateComboBox()
|
|||||||
int defaultIndex = -1;
|
int defaultIndex = -1;
|
||||||
const QString currentId = m_currentId;
|
const QString currentId = m_currentId;
|
||||||
m_comboBox->clear();
|
m_comboBox->clear();
|
||||||
for (const Interpreter &interpreter : m_interpreters) {
|
for (const Interpreter &interpreter : qAsConst(m_interpreters)) {
|
||||||
int index = m_comboBox->count();
|
int index = m_comboBox->count();
|
||||||
m_comboBox->addItem(interpreter.name);
|
m_comboBox->addItem(interpreter.name);
|
||||||
m_comboBox->setItemData(index, interpreter.command.toUserOutput(), Qt::ToolTipRole);
|
m_comboBox->setItemData(index, interpreter.command.toUserOutput(), Qt::ToolTipRole);
|
||||||
|
|||||||
@@ -827,7 +827,7 @@ void QbsBuildStepConfigWidget::applyCachedProperties()
|
|||||||
Constants::QBS_INSTALL_ROOT_KEY});
|
Constants::QBS_INSTALL_ROOT_KEY});
|
||||||
if (m_qbsStep->m_selectedAbis->isManagedByTarget())
|
if (m_qbsStep->m_selectedAbis->isManagedByTarget())
|
||||||
additionalSpecialKeys << Constants::QBS_ARCHITECTURES;
|
additionalSpecialKeys << Constants::QBS_ARCHITECTURES;
|
||||||
for (const QString &key : additionalSpecialKeys) {
|
for (const QString &key : qAsConst(additionalSpecialKeys)) {
|
||||||
const auto it = tmp.constFind(key);
|
const auto it = tmp.constFind(key);
|
||||||
if (it != tmp.cend())
|
if (it != tmp.cend())
|
||||||
data.insert(key, it.value());
|
data.insert(key, it.value());
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ void QbsProfileManager::addProfileFromKit(const ProjectExplorer::Kit *k)
|
|||||||
|
|
||||||
// set up properties:
|
// set up properties:
|
||||||
QVariantMap data = m_defaultPropertyProvider->properties(k, QVariantMap());
|
QVariantMap data = m_defaultPropertyProvider->properties(k, QVariantMap());
|
||||||
for (PropertyProvider *provider : g_propertyProviders) {
|
for (PropertyProvider *provider : qAsConst(g_propertyProviders)) {
|
||||||
if (provider->canHandle(k))
|
if (provider->canHandle(k))
|
||||||
data = provider->properties(k, data);
|
data = provider->properties(k, data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,11 +141,7 @@ ProjectImporter *QbsProject::projectImporter() const
|
|||||||
void QbsProject::configureAsExampleProject(Kit *kit)
|
void QbsProject::configureAsExampleProject(Kit *kit)
|
||||||
{
|
{
|
||||||
QList<BuildInfo> infoList;
|
QList<BuildInfo> infoList;
|
||||||
QList<Kit *> kits;
|
const QList<Kit *> kits(kit != nullptr ? QList<Kit *>({kit}) : KitManager::kits());
|
||||||
if (kit)
|
|
||||||
kits.append(kit);
|
|
||||||
else
|
|
||||||
kits = KitManager::kits();
|
|
||||||
for (Kit *k : kits) {
|
for (Kit *k : kits) {
|
||||||
if (QtSupport::QtKitAspect::qtVersion(k) != nullptr) {
|
if (QtSupport::QtKitAspect::qtVersion(k) != nullptr) {
|
||||||
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ static void createTree(QmakeBuildSystem *buildSystem,
|
|||||||
genFolder->setDisplayName(QCoreApplication::translate("QmakeProjectManager::QmakePriFile",
|
genFolder->setDisplayName(QCoreApplication::translate("QmakeProjectManager::QmakePriFile",
|
||||||
"Generated Files"));
|
"Generated Files"));
|
||||||
genFolder->setIsGenerated(true);
|
genFolder->setIsGenerated(true);
|
||||||
for (const FilePath &fp : generatedFiles) {
|
for (const FilePath &fp : qAsConst(generatedFiles)) {
|
||||||
auto fileNode = std::make_unique<FileNode>(fp, FileNode::fileTypeForFileName(fp));
|
auto fileNode = std::make_unique<FileNode>(fp, FileNode::fileTypeForFileName(fp));
|
||||||
fileNode->setIsGenerated(true);
|
fileNode->setIsGenerated(true);
|
||||||
genFolder->addNestedNode(std::move(fileNode));
|
genFolder->addNestedNode(std::move(fileNode));
|
||||||
|
|||||||
@@ -1214,7 +1214,7 @@ QString QmakeProFile::displayName() const
|
|||||||
QList<QmakeProFile *> QmakeProFile::allProFiles()
|
QList<QmakeProFile *> QmakeProFile::allProFiles()
|
||||||
{
|
{
|
||||||
QList<QmakeProFile *> result = { this };
|
QList<QmakeProFile *> result = { this };
|
||||||
for (QmakePriFile *c : m_children) {
|
for (QmakePriFile *c : qAsConst(m_children)) {
|
||||||
auto proC = dynamic_cast<QmakeProFile *>(c);
|
auto proC = dynamic_cast<QmakeProFile *>(c);
|
||||||
if (proC)
|
if (proC)
|
||||||
result.append(proC->allProFiles());
|
result.append(proC->allProFiles());
|
||||||
@@ -1591,7 +1591,7 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input)
|
|||||||
toCompare.pop_front();
|
toCompare.pop_front();
|
||||||
|
|
||||||
// Loop prevention: Make sure that exact same node is not in our parent chain
|
// Loop prevention: Make sure that exact same node is not in our parent chain
|
||||||
for (QmakeIncludedPriFile *priFile : tree->children) {
|
for (QmakeIncludedPriFile *priFile : qAsConst(tree->children)) {
|
||||||
bool loop = input.parentFilePaths.contains(priFile->name);
|
bool loop = input.parentFilePaths.contains(priFile->name);
|
||||||
for (const QmakePriFile *n = pn; n && !loop; n = n->parent()) {
|
for (const QmakePriFile *n = pn; n && !loop; n = n->parent()) {
|
||||||
if (n->filePath() == priFile->name)
|
if (n->filePath() == priFile->name)
|
||||||
|
|||||||
@@ -1081,11 +1081,7 @@ void CentralizedFolderWatcher::delayedFolderChanged(const QString &folder)
|
|||||||
void QmakeProject::configureAsExampleProject(Kit *kit)
|
void QmakeProject::configureAsExampleProject(Kit *kit)
|
||||||
{
|
{
|
||||||
QList<BuildInfo> infoList;
|
QList<BuildInfo> infoList;
|
||||||
QList<Kit *> kits;
|
const QList<Kit *> kits(kit != nullptr ? QList<Kit *>({kit}) : KitManager::kits());
|
||||||
if (kit)
|
|
||||||
kits.append(kit);
|
|
||||||
else
|
|
||||||
kits = KitManager::kits();
|
|
||||||
for (Kit *k : kits) {
|
for (Kit *k : kits) {
|
||||||
if (QtSupport::QtKitAspect::qtVersion(k) != nullptr) {
|
if (QtSupport::QtKitAspect::qtVersion(k) != nullptr) {
|
||||||
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ void QmlDebugTranslationWidget::runTest()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
for (auto filePath : m_selectedFilePaths) {
|
for (auto filePath : qAsConst(m_selectedFilePaths)) {
|
||||||
testLanguages(timerCounter++, filePath.toString());
|
testLanguages(timerCounter++, filePath.toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ void FlameGraphModel::loadEvent(const QmlEvent &event, const QmlEventType &type)
|
|||||||
|
|
||||||
void FlameGraphModel::finalize()
|
void FlameGraphModel::finalize()
|
||||||
{
|
{
|
||||||
for (FlameGraphData *child : m_stackBottom.children)
|
for (FlameGraphData *child : qAsConst(m_stackBottom.children))
|
||||||
m_stackBottom.duration += child->duration;
|
m_stackBottom.duration += child->duration;
|
||||||
|
|
||||||
loadNotes(-1, false);
|
loadNotes(-1, false);
|
||||||
|
|||||||
@@ -405,7 +405,7 @@ QmlProfilerModelManager::rangeFilter(qint64 rangeStart, qint64 rangeEnd) const
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!crossedRangeStart) {
|
if (!crossedRangeStart) {
|
||||||
for (auto stashed : stack) {
|
for (auto stashed : qAsConst(stack)) {
|
||||||
stashed.setTimestamp(rangeStart);
|
stashed.setTimestamp(rangeStart);
|
||||||
loader(stashed, eventType(stashed.typeIndex()));
|
loader(stashed, eventType(stashed.typeIndex()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ QString QnxQtVersion::qnxHost() const
|
|||||||
if (!m_environmentUpToDate)
|
if (!m_environmentUpToDate)
|
||||||
updateEnvironment();
|
updateEnvironment();
|
||||||
|
|
||||||
for (const EnvironmentItem &item : m_qnxEnv) {
|
for (const EnvironmentItem &item : qAsConst(m_qnxEnv)) {
|
||||||
if (item.name == QLatin1String(QNX_HOST_KEY))
|
if (item.name == QLatin1String(QNX_HOST_KEY))
|
||||||
return item.value;
|
return item.value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2351,7 +2351,7 @@ BaseQtVersion *QtVersionFactory::create() const
|
|||||||
|
|
||||||
BaseQtVersion *BaseQtVersion::clone() const
|
BaseQtVersion *BaseQtVersion::clone() const
|
||||||
{
|
{
|
||||||
for (QtVersionFactory *factory : g_qtVersionFactories) {
|
for (QtVersionFactory *factory : qAsConst(g_qtVersionFactories)) {
|
||||||
if (factory->m_supportedType == d->m_type) {
|
if (factory->m_supportedType == d->m_type) {
|
||||||
BaseQtVersion *version = factory->create();
|
BaseQtVersion *version = factory->create();
|
||||||
QTC_ASSERT(version, return nullptr);
|
QTC_ASSERT(version, return nullptr);
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ void GenericDirectUploadService::uploadFiles()
|
|||||||
}
|
}
|
||||||
emit progressMessage(tr("%n file(s) need to be uploaded.", "", d->filesToUpload.size()));
|
emit progressMessage(tr("%n file(s) need to be uploaded.", "", d->filesToUpload.size()));
|
||||||
FilesToTransfer filesToTransfer;
|
FilesToTransfer filesToTransfer;
|
||||||
for (const DeployableFile &f : d->filesToUpload) {
|
for (const DeployableFile &f : qAsConst(d->filesToUpload)) {
|
||||||
if (!f.localFilePath().exists()) {
|
if (!f.localFilePath().exists()) {
|
||||||
const QString message = tr("Local file \"%1\" does not exist.")
|
const QString message = tr("Local file \"%1\" does not exist.")
|
||||||
.arg(f.localFilePath().toUserOutput());
|
.arg(f.localFilePath().toUserOutput());
|
||||||
@@ -340,7 +340,7 @@ void GenericDirectUploadService::chmod()
|
|||||||
QTC_ASSERT(d->state == PostProcessing, return);
|
QTC_ASSERT(d->state == PostProcessing, return);
|
||||||
if (!Utils::HostOsInfo::isWindowsHost())
|
if (!Utils::HostOsInfo::isWindowsHost())
|
||||||
return;
|
return;
|
||||||
for (const DeployableFile &f : d->filesToUpload) {
|
for (const DeployableFile &f : qAsConst(d->filesToUpload)) {
|
||||||
if (!f.isExecutable())
|
if (!f.isExecutable())
|
||||||
continue;
|
continue;
|
||||||
const QString command = QLatin1String("chmod a+x ")
|
const QString command = QLatin1String("chmod a+x ")
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ void RsyncDeployService::filterDeployableFiles() const
|
|||||||
void RsyncDeployService::createRemoteDirectories()
|
void RsyncDeployService::createRemoteDirectories()
|
||||||
{
|
{
|
||||||
QStringList remoteDirs;
|
QStringList remoteDirs;
|
||||||
for (const DeployableFile &f : m_deployableFiles)
|
for (const DeployableFile &f : qAsConst(m_deployableFiles))
|
||||||
remoteDirs << f.remoteDirectory();
|
remoteDirs << f.remoteDirectory();
|
||||||
remoteDirs.sort();
|
remoteDirs.sort();
|
||||||
remoteDirs.removeDuplicates();
|
remoteDirs.removeDuplicates();
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ QString ResourceFile::absolutePath(const QString &rel_path) const
|
|||||||
|
|
||||||
void ResourceFile::orderList()
|
void ResourceFile::orderList()
|
||||||
{
|
{
|
||||||
for (Prefix *p : m_prefix_list) {
|
for (Prefix *p : qAsConst(m_prefix_list)) {
|
||||||
std::sort(p->file_list.begin(), p->file_list.end(), [&](File *f1, File *f2) {
|
std::sort(p->file_list.begin(), p->file_list.end(), [&](File *f1, File *f2) {
|
||||||
return *f1 < *f2;
|
return *f1 < *f2;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ void ResourceEditorPlugin::extensionsInitialized()
|
|||||||
toReplace.append(fn);
|
toReplace.append(fn);
|
||||||
});
|
});
|
||||||
|
|
||||||
for (FileNode *file : toReplace) {
|
for (FileNode *file : qAsConst(toReplace)) {
|
||||||
FolderNode *const pn = file->parentFolderNode();
|
FolderNode *const pn = file->parentFolderNode();
|
||||||
QTC_ASSERT(pn, continue);
|
QTC_ASSERT(pn, continue);
|
||||||
const Utils::FilePath path = file->filePath();
|
const Utils::FilePath path = file->filePath();
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ bool ScxmlDocument::generateSCXML(QIODevice *io, ScxmlTag *tag) const
|
|||||||
ScxmlTag *ScxmlDocument::createScxmlTag()
|
ScxmlTag *ScxmlDocument::createScxmlTag()
|
||||||
{
|
{
|
||||||
auto tag = new ScxmlTag(Scxml, this);
|
auto tag = new ScxmlTag(Scxml, this);
|
||||||
for (ScxmlNamespace *ns : m_namespaces) {
|
for (ScxmlNamespace *ns : qAsConst(m_namespaces)) {
|
||||||
QString prefix = ns->prefix();
|
QString prefix = ns->prefix();
|
||||||
if (prefix.isEmpty())
|
if (prefix.isEmpty())
|
||||||
prefix = "xmlns";
|
prefix = "xmlns";
|
||||||
|
|||||||
@@ -112,11 +112,11 @@ void runSilverSeacher(FutureInterfaceType &fi, FileFindParameters parameters)
|
|||||||
if (!(parameters.flags & FindRegularExpression))
|
if (!(parameters.flags & FindRegularExpression))
|
||||||
arguments << "-Q";
|
arguments << "-Q";
|
||||||
|
|
||||||
for (const QString &filter : parameters.exclusionFilters)
|
for (const QString &filter : qAsConst(parameters.exclusionFilters))
|
||||||
arguments << "--ignore" << filter;
|
arguments << "--ignore" << filter;
|
||||||
|
|
||||||
QString nameFiltersAsRegex;
|
QString nameFiltersAsRegex;
|
||||||
for (const QString &filter : parameters.nameFilters)
|
for (const QString &filter : qAsConst(parameters.nameFilters))
|
||||||
nameFiltersAsRegex += QString("(%1)|").arg(convertWildcardToRegex(filter));
|
nameFiltersAsRegex += QString("(%1)|").arg(convertWildcardToRegex(filter));
|
||||||
nameFiltersAsRegex.remove(nameFiltersAsRegex.length() - 1, 1);
|
nameFiltersAsRegex.remove(nameFiltersAsRegex.length() - 1, 1);
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ QString SnippetProvider::displayName() const
|
|||||||
*/
|
*/
|
||||||
void SnippetProvider::decorateEditor(TextEditorWidget *editor, const QString &groupId)
|
void SnippetProvider::decorateEditor(TextEditorWidget *editor, const QString &groupId)
|
||||||
{
|
{
|
||||||
for (const SnippetProvider &provider : g_snippetProviders) {
|
for (const SnippetProvider &provider : qAsConst(g_snippetProviders)) {
|
||||||
if (provider.m_groupId == groupId && provider.m_editorDecorator)
|
if (provider.m_groupId == groupId && provider.m_editorDecorator)
|
||||||
provider.m_editorDecorator(editor);
|
provider.m_editorDecorator(editor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1199,7 +1199,7 @@ HeobDialog::HeobDialog(QWidget *parent) :
|
|||||||
|
|
||||||
auto profilesLayout = new QHBoxLayout;
|
auto profilesLayout = new QHBoxLayout;
|
||||||
m_profilesCombo = new QComboBox;
|
m_profilesCombo = new QComboBox;
|
||||||
for (const auto &profile : m_profiles)
|
for (const auto &profile : qAsConst(m_profiles))
|
||||||
m_profilesCombo->addItem(settings->value(profile + "/" + heobProfileNameC).toString());
|
m_profilesCombo->addItem(settings->value(profile + "/" + heobProfileNameC).toString());
|
||||||
if (hasSelProfile) {
|
if (hasSelProfile) {
|
||||||
int selIdx = m_profiles.indexOf(selProfile);
|
int selIdx = m_profiles.indexOf(selProfile);
|
||||||
|
|||||||
@@ -438,7 +438,7 @@ void WelcomeMode::addPage(IWelcomePage *page)
|
|||||||
auto onClicked = [this, pageId, stackPage] {
|
auto onClicked = [this, pageId, stackPage] {
|
||||||
m_activePage = pageId;
|
m_activePage = pageId;
|
||||||
m_pageStack->setCurrentWidget(stackPage);
|
m_pageStack->setCurrentWidget(stackPage);
|
||||||
for (WelcomePageButton *pageButton : m_pageButtons)
|
for (WelcomePageButton *pageButton : qAsConst(m_pageButtons))
|
||||||
pageButton->recheckActive();
|
pageButton->recheckActive();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user