summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger/qt/mainwindow.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-04-18 18:53:28 -0400
committer AJR <ajrhacker@users.noreply.github.com>2016-04-18 18:53:28 -0400
commit084d3654ca14a79d9ec173bad4ddf00ad0fb5a7f (patch)
tree197ae37b68f3169048fb3cadf6947353315f3608 /src/osd/modules/debugger/qt/mainwindow.cpp
parent55d3e544e013174880c8f208264683aac6d711f9 (diff)
Iterate over devices C++11 style
Replace the old device_iterator and its specialized versions with functionally equivalent classes that use standard operators to yield references to devices/interfaces rather than pointers. With range-based for loops, they no longer have to be stored in named variables, though they can also be reused concurrently since the iteration state is now maintained by a subclass. Add a few more typical getters to device_t::subdevice_list.
Diffstat (limited to 'src/osd/modules/debugger/qt/mainwindow.cpp')
-rw-r--r--src/osd/modules/debugger/qt/mainwindow.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/osd/modules/debugger/qt/mainwindow.cpp b/src/osd/modules/debugger/qt/mainwindow.cpp
index 3ec15065b46..aeca1d20b63 100644
--- a/src/osd/modules/debugger/qt/mainwindow.cpp
+++ b/src/osd/modules/debugger/qt/mainwindow.cpp
@@ -469,13 +469,12 @@ void MainWindow::createImagesMenu()
QMenu* imagesMenu = menuBar()->addMenu("&Images");
int interfaceIndex = 0;
- image_interface_iterator iter(m_machine->root_device());
- for (device_image_interface *img = iter.first(); img != NULL; img = iter.next())
+ for (device_image_interface &img : image_interface_iterator(m_machine->root_device()))
{
- std::string menuName = string_format("%s : %s", img->device().name(), img->exists() ? img->filename() : "[empty slot]");
+ std::string menuName = string_format("%s : %s", img.device().name(), img.exists() ? img.filename() : "[empty slot]");
QMenu* interfaceMenu = imagesMenu->addMenu(menuName.c_str());
- interfaceMenu->setObjectName(img->device().name());
+ interfaceMenu->setObjectName(img.device().name());
QAction* mountAct = new QAction("Mount...", interfaceMenu);
QAction* unmountAct = new QAction("Unmount", interfaceMenu);
@@ -486,7 +485,7 @@ void MainWindow::createImagesMenu()
connect(mountAct, &QAction::triggered, this, &MainWindow::mountImage);
connect(unmountAct, &QAction::triggered, this, &MainWindow::unmountImage);
- if (!img->exists())
+ if (!img.exists())
unmountAct->setEnabled(false);
interfaceMenu->addAction(mountAct);