mail[Wesnoth-commits] r40391 - /trunk/src/gui/dialogs/game_load.cpp


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

Header


Content

Posted by koraq on December 25, 2009 - 11:03:
Author: mordante
Date: Fri Dec 25 11:03:52 2009
New Revision: 40391

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40391&view=rev
Log:
Slightly optimize the load game dialog.

Modified:
    trunk/src/gui/dialogs/game_load.cpp

Modified: trunk/src/gui/dialogs/game_load.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/game_load.cpp?rev=40391&r1=40390&r2=40391&view=diff
==============================================================================
--- trunk/src/gui/dialogs/game_load.cpp (original)
+++ trunk/src/gui/dialogs/game_load.cpp Fri Dec 25 11:03:52 2009
@@ -151,18 +151,15 @@
                return false;
        last_words_ = words;
 
-       std::vector<bool> show_items(list.get_item_count());
-
-       for (unsigned int i = 0; i < list.get_item_count(); i++){
-               tgrid* row = list.get_row_grid(i);
-
-               if (text == ""){
-                       show_items[i] = true;
-               }
-               else{
+       std::vector<bool> show_items(list.get_item_count(), true);
+
+       if(!text.empty()) {
+               for(unsigned int i = 0; i < list.get_item_count(); i++) {
+                       tgrid* row = list.get_row_grid(i);
+
                        tgrid::iterator it = row->begin();
                        tlabel& filename_label =
-                                       find_widget<tlabel>(*it, "filename", 
false);
+                               find_widget<tlabel>(*it, "filename", false);
 
                        bool found = false;
                        foreach (const std::string& word, words){
@@ -181,6 +178,7 @@
                        show_items[i] = found;
                }
        }
+
        list.set_row_shown(show_items);
 
        return false;




Related Messages


Powered by MHonArc, Updated Fri Dec 25 12:20:11 2009