Mercurial > octave
changeset 27550:b8f51d2dba6d
* qt-interpreter-events.cc: Use range-based for loop where possible.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 24 Oct 2019 01:26:31 -0400 |
parents | 5189bfa8ad2a |
children | 564bba235594 |
files | libgui/src/qt-interpreter-events.cc |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/qt-interpreter-events.cc Thu Oct 24 01:15:50 2019 -0400 +++ b/libgui/src/qt-interpreter-events.cc Thu Oct 24 01:26:31 2019 -0400 @@ -61,8 +61,8 @@ { QStringList retval; - for (auto it = lst.begin (); it != lst.end (); it++) - retval.append (QString::fromStdString (*it)); + for (const auto& s : lst) + retval.append (QString::fromStdString (s)); return retval; } @@ -77,10 +77,10 @@ // (optional). Qt wants a list of filters in the format of // 'FilterName (space separated exts)'. - for (auto it = lst.begin (); it != lst.end (); it++) + for (const auto& ext_name : lst) { - QString ext = QString::fromStdString (it->first); - QString name = QString::fromStdString (it->second); + QString ext = QString::fromStdString (ext_name.first); + QString name = QString::fromStdString (ext_name.second); // Strip out extensions from name and replace ';' with spaces in // list. @@ -136,8 +136,8 @@ // Add all the file dialog results to a string list. QStringList inputLine = uiwidget_creator.get_string_list (); - for (auto it = inputLine.begin (); it != inputLine.end (); it++) - retval.push_back (it->toStdString ()); + for (const auto& s : inputLine) + retval.push_back (s.toStdString ()); retval.push_back (uiwidget_creator.get_dialog_path ().toStdString ()); retval.push_back ((QString ("%1").arg (uiwidget_creator.get_dialog_result ())).toStdString ()); @@ -174,8 +174,8 @@ uiwidget_creator.unlock (); - for (auto it = inputLine.begin (); it != inputLine.end (); it++) - retval.push_back (it->toStdString ()); + for (const auto& s : inputLine) + retval.push_back (s.toStdString ()); return retval; }