forked from qt-creator/qt-creator
ClangTools: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464 Change-Id: I1c4711d87e5f95fc1653dd9aa6448b105d017435 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -615,7 +615,7 @@ private:
|
||||
const QStringList suffixes = mimeType.suffixes();
|
||||
|
||||
QList<AssistProposalItemInterface *> completions;
|
||||
foreach (const ProjectExplorer::HeaderPath &headerPath, allHeaderPaths) {
|
||||
for (const ProjectExplorer::HeaderPath &headerPath : qAsConst(allHeaderPaths)) {
|
||||
QString realPath = headerPath.path;
|
||||
if (!directoryPrefix.isEmpty()) {
|
||||
realPath += QLatin1Char('/');
|
||||
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
// For debugging, add: style='border-width:1px;border-color:black'
|
||||
QString text = "<table cellspacing='0' cellpadding='0' width='100%'>";
|
||||
|
||||
foreach (const ClangDiagnostic &diagnostic, diagnostics)
|
||||
for (const ClangDiagnostic &diagnostic : diagnostics)
|
||||
text.append(tableRows(diagnostic));
|
||||
if (!source.isEmpty()) {
|
||||
text.append(QString::fromUtf8("<tr><td colspan='2' align='left'>"
|
||||
|
||||
@@ -613,7 +613,7 @@ void ClangModelManagerSupport::onAbstractEditorSupportRemoved(const QString &fil
|
||||
|
||||
void addFixItsActionsToMenu(QMenu *menu, const TextEditor::QuickFixOperations &fixItOperations)
|
||||
{
|
||||
foreach (const auto &fixItOperation, fixItOperations) {
|
||||
for (const TextEditor::QuickFixOperation::Ptr &fixItOperation : fixItOperations) {
|
||||
QAction *action = menu->addAction(fixItOperation->description());
|
||||
QObject::connect(action, &QAction::triggered, [fixItOperation]() {
|
||||
fixItOperation->perform();
|
||||
@@ -654,7 +654,7 @@ using ClangEditorDocumentProcessors = QVector<ClangEditorDocumentProcessor *>;
|
||||
static ClangEditorDocumentProcessors clangProcessors()
|
||||
{
|
||||
ClangEditorDocumentProcessors result;
|
||||
foreach (auto *editorDocument, cppModelManager()->cppEditorDocuments())
|
||||
for (const CppEditorDocumentHandle *editorDocument : cppModelManager()->cppEditorDocuments())
|
||||
result.append(qobject_cast<ClangEditorDocumentProcessor *>(editorDocument->processor()));
|
||||
|
||||
return result;
|
||||
@@ -729,8 +729,8 @@ clangProcessorsWithProjectParts(const QStringList &projectPartIds)
|
||||
|
||||
void ClangModelManagerSupport::reinitializeBackendDocuments(const QStringList &projectPartIds)
|
||||
{
|
||||
const auto processors = clangProcessorsWithProjectParts(projectPartIds);
|
||||
foreach (ClangEditorDocumentProcessor *processor, processors) {
|
||||
const ClangEditorDocumentProcessors processors = clangProcessorsWithProjectParts(projectPartIds);
|
||||
for (ClangEditorDocumentProcessor *processor : processors) {
|
||||
processor->clearProjectPart();
|
||||
processor->run();
|
||||
}
|
||||
|
||||
@@ -732,7 +732,7 @@ bool runClangBatchFile(const QString &filePath)
|
||||
QTC_CHECK(Core::EditorManager::closeAllEditors(/*askAboutModifiedEditors=*/ false));
|
||||
});
|
||||
|
||||
foreach (const Command::Ptr &command, commands) {
|
||||
for (const Command::Ptr &command : commands) {
|
||||
const bool runSucceeded = command->run();
|
||||
QCoreApplication::processEvents(); // Update GUI
|
||||
|
||||
|
||||
Reference in New Issue
Block a user