forked from qt-creator/qt-creator
Fix Krazy warnings about values or keys iteration in various places.
Change-Id: Iced108cc7fc74f6ce5501c59db7090fea21cb87a Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -252,13 +252,15 @@ void JsonSchema::enterNestedTypeSchema()
|
||||
|
||||
QStringList JsonSchema::properties(JsonObjectValue *v) const
|
||||
{
|
||||
typedef QHash<QString, JsonValue *>::ConstIterator MemberConstIterator;
|
||||
|
||||
QStringList all;
|
||||
|
||||
if (JsonObjectValue *ov = getObjectValue(kProperties, v)) {
|
||||
foreach (const QString &property, ov->members().keys()) {
|
||||
if (hasPropertySchema(property))
|
||||
all.append(property);
|
||||
}
|
||||
const MemberConstIterator cend = ov->members().constEnd();
|
||||
for (MemberConstIterator it = ov->members().constBegin(); it != cend; ++it)
|
||||
if (hasPropertySchema(it.key()))
|
||||
all.append(it.key());
|
||||
}
|
||||
|
||||
if (JsonObjectValue *base = resolveBase(v))
|
||||
|
||||
@@ -459,8 +459,8 @@ ActionManagerPrivate::~ActionManagerPrivate()
|
||||
// first delete containers to avoid them reacting to command deletion
|
||||
foreach (ActionContainerPrivate *container, m_idContainerMap)
|
||||
disconnect(container, SIGNAL(destroyed()), this, SLOT(containerDestroyed()));
|
||||
qDeleteAll(m_idContainerMap.values());
|
||||
qDeleteAll(m_idCmdMap.values());
|
||||
qDeleteAll(m_idContainerMap);
|
||||
qDeleteAll(m_idCmdMap);
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug d, const Context &context)
|
||||
|
||||
@@ -130,9 +130,9 @@ void DocSettingsPage::addDocumentation()
|
||||
|
||||
if (!docsUnableToRegister.isEmpty()) {
|
||||
formatedFail += QString::fromLatin1("<ul><li><b>%1</b>").arg(tr("Namespace already registered:"));
|
||||
foreach (const QString &key, docsUnableToRegister.keys()) {
|
||||
formatedFail += QString::fromLatin1("<ul><li>%1 - %2</li></ul>").arg(key, docsUnableToRegister
|
||||
.value(key));
|
||||
const NameSpaceToPathHash::ConstIterator cend = docsUnableToRegister.constEnd();
|
||||
for (NameSpaceToPathHash::ConstIterator it = docsUnableToRegister.constBegin(); it != cend; ++it) {
|
||||
formatedFail += QString::fromLatin1("<ul><li>%1 - %2</li></ul>").arg(it.key(), it.value());
|
||||
}
|
||||
formatedFail += QLatin1String("</li></ul>");
|
||||
}
|
||||
|
||||
@@ -312,10 +312,12 @@ void LocatorWidget::setPlaceholderText(const QString &text)
|
||||
|
||||
void LocatorWidget::updateFilterList()
|
||||
{
|
||||
typedef QMap<Id, QAction *> IdActionMap;
|
||||
|
||||
m_filterMenu->clear();
|
||||
|
||||
// update actions and menu
|
||||
QMap<Id, QAction *> actionCopy = m_filterActionMap;
|
||||
IdActionMap actionCopy = m_filterActionMap;
|
||||
m_filterActionMap.clear();
|
||||
// register new actions, update existent
|
||||
foreach (ILocatorFilter *filter, m_locatorPlugin->filters()) {
|
||||
@@ -343,9 +345,11 @@ void LocatorWidget::updateFilterList()
|
||||
}
|
||||
|
||||
// unregister actions that are deleted now
|
||||
foreach (const Id id, actionCopy.keys())
|
||||
ActionManager::unregisterAction(actionCopy.value(id), id.withPrefix("Locator."));
|
||||
qDeleteAll(actionCopy);
|
||||
const IdActionMap::Iterator end = actionCopy.end();
|
||||
for (IdActionMap::Iterator it = actionCopy.begin(); it != end; ++it) {
|
||||
ActionManager::unregisterAction(it.value(), it.key().withPrefix("Locator."));
|
||||
delete it.value();
|
||||
}
|
||||
|
||||
m_filterMenu->addSeparator();
|
||||
m_filterMenu->addAction(m_refreshAction);
|
||||
|
||||
@@ -52,11 +52,14 @@ ScreenShotCropperWindow::~ScreenShotCropperWindow()
|
||||
|
||||
void ScreenShotCropperWindow::loadData(const QString &areasXmlFile, const QString &imagesFolder)
|
||||
{
|
||||
typedef QMap<QString, QRect>::ConstIterator StringRectConstIt;
|
||||
|
||||
m_areasOfInterestFile = areasXmlFile;
|
||||
m_areasOfInterest = ScreenshotCropper::loadAreasOfInterest(m_areasOfInterestFile);
|
||||
m_imagesFolder = imagesFolder;
|
||||
foreach (const QString &pngFile, m_areasOfInterest.keys())
|
||||
ui->m_filenamesList->addItem(pngFile);
|
||||
const StringRectConstIt cend = m_areasOfInterest.constEnd();
|
||||
for (StringRectConstIt it = m_areasOfInterest.constBegin(); it != cend; ++it)
|
||||
ui->m_filenamesList->addItem(it.key());
|
||||
}
|
||||
|
||||
void ScreenShotCropperWindow::selectImage(int index)
|
||||
|
||||
Reference in New Issue
Block a user