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


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

Header


Content

Posted by alinktomine on September 26, 2007 - 23:44:
Author: alink
Date: Wed Sep 26 23:44:25 2007
New Revision: 20730

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20730&view=rev
Log:
revert r20718. The tiny bug (server names not directly translated when
switching languages) don't worth the complexity needed to properly fix it.

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=20730&r1=20729&r2=20730&view=diff
==============================================================================
--- trunk/src/game_preferences.cpp (original)
+++ trunk/src/game_preferences.cpp Wed Sep 26 23:44:25 2007
@@ -148,7 +148,21 @@
 
 const std::vector<game_config::server_info>& server_list()
 {
-       return game_config::server_list;
+       static std::vector<game_config::server_info> pref_servers;
+       if(pref_servers.empty()) {
+               std::vector<game_config::server_info> &game_servers = 
game_config::server_list;
+               wassert(game_servers.size() > 0);
+               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) {
+                       game_config::server_info sinf;
+                       sinf.name = (**server)["name"];
+                       sinf.address = (**server)["address"];
+                       pref_servers.push_back(sinf);
+               }
+       }
+       return pref_servers;
 }
 
 const std::string network_host()




Related Messages


Powered by MHonArc, Updated Thu Sep 27 00:00:18 2007