mail[Wesnoth-commits] r20091 - /trunk/src/menu_events.cpp


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

Header


Content

Posted by esr on September 04, 2007 - 03:39:
Author: esr
Date: Tue Sep  4 03:39:17 2007
New Revision: 20091

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20091&view=rev
Log:
Make the save performance message indicate which file has been saved.

Modified:
    trunk/src/menu_events.cpp

Modified: trunk/src/menu_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/menu_events.cpp?rev=20091&r1=20090&r2=20091&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Tue Sep  4 03:39:17 2007
@@ -806,20 +806,20 @@
                Uint32 start, end;
                start = SDL_GetTicks();
                config snapshot;
-
+               std::string savename;
+               if (label.empty())
+                       savename = _("Auto-Save");
+               else
+                       savename = label + "-" + _("Auto-Save") + 
lexical_cast<std::string>(turn);
                write_game_snapshot(snapshot);
                try {
-                       if (label.empty()) {
-                               recorder.save_game(_("Auto-Save"), snapshot, 
starting_pos);
-                       } else {
-                               recorder.save_game(label + "-" + 
_("Auto-Save") + lexical_cast<std::string>(turn), snapshot, starting_pos);
-                       }
+                       recorder.save_game(savename, snapshot, starting_pos);
                } catch(game::save_game_failed&) {
                        gui::message_dialog(*gui_,"",_("Could not auto save 
the game. Please save the game manually.")).show();
                        //do not bother retrying, since the user can just 
save the game
                }
                end = SDL_GetTicks();
-               std::cerr << "Milliseconds to save: " << end - start << "\n";
+               std::cerr << "Milliseconds to save " << savename << ": " << 
end - start << "\n";
        }
 
        void menu_handler::load_game(){




Related Messages


Powered by MHonArc, Updated Tue Sep 04 04:00:14 2007