diff options
author | Max Horn | 2003-10-05 14:03:07 +0000 |
---|---|---|
committer | Max Horn | 2003-10-05 14:03:07 +0000 |
commit | fd2c041d79e6b4132d7edeab6be613984dedefd3 (patch) | |
tree | 88a8603c5c24e462531af2c0a8e621259f6eeacb | |
parent | a0fb1850de7e4a69cd21946a6fee431cb6beb0c6 (diff) | |
download | scummvm-rg350-fd2c041d79e6b4132d7edeab6be613984dedefd3.tar.gz scummvm-rg350-fd2c041d79e6b4132d7edeab6be613984dedefd3.tar.bz2 scummvm-rg350-fd2c041d79e6b4132d7edeab6be613984dedefd3.zip |
Make use of new List iterator
svn-id: r10609
-rw-r--r-- | base/gameDetector.cpp | 12 | ||||
-rw-r--r-- | gui/launcher.cpp | 12 |
2 files changed, 13 insertions, 11 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index 80395ac0db..d1c8bde1d1 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -298,8 +298,9 @@ void GameDetector::list_games() { printf("Game Full Title Config\n" "---------------- ------------------------------------------------------ -------\n"); - for (int i = 0; i < plugins.size(); i++) { - v = plugins[i]->getTargets(); + PluginList::ConstIterator iter = plugins.begin(); + for (iter = plugins.begin(); iter != plugins.end(); ++iter) { + v = (*iter)->getTargets(); while (v->targetName && v->description) { config = (g_config->has_domain(v->targetName)) ? "Yes" : ""; printf("%-17s%-56s%s\n", v->targetName, v->description, config); @@ -314,11 +315,12 @@ const TargetSettings *GameDetector::findTarget(const char *targetName, const Plu const TargetSettings *target; const PluginList &plugins = g_pluginManager->getPlugins(); - for (int i = 0; i < plugins.size(); i++) { - target = plugins[i]->findTarget(targetName); + PluginList::ConstIterator iter = plugins.begin(); + for (iter = plugins.begin(); iter != plugins.end(); ++iter) { + target = (*iter)->findTarget(targetName); if (target) { if (plugin) - *plugin = plugins[i]; + *plugin = *iter; return target; } } diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 3f12bfd057..91866a8ad0 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -228,18 +228,18 @@ void LauncherDialog::close() { } void LauncherDialog::updateListing() { - int i; Common::StringList l; // Retrieve a list of all games defined in the config file _domains.clear(); StringList domains = g_config->get_domains(); - for (i = 0; i < domains.size(); i++) { - String name(g_config->get("gameid", domains[i])); - String description(g_config->get("description", domains[i])); + StringList::ConstIterator iter = domains.begin(); + for (iter = domains.begin(); iter != domains.end(); ++iter) { + String name(g_config->get("gameid", *iter)); + String description(g_config->get("description", *iter)); if (name.isEmpty()) - name = domains[i]; + name = *iter; if (description.isEmpty()) { const TargetSettings *v = _detector.findTarget(name.c_str()); if (v && v->description) @@ -253,7 +253,7 @@ void LauncherDialog::updateListing() { while (pos < size && (description > l[pos])) pos++; l.insert_at(pos, description); - _domains.insert_at(pos, domains[i]); + _domains.insert_at(pos, *iter); } } |