Author: mordante
Date: Thu May 17 18:21:53 2012
New Revision: 54185

URL: http://svn.gna.org/viewcvs/wesnoth?rev=54185&view=rev
Log:
Made load_config a non virtual function.

It was defined virtual in twidget but only overriden in tcontrol. So
added it there as a non-virtual function.

Also made it private since most code doesn't really use the function and
that part of the code is a bit more tricky as it should.

Modified:
    trunk/src/gui/widgets/control.hpp
    trunk/src/gui/widgets/widget.hpp

Modified: trunk/src/gui/widgets/control.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/control.hpp?rev=54185&r1=54184&r2=54185&view=diff
==============================================================================
--- trunk/src/gui/widgets/control.hpp (original)
+++ trunk/src/gui/widgets/control.hpp Thu May 17 18:21:53 2012
@@ -139,17 +139,28 @@
 
        /***** ***** ***** ***** Inherited ***** ***** ***** *****/
 
-       /**
-        * Inherited from twidget.
-        *
-        * This function shouldn't be called directly it's called by 
set_definition().
-        * All classes which use this class as base should call this function in
-        * their constructor. Abstract classes shouldn't call this routine. The
-        *
-        * classes which call this routine should also define 
get_control_type().
+private:
+
+       /**
+        * Loads the configuration of the widget.
+        *
+        * Controls have their definition stored in a definition object. In 
order to
+        * determine sizes and drawing the widget this definition needs to be
+        * loaded. The member definition_ contains the name of the definition 
and
+        * function load the proper configuration.
         */
        void load_config();
 
+       /**
+        * Uses the load function.
+        *
+        * @note This doesn't look really clean, but the final goal is refactor
+        * more code and call load_config in the ctor, removing the use case for
+        * the window. That however is a longer termine refactoring.
+        */
+       friend class twindow;
+
+public:
        /** Inherited from twidget. */
        twidget* find_at(const tpoint& coordinate, const bool must_be_active)
        {

Modified: trunk/src/gui/widgets/widget.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/widget.hpp?rev=54185&r1=54184&r2=54185&view=diff
==============================================================================
--- trunk/src/gui/widgets/widget.hpp (original)
+++ trunk/src/gui/widgets/widget.hpp Thu May 17 18:21:53 2012
@@ -56,16 +56,6 @@
        twidget();
 
        virtual ~twidget();
-
-       /**
-        * Loads the configuration of the widget.
-        *
-        * Controls have their definition stored in a definition object. In 
order to
-        * determine sizes and drawing the widget this definition needs to be
-        * loaded. The member definition_ contains the name of the definition 
and
-        * function load the proper configuration.
-        */
-       virtual void load_config() {}
 
        /***** ***** ***** ***** flags ***** ***** ***** *****/
 


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

Reply via email to