From 6971b49f85d9ddeb2da968a594d65affec3d2b44 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Tue, 10 Mar 2015 02:49:32 +1100 Subject: Lots of Frontend refactoring with a few bug fixes There is still far too much overly convoluted code. However, the introduction of some RAII when dealing with files has made the code-base slightly less error prone. --- heimdall-frontend/source/FirmwareInfo.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'heimdall-frontend/source/FirmwareInfo.cpp') diff --git a/heimdall-frontend/source/FirmwareInfo.cpp b/heimdall-frontend/source/FirmwareInfo.cpp index c01d636..7a1043c 100644 --- a/heimdall-frontend/source/FirmwareInfo.cpp +++ b/heimdall-frontend/source/FirmwareInfo.cpp @@ -720,10 +720,10 @@ void FirmwareInfo::WriteXml(QXmlStreamWriter& xml) const xml.writeStartElement("developers"); - for (int i = 0; i < developers.length(); i++) + for (const QString& developer : developers) { xml.writeStartElement("name"); - xml.writeCharacters(developers[i]); + xml.writeCharacters(developer); xml.writeEndElement(); } @@ -745,8 +745,10 @@ void FirmwareInfo::WriteXml(QXmlStreamWriter& xml) const xml.writeStartElement("devices"); - for (int i = 0; i < deviceInfos.length(); i++) - deviceInfos[i].WriteXml(xml); + for (const DeviceInfo& deviceInfo : deviceInfos) + { + deviceInfo.WriteXml(xml); + } xml.writeEndElement(); -- cgit v1.2.3