Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Use only const containers in range-loops

Powered by (kdev)clazy
parent 5a96f159
......@@ -64,6 +64,7 @@
#include <interfaces/launchconfigurationtype.h>
#include <util/path.h>
#include <debug.h>
#include <qtcompat_p.h>
#include "kdevideextension.h"
#if KDEVELOP_SINGLE_APP
......@@ -805,7 +806,7 @@ int main( int argc, char *argv[] )
} else {
openFiles(initialFiles);
for(const auto &urlinfo: initialDirectories)
for(const auto& urlinfo: qAsConst(initialDirectories))
core->projectController()->openProjectForUrl(urlinfo.url);
}
......
......@@ -123,7 +123,7 @@ void populateMenuWithGroup(
}
}
for (QAction* action : groupActions) {
for (QAction* action : qAsConst(groupActions)) {
groupMenu->addAction(action);
}
......
......@@ -29,6 +29,8 @@ Boston, MA 02110-1301, USA.
#include <editor/documentrange.h>
#include <interfaces/iassistant.h>
#include <qtcompat_p.h>
#include <KLocalizedString>
namespace KDevelop {
......@@ -122,7 +124,7 @@ QVector<IProblem::Ptr> Problem::diagnostics() const
{
QVector<IProblem::Ptr> vector;
for (ProblemPointer ptr : m_diagnostics) {
for (const auto& ptr : qAsConst(m_diagnostics)) {
vector.push_back(ptr);
}
......
......@@ -32,6 +32,7 @@
#include <tests/testplugincontroller.h>
#include <util/path.h>
#include <qtcompat_p.h>
#include <KJob>
#include <KDirWatch>
......@@ -174,7 +175,7 @@ int main(int argc, char** argv)
}
runTimer.start();
for (auto benchmark : benchmarks) {
for (auto benchmark : qAsConst(benchmarks)) {
benchmark->start();
}
......
......@@ -194,8 +194,8 @@ QList<KTextEditor::MainWindow *> Application::mainWindows() const
bool Application::closeDocument(KTextEditor::Document *document) const
{
auto documentController = Core::self()->documentControllerInternal();
for (auto doc : documentController->openDocuments()) {
const auto& openDocuments = Core::self()->documentControllerInternal()->openDocuments();
for (auto doc : openDocuments) {
if (doc->textDocument() == document) {
return doc->close();
}
......
......@@ -24,6 +24,7 @@
#include <QMutexLocker>
#include <QThread>
#include <qtcompat_p.h>
#include <interfaces/idocument.h>
#include <interfaces/idocumentcontroller.h>
#include <interfaces/iplugin.h>
......@@ -223,7 +224,7 @@ ILanguageSupport* LanguageController::language(const QString &name) const
constraints.insert(key, name);
supports = Core::self()->pluginController()->allPluginsForExtension(KEY_ILanguageSupport(), constraints);
if (key == keys[1]) {
for (auto support : supports) {
for (auto support : qAsConst(supports)) {
qCWarning(SHELL) << "Plugin" << Core::self()->pluginController()->pluginInfo(support).name() << " has deprecated (since 5.1) metadata key \"X-KDevelop-Language\", needs porting to: \"X-KDevelop-Languages\": ["<<name<<"]'";
}
}
......
......@@ -78,7 +78,8 @@ void TemplatePage::loadFromFile()
return;
}
for (const auto& file : fileDialog->selectedFiles()) {
const auto& selectedFiles = fileDialog->selectedFiles();
for (const auto& file : selectedFiles) {
m_provider->loadTemplate(file);
}
......
......@@ -31,6 +31,7 @@
#include <util/scopeddialog.h>
#include <language/interfaces/ilanguagesupport.h>
#include <interfaces/ilanguagecontroller.h>// TODO: remove later
#include <qtcompat_p.h>
#include <KMessageBox>
#include <KTextEditor/Editor>
......@@ -118,7 +119,8 @@ SourceFormatterSelectionEdit::SourceFormatterSelectionEdit(QWidget* parent)
this, &SourceFormatterSelectionEdit::addSourceFormatter);
connect(controller, &SourceFormatterController::formatterUnloading,
this, &SourceFormatterSelectionEdit::removeSourceFormatter);
for (auto* formatter : controller->formatters()) {
const auto& formatters = controller->formatters();
for (auto* formatter : formatters) {
addSourceFormatter(formatter);
}
}
......@@ -318,7 +320,7 @@ void SourceFormatterSelectionEdit::saveSettings(KConfigGroup& config)
globalConfig.sync();
// store selected formatters in given language
for (const auto& setting : d->languages) {
for (const auto& setting : qAsConst(d->languages)) {
for(const auto& mime : setting.mimetypes) {
const QString formatterId = setting.selectedFormatter->formatter->name() + QLatin1String("||") + setting.selectedStyle->name();
config.writeEntry(mime.name(), formatterId);
......
......@@ -286,7 +286,8 @@ QString AppWizardPlugin::createProject(const ApplicationInfo& info)
// but could be different name, if e.g. downloaded, so make a guess
if (!templateEntry || !templateEntry->isFile()) {
for (const auto& entryName : arch->directory()->entries()) {
const auto& entries = arch->directory()->entries();
for (const auto& entryName : entries) {
if (entryName.endsWith(QLatin1String(".kdevtemplate"))) {
templateEntry = arch->directory()->entry(entryName);
break;
......
......@@ -310,7 +310,8 @@ void ProjectSelectionPage::loadFileClicked()
return;
}
for (const auto& fileName : fileDialog->selectedFiles()) {
const auto& fileNames = fileDialog->selectedFiles();
for (const auto& fileName : fileNames) {
QString destination = m_templatesModel->loadTemplateFile(fileName);
QModelIndexList indexes = m_templatesModel->templateIndexes(destination);
if (indexes.size() > 2)
......
......@@ -121,7 +121,8 @@ ProjectFileItem* findProjectFileItem(const IndexedString& url, bool* hasBuildSys
ProjectFileItem* file = nullptr;
*hasBuildSystemInfo = false;
for (auto project: ICore::self()->projectController()->projects()) {
const auto& projects = ICore::self()->projectController()->projects();
for (auto project : projects) {
auto files = project->filesForPath(url);
if (files.isEmpty()) {
continue;
......
......@@ -201,7 +201,8 @@ ClangSupport::ClangSupport(QObject* parent, const QVariantList& )
this, &ClangSupport::disableKeywordCompletion);
connect(model, &CodeCompletion::unregisteredFromView,
this, &ClangSupport::enableKeywordCompletion);
for(const auto& type : DocumentFinderHelpers::mimeTypesList()){
const auto& mimeTypes = DocumentFinderHelpers::mimeTypesList();
for (const auto& type : mimeTypes) {
KDevelop::IBuddyDocumentFinder::addFinder(type, this);
}
......@@ -219,7 +220,8 @@ ClangSupport::~ClangSupport()
// By locking the parse-mutexes, we make sure that parse jobs get a chance to finish in a good state
parseLock()->unlock();
for(const auto& type : DocumentFinderHelpers::mimeTypesList()) {
const auto& mimeTypes = DocumentFinderHelpers::mimeTypesList();
for (const auto& type : mimeTypes) {
KDevelop::IBuddyDocumentFinder::removeFinder(type);
}
......
......@@ -44,6 +44,7 @@
#include <language/codecompletion/codecompletionmodel.h>
#include <language/codecompletion/normaldeclarationcompletionitem.h>
#include <util/foregroundlock.h>
#include <qtcompat_p.h>
#include "../util/clangdebug.h"
#include "../util/clangtypes.h"
......@@ -670,7 +671,7 @@ public:
QList<CompletionTreeItemPointer> matchedItems()
{
QList<CompletionTreeItemPointer> lookAheadItems;
for (const auto& pair: possibleLookAheadDeclarations) {
for (const auto& pair: qAsConst(possibleLookAheadDeclarations)) {
auto decl = pair.first;
if (matchedTypes.contains(decl->indexedType())) {
auto parent = pair.second;
......@@ -700,7 +701,8 @@ private:
return;
}
for (auto localDecl : typeDecl->internalContext()->localDeclarations()) {
const auto& localDeclarations = typeDecl->internalContext()->localDeclarations();
for (auto localDecl : localDeclarations) {
if(localDecl->identifier().isEmpty()){
continue;
}
......@@ -831,7 +833,7 @@ ClangCodeCompletionContext::ClangCodeCompletionContext(const DUContextPointer& c
unsaved.Length = content.size();
allUnsaved.reserve(otherUnsavedFiles.size() + 1);
for ( const auto& f : otherUnsavedFiles ) {
for (const auto& f : qAsConst(otherUnsavedFiles)) {
allUnsaved.append(f.toClangApi());
}
allUnsaved.append(unsaved);
......
......@@ -26,6 +26,7 @@
#include "duchain/clanghelpers.h"
#include <language/codecompletion/abstractincludefilecompletionitem.h>
#include <qtcompat_p.h>
#include <QDirIterator>
......@@ -163,7 +164,7 @@ QVector<KDevelop::IncludeItem> includeItemsForUrl(const QUrl& url, const Include
QSet<QString> foundIncludePaths; // found items
int pathNumber = 0;
for (auto searchPath : paths) {
for (auto searchPath : qAsConst(paths)) {
if (handledPaths.contains(searchPath)) {
continue;
}
......@@ -283,7 +284,7 @@ QList< CompletionTreeItemPointer > IncludePathCompletionContext::completionItems
{
QList<CompletionTreeItemPointer> items;
for (const auto& includeItem: m_includeItems) {
for (const auto& includeItem: qAsConst(m_includeItems)) {
if (abort) {
return items;
}
......
......@@ -283,7 +283,8 @@ QVariantHash ClangTemplateNewClass::extraVariables() const
}
const Path sourcePath(sourceUrl);
for (const auto& baseClass : directBaseClasses()) {
const auto& directBaseClasses = this->directBaseClasses();
for (const auto& baseClass : directBaseClasses) {
if (!baseClass) {
continue;
}
......
......@@ -28,6 +28,7 @@
#include <language/duchain/duchainlock.h>
#include <language/codegen/documentchangeset.h>
#include <qtcompat_p.h>
#include <KLocalizedString>
......@@ -185,7 +186,8 @@ ClangFixits ClangProblem::allFixits() const
ClangFixits result;
result << m_fixits;
for (const IProblem::Ptr& diagnostic : diagnostics()) {
const auto& diagnostics = this->diagnostics();
for (const IProblem::Ptr& diagnostic : diagnostics) {
const Ptr problem(dynamic_cast<ClangProblem*>(diagnostic.data()));
Q_ASSERT(problem);
result << problem->allFixits();
......@@ -214,7 +216,7 @@ void ClangFixitAssistant::createActions()
{
KDevelop::IAssistant::createActions();
for (const ClangFixit& fixit : m_fixits) {
for (const ClangFixit& fixit : qAsConst(m_fixits)) {
addAction(IAssistantAction::Ptr(new ClangFixitAction(fixit)));
}
}
......
......@@ -44,7 +44,8 @@ public:
modifyHtml() += QStringLiteral("< ").toHtmlEscaped();
bool first = true;
for (const auto& type : cst->templateParameters()) {
const auto& templateParameters = cst->templateParameters();
for (const auto& type : templateParameters) {
if (first) {
first = false;
} else {
......
......@@ -107,7 +107,8 @@ QString ClassSpecializationType::toString() const
if (!id.isEmpty()) {
QString result = AbstractType::toString() + strippedQid(id) + QLatin1String("< ");
bool first = true;
for (const auto& param : templateParameters()) {
const auto& templateParameters = this->templateParameters();
for (const auto& param : templateParameters) {
if (first) {
first = false;
} else {
......
......@@ -95,7 +95,8 @@ QStringList scanIncludePaths( const QString& identifier, const QDir& dir, int ma
}
const QStringList nameFilters = {identifier, identifier + QLatin1String(".*")};
for (const auto& file : dir.entryList(nameFilters, QDir::Files)) {
const auto& files = dir.entryList(nameFilters, QDir::Files);
for (const auto& file : files) {
if (identifier.compare(file, Qt::CaseInsensitive) == 0 || ClangHelpers::isHeader(file)) {
const QString filePath = path + QLatin1Char('/') + file;
clangDebug() << "Found candidate file" << filePath;
......@@ -104,8 +105,10 @@ QStringList scanIncludePaths( const QString& identifier, const QDir& dir, int ma
}
maxDepth--;
for( const auto& subdir : dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot ) )
const auto& subdirs = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
for (const auto& subdir : subdirs) {
candidates += scanIncludePaths( identifier, QDir{ path + QLatin1Char('/') + subdir }, maxDepth );
}
return candidates;
}
......@@ -170,7 +173,8 @@ KDevelop::DocumentRange includeDirectivePosition(const KDevelop::Path& source, c
// look at existing #include statements and re-use them
int currentMatchQuality = -1;
for( const auto& import : top->importedParentContexts() ) {
const auto& importedParentContexts = top->importedParentContexts();
for (const auto& import : importedParentContexts) {
const auto importFilename = import.context(top)->url().str();
const int matchQuality = sharedPathLevel( importFilename , includeFile );
......@@ -211,7 +215,8 @@ KDevelop::DocumentRange forwardDeclarationPosition(const QualifiedIdentifier& id
}
int line = std::numeric_limits< int >::max();
for( const auto decl : top->localDeclarations() ) {
const auto& localDeclarations = top->localDeclarations();
for (const auto decl : localDeclarations) {
line = std::min( line, decl->range().start.line );
}
......@@ -302,7 +307,8 @@ QStringList UnknownDeclarationProblem::findMatchingIncludeFiles(const QVector<De
clangDebug() << "Adding" << filepath << "determined from candidate" << decl->toString();
}
for( const auto importer : file->importers() ) {
const auto& importers = file->importers();
for (const auto& importer : importers) {
if( importer->imports().count() != 1 && !isBlacklisted( filepath ) ) {
continue;
}
......@@ -491,7 +497,8 @@ ClangFixits fixUnknownDeclaration( const QualifiedIdentifier& identifier, const
const auto matchingDeclarations = findMatchingDeclarations(possibleIdentifiers);
if (ClangSettingsManager::self()->assistantsSettings().forwardDeclare) {
for (const auto& fixit : forwardDeclarations(matchingDeclarations, file)) {
const auto& forwardDeclareFixits = forwardDeclarations(matchingDeclarations, file);
for (const auto& fixit : forwardDeclareFixits) {
fixits << fixit;
if (fixits.size() == maxSuggestions) {
return fixits;
......
......@@ -2079,7 +2079,8 @@ void TestDUChain::testHasInclude()
QVERIFY(headerCtx);
dumper.dump(headerCtx);
QVERIFY(headerCtx->problems().count() <= 1);
for (const auto& problem : headerCtx->problems()) {
const auto& headerProblems = headerCtx->problems();
for (const auto& problem : headerProblems) {
// ignore the following error: "#include_next with absolute path [-Winclude-next-absolute-path]" "" [ (2, 12) -> (2, 30) ]
QVERIFY(problem->description().contains(QLatin1String("-Winclude-next-absolute-path")));
}
......
......@@ -977,7 +977,8 @@ ConfigPage* CMakeManager::perProjectConfigPage(int number, const ProjectConfigOp
void CMakeManager::reloadProjects()
{
for(IProject* project: m_projects.keys()) {
const auto& projects = m_projects.keys();
for (IProject* project : projects) {
CMake::checkForNeedingConfigure(project);
reload(project->projectItem());
}
......
......@@ -54,8 +54,8 @@ void CTestFindJob::findTestCases()
}
m_pendingFiles.clear();
for (const auto& file : m_suite->sourceFiles())
{
const auto& sourceFiles = m_suite->sourceFiles();
for (const auto& file : sourceFiles) {
if (!file.isEmpty())
{
m_pendingFiles << file;
......
......@@ -76,17 +76,20 @@ void selectUse(ContextBrowserView* view, Direction direction)
}
OneUseWidget* first = nullptr, *previous = nullptr, *current = nullptr;
for (auto item : usesWidget->items()) {
const auto& usesWidgetItems = usesWidget->items();
for (auto item : usesWidgetItems) {
auto topContext = dynamic_cast<TopContextUsesWidget*>(item);
if (!topContext) {
continue;
}
for (auto item : topContext->items()) {
const auto& topContextItems = topContext->items();
for (auto item : topContextItems) {
auto navigationList = dynamic_cast<NavigatableWidgetList*>(item);
if (!navigationList) {
continue;
}
for (auto item : navigationList->items()) {
const auto& navigationListItems = navigationList->items();
for (auto item : navigationListItems) {
auto use = dynamic_cast<OneUseWidget*>(item);
if (!use) {
continue;
......
......@@ -28,6 +28,7 @@
#include <interfaces/iproject.h>
#include <language/editor/documentrange.h>
#include <shell/problemmodelset.h>
#include <qtcompat_p.h>
#include <klocalizedstring.h>
......@@ -77,14 +78,15 @@ void ProblemModel::fixProblemFinalLocation(KDevelop::IProblem::Ptr problem)
problem->setFinalLocation(range);
}
for (auto diagnostic : problem->diagnostics()) {
const auto& diagnostics = problem->diagnostics();
for (auto& diagnostic : diagnostics) {
fixProblemFinalLocation(diagnostic);
}
}
bool ProblemModel::problemExists(KDevelop::IProblem::Ptr newProblem)
{
for (auto problem : m_problems) {
for (auto problem : qAsConst(m_problems)) {
if (newProblem->source() == problem->source() &&
newProblem->severity() == problem->severity() &&
newProblem->finalLocation() == problem->finalLocation() &&
......
......@@ -96,8 +96,10 @@ void TestCustomBuildSystemPlugin::loadMultiPathProject()
IProject* project = ICore::self()->projectController()->findProjectByName( QStringLiteral("MultiPathProject") );
QVERIFY( project );
KDevelop::ProjectBaseItem* mainfile = nullptr;
for (const auto& file: project->fileSet() ) {
for (auto i: project->filesForPath(file)) {
const auto& files = project->fileSet();
for (const auto& file : files) {
const auto& filesForPath = project->filesForPath(file);
for (auto i: filesForPath) {
if( i->text() == QLatin1String("main.cpp") ) {
mainfile = i;
break;
......
......@@ -245,7 +245,7 @@ bool CompilerProvider::registerCompiler(const CompilerPointer& compiler)
return false;
}
for(auto c: m_compilers){
for (auto& c : qAsConst(m_compilers)) {
if (c->name() == compiler->name()) {
return false;
}
......@@ -275,8 +275,8 @@ QVector< CompilerFactoryPointer > CompilerProvider::compilerFactories() const
void CompilerProvider::retrieveUserDefinedCompilers()
{
auto compilers = m_settings->userDefinedCompilers();
for (auto c : compilers) {
const auto compilers = m_settings->userDefinedCompilers();
for (auto& c : compilers) {
registerCompiler(c);
}
}
......@@ -30,6 +30,7 @@
#include <KConfig>
#include <KConfigGroup>
#include <qtcompat_p.h>
#include <interfaces/iproject.h>
#include <interfaces/icore.h>
#include <project/projectmodel.h>
......@@ -118,7 +119,8 @@ CompilerPointer createCompilerFromConfig(KConfigGroup& cfg)
return SettingsManager::globalInstance()->provider()->defaultCompiler();
}
for (auto c : SettingsManager::globalInstance()->provider()->compilers()) {
const auto& compilers = SettingsManager::globalInstance()->provider()->compilers();
for (auto& c : compilers) {
if (c->name() == name) {
return c;
}
......@@ -170,7 +172,8 @@ void doWriteSettings( KConfigGroup grp, const QVector<ConfigEntry>& paths )
QVector<ConfigEntry> doReadSettings( KConfigGroup grp, bool remove = false )
{
QVector<ConfigEntry> paths;
for( const QString &grpName : sorted(grp.groupList()) ) {
const auto& sortedGroupNames = sorted(grp.groupList());
for (const QString& grpName : sortedGroupNames) {
if ( !grpName.startsWith( ConfigConstants::projectPathPrefix ) ) {
continue;
}
......@@ -381,8 +384,8 @@ QVector< CompilerPointer > SettingsManager::userDefinedCompilers() const
auto path = grp.readEntry(ConfigConstants::compilerPathKey, QString());
auto type = grp.readEntry(ConfigConstants::compilerTypeKey, QString());
auto cf = m_provider.compilerFactories();
for (auto f : cf) {
const auto cf = m_provider.compilerFactories();
for (auto& f : cf) {
if (f->name() == type) {
auto compiler = f->createCompiler(name, path);
compilers.append(compiler);
......
......@@ -112,7 +112,8 @@ void TestCompilerProvider::testCompilerIncludesAndDefines()
{
auto settings = SettingsManager::globalInstance();
auto provider = settings->provider();
for (auto c : provider->compilers()) {
const auto& compilers = provider->compilers();
for (auto& c : compilers) {
if (!c->editable() && !c->path().isEmpty()) {
QVERIFY(!c->defines(Utils::Cpp, {}).isEmpty());
QVERIFY(!c->includes(Utils::Cpp, {}).isEmpty());
......@@ -221,8 +222,10 @@ void TestCompilerProvider::testCompilerIncludesAndDefinesForProject()
QVERIFY(projectCompiler != compiler);
ProjectBaseItem* mainfile = nullptr;
for (const auto& file: project->fileSet() ) {
for (auto i: project->filesForPath(file)) {
const auto& fileSet = project->fileSet();
for (const auto& file: fileSet) {
const auto& files = project->filesForPath(file);
for (auto i: files) {
if( i->text() == QLatin1String("main.cpp") ) {
mainfile = i;
break;
......
......@@ -264,7 +264,7 @@ void CompilersModel::setCompilers(const QVector< CompilerPointer >& compilers)
autoDetectedRootItem(m_rootItem)->removeChilds();
manualRootItem(m_rootItem)->removeChilds();
for (auto compiler: compilers) {
for (auto& compiler: compilers) {
if (compiler->factoryName().isEmpty()) {
continue;
}
......@@ -306,7 +306,8 @@ bool CompilersModel::removeRows(int row, int count, const QModelIndex& parent)
void CompilersModel::updateCompiler(const QItemSelection& compiler)
{
for (const auto& idx: compiler.indexes()) {
const auto& indexes = compiler.indexes();
for (const auto& idx : indexes) {
emit dataChanged(idx, idx);
}
emit compilerChanged();
......
......@@ -238,7 +238,8 @@ int main(int argc, char** argv)
}
if (show) {
for (const auto& include: converter.readIncludePaths(configFile, subdirectory)) {
const auto& includes = converter.readIncludePaths(configFile, subdirectory);
for (const auto& include : includes) {
out << include << "\n";
}
}
......
......@@ -90,8 +90,10 @@ void TestDefinesAndIncludes::loadMultiPathProject()
QCOMPARE( manager->defines( s_currentProject->projectItem(), IDefinesAndIncludesManager::UserDefined ), defines );
ProjectBaseItem* mainfile = nullptr;
for (const auto& file: s_currentProject->fileSet() ) {
for (auto i: s_currentProject->filesForPath(file)) {
const auto& fileSet = s_currentProject->fileSet();
for (const auto& file : fileSet) {
const auto& files = s_currentProject->filesForPath(file);
for (auto i: files) {
if( i->text() == QLatin1String("main.cpp") ) {
mainfile = i;
break;
......
......@@ -224,7 +224,8 @@ static QVector<SourceFormatterStyle> stylesFromLanguagePlugins()
KDevelop::SourceFormatterStyle CustomScriptPlugin::predefinedStyle(const QString& name) const
{
for (auto langStyle: stylesFromLanguagePlugins()) {
const auto& langStyles = stylesFromLanguagePlugins();
for (auto& langStyle: langStyles) {
qCDebug(CUSTOMSCRIPT) << "looking at style from language with custom sample" << langStyle.description() << langStyle.overrideSample();
if (langStyle.name() == name) {
return langStyle;
......
......@@ -30,6 +30,7 @@
#include <debugger/breakpoint/breakpoint.h>
#include <debugger/breakpoint/breakpointmodel.h>
#include <qtcompat_p.h>
#include <KLocalizedString>
......@@ -470,7 +471,7 @@ void MIBreakpointController::notifyBreakpointModified(const AsyncRecord& r)
const int row = rowFromDebuggerId(gdbId);
if (row < 0) {
for (const auto& breakpoint : m_pendingDeleted) {
for (const auto& breakpoint : qAsConst(m_pendingDeleted)) {
if (breakpoint->debuggerId == gdbId) {
// Received a modification of a breakpoint whose deletion is currently
// in-flight; simply ignore it.
......
......@@ -38,6 +38,7 @@
#include <interfaces/iuicontroller.h>
#include <language/interfaces/editorcontext.h>
#include <isession.h>
#include <qtcompat_p.h>
#include <KActionCollection>
#include <KLocalizedString>
......@@ -147,7 +148,8 @@ void MIDebuggerPlugin::setupActions()
void MIDebuggerPlugin::setupDBus()
{
QDBusConnectionInterface* dbusInterface = QDBusConnection::sessionBus().interface();
for (const auto &service : dbusInterface->registeredServiceNames().value()) {
const auto& registeredServiceNames = dbusInterface->registeredServiceNames().value();
for (const auto& service : registeredServiceNames) {
slotDBusOwnerChanged(service, QString(), QString('n'));
}
......
......@@ -89,7 +89,8 @@ void DockerPlugin::runtimeChanged(KDevelop::IRuntime* newRuntime)
{