if (argType == QVariant::StringList) {
out += QLatin1Char('{');
QStringList list = arg.toStringList();
- foreach (QString item, list)
+ foreach (const QString &item, list)
out += QLatin1Char('\"') + item + QLatin1String("\", ");
if (!list.isEmpty())
out.chop(2);
} else if (argType == QVariant::List) {
out += QLatin1Char('{');
QList<QVariant> list = arg.toList();
- foreach (QVariant item, list) {
+ foreach (const QVariant &item, list) {
if (!variantToString(item, out))
return false;
out += QLatin1String(", ");
{
if (!text.isEmpty() || (!handler && !initHandler()) || !handler->supportsOption(QImageIOHandler::Description))
return;
- foreach (QString pair, handler->option(QImageIOHandler::Description).toString().split(
+ foreach (const QString &pair, handler->option(QImageIOHandler::Description).toString().split(
QLatin1String("\n\n"))) {
int index = pair.indexOf(QLatin1Char(':'));
if (index >= 0 && pair.indexOf(QLatin1Char(' ')) < index) {
if (decorationList.isEmpty())
return;
- foreach (const ItemDecoration decoration, decorationList) {
+ foreach (const ItemDecoration &decoration, decorationList) {
painter->setPen(decoration.pen);
QLineF line(decoration.x1, decoration.y, decoration.x2, decoration.y);
painter->drawLine(line);
// create directories first
QList<FileInfo> allFiles = fileInfoList();
- foreach (FileInfo fi, allFiles) {
+ foreach (const FileInfo &fi, allFiles) {
const QString absPath = destinationDir + QDir::separator() + fi.filePath;
if (fi.isDir) {
if (!baseDir.mkpath(fi.filePath))
}
// set up symlinks
- foreach (FileInfo fi, allFiles) {
+ foreach (const FileInfo &fi, allFiles) {
const QString absPath = destinationDir + QDir::separator() + fi.filePath;
if (fi.isSymLink) {
QString destination = QFile::decodeName(fileData(fi.filePath));
}
}
- foreach (FileInfo fi, allFiles) {
+ foreach (const FileInfo &fi, allFiles) {
const QString absPath = destinationDir + QDir::separator() + fi.filePath;
if (fi.isFile) {
QFile f(absPath);
return 0;
}
- foreach (QNetworkCacheMetaData::RawHeader header, metaData.rawHeaders()) {
+ foreach (const QNetworkCacheMetaData::RawHeader &header, metaData.rawHeaders()) {
if (header.first.toLower() == "content-length") {
qint64 size = header.second.toInt();
if (size > (maximumCacheSize() * 3)/4)
{
bool sizeOk = false;
bool typeOk = false;
- foreach (QNetworkCacheMetaData::RawHeader header, metaData.rawHeaders()) {
+ foreach (const QNetworkCacheMetaData::RawHeader &header, metaData.rawHeaders()) {
if (header.first.toLower() == "content-length") {
qint64 size = header.second.toLongLong();
if (size > MAX_COMPRESSION_SIZE)
{
const QList<QByteArray> noProxyTokens = qgetenv("no_proxy").split(',');
- foreach (const QByteArray rawToken, noProxyTokens) {
+ foreach (const QByteArray &rawToken, noProxyTokens) {
QByteArray token = rawToken.trimmed();
QString peerHostName = query.peerHostName();
if (m_deviceDiscovery) {
// scan and add already connected keyboards
QStringList devices = m_deviceDiscovery->scanConnectedDevices();
- foreach (QString device, devices) {
+ foreach (const QString &device, devices) {
addKeyboard(device);
}
if (m_deviceDiscovery) {
// scan and add already connected keyboards
QStringList devices = m_deviceDiscovery->scanConnectedDevices();
- foreach (QString device, devices) {
+ foreach (const QString &device, devices) {
addMouse(device);
}
connect(connmanManager,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
this,SLOT(propertyChangedContext(QString,QString,QDBusVariant)));
- foreach(const QString techPath, connmanManager->getTechnologies()) {
+ foreach (const QString &techPath, connmanManager->getTechnologies()) {
QConnmanTechnologyInterface *tech;
tech = new QConnmanTechnologyInterface(techPath, this);
this,SLOT(technologyPropertyChangedContext(QString,QString,QDBusVariant)));
}
- foreach(const QString servPath, connmanManager->getServices()) {
+ foreach (const QString &servPath, connmanManager->getServices()) {
addServiceConfiguration(servPath);
}
QOfonoManagerInterface ofonoManager(0);
QString modemPath = ofonoManager.currentModem().path();
QOfonoDataConnectionManagerInterface dc(modemPath,0);
- foreach(const QDBusObjectPath dcPath,dc.getPrimaryContexts()) {
+ foreach (const QDBusObjectPath &dcPath,dc.getPrimaryContexts()) {
if(dcPath.path().contains(servicePath.section("_",-1))) {
QOfonoPrimaryDataContextInterface primaryContext(dcPath.path(),0);
primaryContext.setActive(true);
QOfonoManagerInterface ofonoManager(0);
QString modemPath = ofonoManager.currentModem().path();
QOfonoDataConnectionManagerInterface dc(modemPath,0);
- foreach(const QDBusObjectPath dcPath,dc.getPrimaryContexts()) {
+ foreach (const QDBusObjectPath &dcPath,dc.getPrimaryContexts()) {
if(dcPath.path().contains(servicePath.section("_",-1))) {
QOfonoPrimaryDataContextInterface primaryContext(dcPath.path(),0);
primaryContext.setActive(false);
QString QConnmanEngine::serviceFromId(const QString &id)
{
QMutexLocker locker(&mutex);
- foreach(const QString service, serviceNetworks) {
+ foreach (const QString &service, serviceNetworks) {
if (id == QString::number(qHash(service)))
return service;
}
QStringList list = qdbus_cast<QStringList>(arg);
if(list.count() > accessPointConfigurations.count()) {
- foreach(const QString service, list) {
+ foreach (const QString &service, list) {
addServiceConfiguration(service);
}
}
if(newlist.count() > 0) {
QMap<QString,QConnmanTechnologyInterface *> oldtech = technologies;
- foreach(const QString listPath, newlist) {
+ foreach (const QString &listPath, newlist) {
if(!oldtech.contains(listPath)) {
QConnmanTechnologyInterface *tech;
tech = new QConnmanTechnologyInterface(listPath,this);
QOfonoNetworkRegistrationInterface ofonoNetwork(ofonoManager.currentModem().path(),this);
if(ofonoNetwork.isValid()) {
- foreach(const QDBusObjectPath op,ofonoNetwork.getOperators() ) {
+ foreach (const QDBusObjectPath &op,ofonoNetwork.getOperators() ) {
QOfonoNetworkOperatorInterface opIface(op.path(),this);
- foreach(const QString opTech, opIface.getTechnologies()) {
+ foreach (const QString &opTech, opIface.getTechnologies()) {
if(opTech == "gsm") {
return QNetworkConfiguration::Bearer2G;
QOfonoManagerInterface ofonoManager(this);
QString modemPath = ofonoManager.currentModem().path();
QOfonoDataConnectionManagerInterface dc(modemPath,this);
- foreach(const QDBusObjectPath dcPath,dc.getPrimaryContexts()) {
+ foreach (const QDBusObjectPath &dcPath,dc.getPrimaryContexts()) {
if(dcPath.path().contains(context.section("_",-1))) {
return dc.isRoamingAllowed();
}
QString QConnmanManagerInterface::getPathForTechnology(const QString &name)
{
- foreach(const QString path, getTechnologies()) {
+ foreach (const QString &path, getTechnologies()) {
if(path.contains(name)) {
return path;
}
QDBusObjectPath QOfonoManagerInterface::currentModem()
{
QList<QDBusObjectPath> modems = getModems();
- foreach(const QDBusObjectPath modem, modems) {
+ foreach (const QDBusObjectPath &modem, modems) {
QOfonoModemInterface device(modem.path());
if(device.isPowered() && device.isOnline())
return modem;;
QFileInfo lastFileInfo;
const QString pattern = QString::fromLatin1("%1.(\\d+)").arg(base);
QRegExp rx(pattern);
- foreach (QFileInfo fileInfo, fiList) {
+ foreach (const QFileInfo &fileInfo, fiList) {
const int index = rx.indexIn(fileInfo.fileName());
Q_ASSERT(index == 0);
Q_UNUSED(index);
<< base // overall summary
<< QString::fromLatin1("%1.*").arg(base); // individual dumps
QFileInfoList fiList = QDir().entryInfoList(nameFilters, QDir::Files | QDir::Readable);
- foreach (QFileInfo fileInfo, fiList) {
+ foreach (const QFileInfo &fileInfo, fiList) {
const bool removeOk = QFile::remove(fileInfo.fileName());
Q_ASSERT(removeOk);
Q_UNUSED(removeOk);
{
QString interface;
- foreach (ClassInfoDef cid, mo->classInfoList) {
+ foreach (const ClassInfoDef &cid, mo->classInfoList) {
if (cid.name == QCLASSINFO_DBUS_INTERFACE)
return QString::fromUtf8(cid.value);
}
<< includeList
<< "#include <QtDBus/QtDBus>" << endl;
- foreach (QString include, includes) {
+ foreach (const QString &include, includes) {
hs << "#include \"" << include << "\"" << endl;
if (headerName.isEmpty())
cs << "#include \"" << include << "\"" << endl;
<< "#include <QtCore/QVariant>" << endl;
hs << "#include <QtDBus/QtDBus>" << endl;
- foreach (QString include, includes) {
+ foreach (const QString &include, includes) {
hs << "#include \"" << include << "\"" << endl;
if (headerName.isEmpty())
cs << "#include \"" << include << "\"" << endl;
while (p != parsers.constEnd()) {
QStringList headerPatterns = (*p)->headerFileNameFilter();
- foreach (QString pattern, headerPatterns) {
+ foreach (const QString &pattern, headerPatterns) {
QRegExp re(pattern, Qt::CaseInsensitive, QRegExp::Wildcard);
if (re.exactMatch(fileName))
return *p;
while (p != parsers.constEnd()) {
QStringList sourcePatterns = (*p)->sourceFileNameFilter();
- foreach (QString pattern, sourcePatterns) {
+ foreach (const QString &pattern, sourcePatterns) {
QRegExp re(pattern, Qt::CaseInsensitive, QRegExp::Wildcard);
if (re.exactMatch(fileName))
return *p;
QStringList prefixes = config.getStringList(CONFIG_OUTPUTPREFIXES);
if (!prefixes.isEmpty()) {
- foreach (QString prefix, prefixes)
+ foreach (const QString &prefix, prefixes)
outputPrefixes[prefix] = config.getString(
CONFIG_OUTPUTPREFIXES + Config::dot + prefix);
} else
/*
Main loop.
*/
- foreach (QString qf, qdocFiles) {
+ foreach (const QString &qf, qdocFiles) {
//qDebug() << "PROCESSING:" << qf;
processQdocconfFile(qf);
}
{
QFileInfoList entries = dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot
| QDir::NoSymLinks);
- foreach (QFileInfo entry, entries) {
+ foreach (const QFileInfo &entry, entries) {
if (entry.isDir()) {
dumpRecursive(entry.filePath(), out);
} else {
for (int i = 0; i < exposed.size(); ++i)
br |= exposed.at(i);
QTransform pixmapToItem = itemToPixmap.inverted();
- foreach (QRect r, scrollExposure.rects())
+ foreach (const QRect &r, scrollExposure.rects())
br |= pixmapToItem.mapRect(r);
}
styleOptionTmp = *option;