Use auto for iterator
This commit is contained in:
parent
50b7b7d889
commit
33d38b94da
@ -38,20 +38,19 @@ void InternetShowSettingsPage::Load() {
|
||||
|
||||
ui_->sources->clear();
|
||||
|
||||
for (QMap<InternetService*, InternetModel::ServiceItem>::iterator service =
|
||||
shown_services.begin();
|
||||
service != shown_services.end(); ++service) {
|
||||
for (auto service_it = shown_services.constBegin();
|
||||
service_it != shown_services.constEnd(); service_it++) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem;
|
||||
|
||||
// Get the same text and the same icon as the service tree
|
||||
item->setText(0, service.value().item->text());
|
||||
item->setIcon(0, service.value().item->icon());
|
||||
item->setText(0, service_it.value().item->text());
|
||||
item->setIcon(0, service_it.value().item->icon());
|
||||
|
||||
Qt::CheckState check_state =
|
||||
service.value().shown == true ? Qt::Checked : Qt::Unchecked;
|
||||
service_it.value().shown == true ? Qt::Checked : Qt::Unchecked;
|
||||
item->setData(0, Qt::CheckStateRole, check_state);
|
||||
/* We have to store the constant name of the service */
|
||||
item->setData(1, Qt::UserRole, service.key()->name());
|
||||
item->setData(1, Qt::UserRole, service_it.key()->name());
|
||||
|
||||
ui_->sources->invisibleRootItem()->addChild(item);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user