cleanup zone label deletion

Use foreach function to shorten and clarify code.
This commit is contained in:
Sean Rhea
2009-09-14 11:37:23 -04:00
parent 99858423be
commit 494e4d949e

View File

@@ -247,16 +247,10 @@ bool AllPlot::shadeZones() const
void AllPlot::refreshZoneLabels()
{
// delete any existing power zone labels
if (zoneLabels.size()) {
QListIterator<AllPlotZoneLabel *> i(zoneLabels);
while (i.hasNext()) {
AllPlotZoneLabel *label = i.next();
label->detach();
delete label;
}
foreach(AllPlotZoneLabel *label, zoneLabels) {
label->detach();
delete label;
}
zoneLabels.clear();
if (rideItem) {