Gui: modernize C++: use range-based for loop
This commit is contained in:
@@ -604,8 +604,8 @@ void TaskView::updateWatcher()
|
||||
void TaskView::addTaskWatcher(const std::vector<TaskWatcher*> &Watcher)
|
||||
{
|
||||
// remove and delete the old set of TaskWatcher
|
||||
for (std::vector<TaskWatcher*>::iterator it=ActiveWatcher.begin();it!=ActiveWatcher.end();++it)
|
||||
delete *it;
|
||||
for (TaskWatcher* tw : ActiveWatcher)
|
||||
delete tw;
|
||||
|
||||
ActiveWatcher = Watcher;
|
||||
addTaskWatcher();
|
||||
@@ -622,10 +622,10 @@ void TaskView::clearTaskWatcher()
|
||||
void TaskView::addTaskWatcher()
|
||||
{
|
||||
// add all widgets for all watcher to the task view
|
||||
for (std::vector<TaskWatcher*>::iterator it=ActiveWatcher.begin();it!=ActiveWatcher.end();++it){
|
||||
std::vector<QWidget*> &cont = (*it)->getWatcherContent();
|
||||
for (std::vector<QWidget*>::iterator it2=cont.begin();it2!=cont.end();++it2){
|
||||
taskPanel->addWidget(*it2);
|
||||
for (TaskWatcher* tw : ActiveWatcher) {
|
||||
std::vector<QWidget*> &cont = tw->getWatcherContent();
|
||||
for (QWidget* w : cont) {
|
||||
taskPanel->addWidget(w);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -668,11 +668,11 @@ void TaskView::removeTaskWatcher()
|
||||
}
|
||||
|
||||
// remove all widgets
|
||||
for (std::vector<TaskWatcher*>::iterator it=ActiveWatcher.begin();it!=ActiveWatcher.end();++it) {
|
||||
std::vector<QWidget*> &cont = (*it)->getWatcherContent();
|
||||
for (std::vector<QWidget*>::iterator it2=cont.begin();it2!=cont.end();++it2) {
|
||||
(*it2)->hide();
|
||||
taskPanel->removeWidget(*it2);
|
||||
for (TaskWatcher* tw : ActiveWatcher) {
|
||||
std::vector<QWidget*> &cont = tw->getWatcherContent();
|
||||
for (QWidget* w : cont) {
|
||||
w->hide();
|
||||
taskPanel->removeWidget(w);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user