forked from qt-creator/qt-creator
Core: Modernize (minor)
Replace 2 loops with range loops, and use nullptr. Change-Id: I9f8920bb978ed218c5ec9ca01105652ebb51d842 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
12e253df9d
commit
9364e4b8ec
@@ -313,8 +313,7 @@ void Action::addOverrideAction(QAction *action, const Context &context, bool scr
|
||||
if (context.isEmpty()) {
|
||||
m_contextActionMap.insert(Constants::C_GLOBAL, action);
|
||||
} else {
|
||||
for (int i = 0; i < context.size(); ++i) {
|
||||
Id id = context.at(i);
|
||||
for (const Id &id : context) {
|
||||
if (m_contextActionMap.contains(id))
|
||||
qWarning("%s", qPrintable(msgActionWarning(action, id, m_contextActionMap.value(id, nullptr))));
|
||||
m_contextActionMap.insert(id, action);
|
||||
|
||||
@@ -355,7 +355,7 @@ void MainWindow::openDroppedFiles(const QList<DropSupport::FileSpec> &files)
|
||||
|
||||
IContext *MainWindow::currentContextObject() const
|
||||
{
|
||||
return m_activeContext.isEmpty() ? 0 : m_activeContext.first();
|
||||
return m_activeContext.isEmpty() ? nullptr : m_activeContext.first();
|
||||
}
|
||||
|
||||
QStatusBar *MainWindow::statusBar() const
|
||||
@@ -1086,8 +1086,7 @@ void MainWindow::updateContext()
|
||||
contexts.add(m_lowPrioAdditionalContexts);
|
||||
|
||||
Context uniquecontexts;
|
||||
for (int i = 0; i < contexts.size(); ++i) {
|
||||
const Id id = contexts.at(i);
|
||||
for (const Id &id : qAsConst(contexts)) {
|
||||
if (!uniquecontexts.contains(id))
|
||||
uniquecontexts.add(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user