Mercurial > octave
comparison libgui/src/resource-manager.cc @ 27676:ea7d36e9f197
use standard C++ range-based for loops instead of Qt foreach macro
* documentation.cc, file-editor.cc, octave-qscintilla.cc,
main-window.cc, resource-manager.cc, variable-editor.cc: Replace uses
of Qt foreach macros with standard C++ range-based for loops.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 12 Nov 2019 13:51:22 -0500 |
parents | a36443e94f8a |
children | dccc551aa83b |
comparison
equal
deleted
inserted
replaced
27675:fb2724126950 | 27676:ea7d36e9f197 |
---|---|
380 // get a list of all available encodings | 380 // get a list of all available encodings |
381 void resource_manager::get_codecs (QStringList *codecs) | 381 void resource_manager::get_codecs (QStringList *codecs) |
382 { | 382 { |
383 // get the codec name for each mib | 383 // get the codec name for each mib |
384 QList<int> all_mibs = QTextCodec::availableMibs (); | 384 QList<int> all_mibs = QTextCodec::availableMibs (); |
385 foreach (int mib, all_mibs) | 385 for (auto mib : all_mibs) |
386 { | 386 { |
387 QTextCodec *c = QTextCodec::codecForMib (mib); | 387 QTextCodec *c = QTextCodec::codecForMib (mib); |
388 codecs->append (c->name ().toUpper ()); | 388 codecs->append (c->name ().toUpper ()); |
389 } | 389 } |
390 | 390 |
431 enc = default_enc; | 431 enc = default_enc; |
432 } | 432 } |
433 } | 433 } |
434 | 434 |
435 // fill the combo box | 435 // fill the combo box |
436 foreach (QString c, all_codecs) | 436 for (const auto& c : all_codecs) |
437 combo->addItem (c); | 437 combo->addItem (c); |
438 | 438 |
439 // prepend the default item | 439 // prepend the default item |
440 combo->insertSeparator (0); | 440 combo->insertSeparator (0); |
441 if (default_exists) | 441 if (default_exists) |