Author: mordante
Date: Sat Apr 25 18:20:52 2009
New Revision: 35200

URL: http://svn.gna.org/viewcvs/wesnoth?rev=35200&view=rev
Log:
Add more logging.

Modified:
    trunk/src/gui/widgets/window.cpp

Modified: trunk/src/gui/widgets/window.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/window.cpp?rev=35200&r1=35199&r2=35200&view=diff
==============================================================================
--- trunk/src/gui/widgets/window.cpp (original)
+++ trunk/src/gui/widgets/window.cpp Sat Apr 25 18:20:52 2009
@@ -805,6 +805,8 @@
 bool twindow::NEW_layout(
                const unsigned maximum_width, const unsigned maximum_height)
 {
+       log_scope2(log_gui_layout, std::string("Window: ") + __func__);
+
        /*
         * For now we return the status, need to test later whether this can
         * entirely be converted to an exception based system as in 'promised' 
on
@@ -813,9 +815,13 @@
 
        tpoint size = get_best_size();
 
+       DBG_GUI_L << "Best size : " << size
+                       << " maximum size : " << maximum_width << ',' << 
maximum_height
+                       << ".\n";
        if(size.x <= static_cast<int>(maximum_width)
                        && size.y <= static_cast<int>(maximum_height)) {
 
+               DBG_GUI_L << "Result: Fits, nothing to do.\n";
                return true;
        }
 
@@ -824,8 +830,13 @@
 
                size = get_best_size();
                if(size.x > static_cast<int>(maximum_width)) {
+                       DBG_GUI_L << "Result: Resize width failed."
+                               << " Wanted width " << maximum_width
+                               << " resulting width " << size.x
+                               << ".\n";
                        return false;
                }
+               DBG_GUI_L << "Status: Resize width succeeded.\n";
        }
 
        if(size.y > static_cast<int>(maximum_height)) {
@@ -833,13 +844,19 @@
 
                size = get_best_size();
                if(size.y > static_cast<int>(maximum_height)) {
+                       DBG_GUI_L << "Result: Resize height failed."
+                               << " Wanted height " << maximum_height
+                               << " resulting height " << size.y
+                               << ".\n";
                        return false;
                }
+               DBG_GUI_L << "Status: Resize height succeeded.\n";
        }
 
        assert(size.x <= static_cast<int>(maximum_width)
                        && size.y <= static_cast<int>(maximum_height));
 
+       DBG_GUI_L << "Result: Resizing succeeded.\n";
        return true;
 }
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to