From 3d15e9e5d472920043498e741c52333db2d60415 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Wed, 2 Jan 2019 10:52:13 +0100 Subject: modernize loops (2) --- src/ui/dialog/input.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/ui/dialog/input.cpp') diff --git a/src/ui/dialog/input.cpp b/src/ui/dialog/input.cpp index 080a4de12..e1bf1bd1c 100644 --- a/src/ui/dialog/input.cpp +++ b/src/ui/dialog/input.cpp @@ -832,8 +832,8 @@ void InputDialogImpl::setupTree( Glib::RefPtr store, Gtk::TreeIt if ( it.name.empty() ) { // Check to see if we can derive one std::list names; - for ( std::list >::iterator it2 = it.devices.begin(); it2 != it.devices.end(); ++it2 ) { - names.push_back( (*it2)->getName() ); + for (auto & device : it.devices) { + names.push_back( device->getName() ); } Glib::ustring common = getCommon(names); if ( !common.empty() ) { @@ -847,8 +847,7 @@ void InputDialogImpl::setupTree( Glib::RefPtr store, Gtk::TreeIt for ( std::list >::iterator it2 = it.devices.begin(); it2 != it.devices.end(); ++it2 ) { Glib::RefPtr dev = *it2; if ( dev->getSource() == Gdk::SOURCE_PEN ) { - for ( std::list >::iterator it3 = it.devices.begin(); it3 != it.devices.end(); ++it3 ) { - Glib::RefPtr dev2 = *it3; + for (auto dev2 : it.devices) { if ( dev2->getSource() == Gdk::SOURCE_ERASER ) { DeviceManager::getManager().setLinkedTo(dev->getId(), dev2->getId()); break; // only check the first eraser... for now @@ -858,8 +857,7 @@ void InputDialogImpl::setupTree( Glib::RefPtr store, Gtk::TreeIt } } - for ( std::list >::iterator it2 = it.devices.begin(); it2 != it.devices.end(); ++it2 ) { - Glib::RefPtr dev = *it2; + for (auto dev : it.devices) { Gtk::TreeModel::Row deviceRow = *(store->append(childrow.children())); deviceRow[getCols().description] = dev->getName(); deviceRow[getCols().device] = dev; -- cgit v1.2.3