mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
cleanup zone label deletion
Use foreach function to shorten and clarify code.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user