diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index 90e4a472e95b027a4e07acea65c04e03e6ff247a..c7c95fc7abda265402f0a4b786186980b560773c 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -360,18 +360,20 @@ void WaypointList::on_clearWPListButton_clicked() { emit clearPathclicked(); -// if (uas) -// { -// const QVector &waypoints = uas->getWaypointManager().getWaypointList(); -// for(int i = 0; i <=waypoints.size(); i++) -// { -// WaypointView* widget = wpViews.find(waypoints[i]).value(); + if (uas) + { + const QVector &waypoints = uas->getWaypointManager().getWaypointList(); + while(!waypoints.isEmpty())//for(int i = 0; i <= waypoints.size(); i++) + { + //Waypoint *temp = waypoints[i]; -// widget->remove(); + WaypointView* widget = wpViews.find(waypoints[0]).value(); -// } + widget->remove(); -// } + } + + } } /** @brief Add a waypoint by mouse click over the map */