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