Remove last uses of Java-style (non-mutable) iterators from QtBase
Change-Id: I7531ffd4f2d5b2193bb6231c743ff0a074618b99 Reviewed-by: Lars Knoll <lars.knoll@qt.io>bb10
parent
9c016cefe9
commit
d08db11008
|
|
@ -316,10 +316,8 @@ QIconTheme::QIconTheme(const QString &themeName)
|
|||
#ifndef QT_NO_SETTINGS
|
||||
if (themeIndex.exists()) {
|
||||
const QSettings indexReader(themeIndex.fileName(), QSettings::IniFormat);
|
||||
QStringListIterator keyIterator(indexReader.allKeys());
|
||||
while (keyIterator.hasNext()) {
|
||||
|
||||
const QString key = keyIterator.next();
|
||||
const QStringList keys = indexReader.allKeys();
|
||||
for (const QString &key : keys) {
|
||||
if (key.endsWith(QLatin1String("/Size"))) {
|
||||
// Note the QSettings ini-format does not accept
|
||||
// slashes in key names, hence we have to cheat
|
||||
|
|
|
|||
|
|
@ -215,9 +215,7 @@ QString QNetworkManagerInterface::version() const
|
|||
|
||||
void QNetworkManagerInterface::propertiesSwap(QMap<QString,QVariant> map)
|
||||
{
|
||||
QMapIterator<QString, QVariant> i(map);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
for (auto i = map.cbegin(), end = map.cend(); i != end; ++i) {
|
||||
propertyMap.insert(i.key(),i.value());
|
||||
|
||||
if (i.key() == QLatin1String("State")) {
|
||||
|
|
@ -334,11 +332,8 @@ quint32 QNetworkManagerInterfaceAccessPoint::strength() const
|
|||
|
||||
void QNetworkManagerInterfaceAccessPoint::propertiesSwap(QMap<QString,QVariant> map)
|
||||
{
|
||||
QMapIterator<QString, QVariant> i(map);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
for (auto i = map.cbegin(), end = map.cend(); i != end; ++i)
|
||||
propertyMap.insert(i.key(),i.value());
|
||||
}
|
||||
}
|
||||
|
||||
QNetworkManagerInterfaceDevice::QNetworkManagerInterfaceDevice(const QString &deviceObjectPath, QObject *parent)
|
||||
|
|
@ -421,9 +416,7 @@ QDBusObjectPath QNetworkManagerInterfaceDevice::ip4config() const
|
|||
|
||||
void QNetworkManagerInterfaceDevice::propertiesSwap(QMap<QString,QVariant> map)
|
||||
{
|
||||
QMapIterator<QString, QVariant> i(map);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
for (auto i = map.cbegin(), end = map.cend(); i != end; ++i) {
|
||||
if (i.key() == QLatin1String("AvailableConnections")) { //Device
|
||||
const QDBusArgument &dbusArgs = i.value().value<QDBusArgument>();
|
||||
QDBusObjectPath path;
|
||||
|
|
@ -516,9 +509,7 @@ QStringList QNetworkManagerInterfaceDeviceWired::availableConnections()
|
|||
|
||||
void QNetworkManagerInterfaceDeviceWired::propertiesSwap(QMap<QString,QVariant> map)
|
||||
{
|
||||
QMapIterator<QString, QVariant> i(map);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
for (auto i = map.cbegin(), end = map.cend(); i != end; ++i) {
|
||||
propertyMap.insert(i.key(),i.value());
|
||||
if (i.key() == QLatin1String("Carrier"))
|
||||
Q_EMIT carrierChanged(i.value().toBool());
|
||||
|
|
@ -694,9 +685,7 @@ void QNetworkManagerInterfaceDeviceWireless::requestScan()
|
|||
|
||||
void QNetworkManagerInterfaceDeviceWireless::propertiesSwap(QMap<QString,QVariant> map)
|
||||
{
|
||||
QMapIterator<QString, QVariant> i(map);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
for (auto i = map.cbegin(), end = map.cend(); i != end; ++i) {
|
||||
propertyMap.insert(i.key(),i.value());
|
||||
if (i.key() == QLatin1String("ActiveAccessPoint")) //DeviceWireless
|
||||
Q_EMIT propertiesChanged(map);
|
||||
|
|
@ -753,11 +742,8 @@ QNetworkManagerInterfaceDeviceModem::ModemCapabilities QNetworkManagerInterfaceD
|
|||
|
||||
void QNetworkManagerInterfaceDeviceModem::propertiesSwap(QMap<QString,QVariant> map)
|
||||
{
|
||||
QMapIterator<QString, QVariant> i(map);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
for (auto i = map.cbegin(), end = map.cend(); i != end; ++i)
|
||||
propertyMap.insert(i.key(),i.value());
|
||||
}
|
||||
Q_EMIT propertiesChanged(map);
|
||||
}
|
||||
|
||||
|
|
@ -1051,9 +1037,7 @@ bool QNetworkManagerConnectionActive::default6Route() const
|
|||
|
||||
void QNetworkManagerConnectionActive::propertiesSwap(QMap<QString,QVariant> map)
|
||||
{
|
||||
QMapIterator<QString, QVariant> i(map);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
for (auto i = map.cbegin(), end = map.cend(); i != end; ++i) {
|
||||
propertyMap.insert(i.key(),i.value());
|
||||
if (i.key() == QLatin1String("State")) {
|
||||
quint32 state = i.value().toUInt();
|
||||
|
|
|
|||
|
|
@ -73,10 +73,7 @@ void QIBusSerializable::serializeTo(QDBusArgument &argument) const
|
|||
|
||||
argument.beginMap(qMetaTypeId<QString>(), qMetaTypeId<QDBusVariant>());
|
||||
|
||||
QHashIterator<QString, QDBusArgument> i(attachments);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
|
||||
for (auto i = attachments.begin(), end = attachments.end(); i != end; ++i) {
|
||||
argument.beginMapEntry();
|
||||
argument << i.key();
|
||||
|
||||
|
|
|
|||
|
|
@ -385,10 +385,8 @@ Qt::ScreenOrientation QQnxScreen::orientation() const
|
|||
|
||||
QWindow *QQnxScreen::topLevelAt(const QPoint &point) const
|
||||
{
|
||||
QListIterator<QQnxWindow*> it(m_childWindows);
|
||||
it.toBack();
|
||||
while (it.hasPrevious()) {
|
||||
QWindow *win = it.previous()->window();
|
||||
for (auto it = m_childWindows.rbegin(), end = m_childWindows.rend(); it != end; ++it) {
|
||||
QWindow *win = (*it)->window();
|
||||
if (win->geometry().contains(point))
|
||||
return win;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,27 +44,16 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
namespace {
|
||||
void openNameSpaces(const QStringList &namespaceList, QTextStream &output) {
|
||||
if (namespaceList.empty())
|
||||
return;
|
||||
const QStringList::const_iterator cend = namespaceList.constEnd();
|
||||
for (QStringList::const_iterator it = namespaceList.constBegin(); it != cend; ++it) {
|
||||
if (!it->isEmpty()) {
|
||||
for (auto it = namespaceList.begin(), end = namespaceList.end(); it != end; ++it) {
|
||||
if (!it->isEmpty())
|
||||
output << "namespace " << *it << " {\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void closeNameSpaces(const QStringList &namespaceList, QTextStream &output) {
|
||||
if (namespaceList.empty())
|
||||
return;
|
||||
|
||||
QListIterator<QString> it(namespaceList);
|
||||
it.toBack();
|
||||
while (it.hasPrevious()) {
|
||||
const QString ns = it.previous();
|
||||
if (!ns.isEmpty()) {
|
||||
output << "} // namespace " << ns << "\n";
|
||||
}
|
||||
for (auto it = namespaceList.rbegin(), end = namespaceList.rend(); it != end; ++it) {
|
||||
if (!it->isEmpty())
|
||||
output << "} // namespace " << *it << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1713,9 +1713,7 @@ void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QStri
|
|||
|
||||
// new format
|
||||
const QList<DomColorRole *> colorRoles = colorGroup->elementColorRole();
|
||||
QListIterator<DomColorRole *> itRole(colorRoles);
|
||||
while (itRole.hasNext()) {
|
||||
const DomColorRole *colorRole = itRole.next();
|
||||
for (const DomColorRole *colorRole : colorRoles) {
|
||||
if (colorRole->hasAttributeRole()) {
|
||||
const QString brushName = writeBrushInitialization(colorRole->elementBrush());
|
||||
m_output << m_indent << paletteName << ".setBrush(" << group
|
||||
|
|
@ -1792,9 +1790,7 @@ void WriteInitialization::writeBrush(const DomBrush *brush, const QString &brush
|
|||
}
|
||||
|
||||
const QList<DomGradientStop *> stops = gradient->elementGradientStop();
|
||||
QListIterator<DomGradientStop *> it(stops);
|
||||
while (it.hasNext()) {
|
||||
const DomGradientStop *stop = it.next();
|
||||
for (const DomGradientStop *stop : stops) {
|
||||
const DomColor *color = stop->elementColor();
|
||||
m_output << m_indent << gradientName << ".setColorAt("
|
||||
<< stop->attributePosition() << ", "
|
||||
|
|
|
|||
|
|
@ -731,9 +731,8 @@ void QSystemTrayIconPrivate::addPlatformMenu(QMenu *menu) const
|
|||
|
||||
// The recursion depth is the same as menu depth, so should not
|
||||
// be higher than 3 levels.
|
||||
QListIterator<QAction *> it(menu->actions());
|
||||
while (it.hasNext()) {
|
||||
QAction *action = it.next();
|
||||
const auto actions = menu->actions();
|
||||
for (QAction *action : actions) {
|
||||
if (action->menu())
|
||||
addPlatformMenu(action->menu());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue