mail[Wesnoth-commits] r33914 - /trunk/src/game_preferences.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on March 20, 2009 - 08:09:
Author: silene
Date: Fri Mar 20 08:09:18 2009
New Revision: 33914

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33914&view=rev
Log:
Removed config::get_children.

Modified:
    trunk/src/game_preferences.cpp

Modified: trunk/src/game_preferences.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_preferences.cpp?rev=33914&r1=33913&r2=33914&view=diff
==============================================================================
--- trunk/src/game_preferences.cpp (original)
+++ trunk/src/game_preferences.cpp Fri Mar 20 08:09:18 2009
@@ -87,11 +87,8 @@
 
                        std::vector<std::string> current_history;
                        foreach(const config* history_id_child, 
history_id.second) {
-
-                               const config::child_list& line = 
history_id_child->get_children("line");
-                               foreach(const config* line_data, line) {
-
-                                       
current_history.push_back((*line_data)["message"]);
+                               foreach (const config &line_data, 
history_id_child->child_range("line")) {
+                                       
current_history.push_back(line_data["message"]);
                                }
                        }
 
@@ -296,12 +293,10 @@
                std::vector<game_config::server_info> &game_servers = 
game_config::server_list;
                VALIDATE(game_servers.size() > 0, _("No server has been 
defined."));
                pref_servers.insert(pref_servers.begin(), 
game_servers.begin(), game_servers.end());
-               const std::vector<config *> &user_servers = 
get_prefs()->get_children("server");
-               std::vector<config *>::const_iterator server;
-               for(server = user_servers.begin(); server != 
user_servers.end(); ++server) {
+               foreach (const config &server, 
get_prefs()->child_range("server")) {
                        game_config::server_info sinf;
-                       sinf.name = (**server)["name"];
-                       sinf.address = (**server)["address"];
+                       sinf.name = server["name"];
+                       sinf.address = server["address"];
                        pref_servers.push_back(sinf);
                }
        }




Related Messages


Powered by MHonArc, Updated Fri Mar 20 08:20:30 2009