Andre Poenitz wrote:
I plan to 'manually expand' the current uses QController as in the
attached patch.

The result is not only shorter but also simpler. No need for a template
with a template argument (QController) anymore.

Maybe I'll arrive at a point where I understand the code at some time...
Abdel should comment on this before anything happens. I have a dim understanding of where his version of MVC is headed here. But my sense is that the QStuff.* vs QStuffDialog.* division is important. The former is a Qt-specialized controller, whereas the latter is the real view. If that helps.... Of course., the ERT files, in particular, aren't yet adapted to that framework, so far as I know.

rh
Andre'
------------------------------------------------------------------------

Index: GuiERT.h
===================================================================
--- GuiERT.h    (revision 19953)
+++ GuiERT.h    (working copy)
@@ -14,6 +14,7 @@
#include "GuiDialogView.h"
 #include "ui_ERTUi.h"
+#include "controllers/ControlERT.h"
#include <QCloseEvent>
 #include <QDialog>
@@ -36,16 +37,16 @@
 };
-
-class ControlERT;
-
-class GuiERT : public QController<ControlERT, GuiView<GuiERTDialog> >
-{
+class GuiERT : public GuiView<GuiERTDialog> {
 public:
-       friend class GuiERTDialog;
-
+       /// constructor
        GuiERT(Dialog &);
+       ControlERT & controller()
+       { return static_cast<ControlERT &>(this->getController()); }
+       ControlERT const & controller() const
+       { return static_cast<ControlERT const &>(this->getController()); }
 private:
+       friend class GuiERTDialog;
        /// Apply changes
        virtual void apply();
        /// update
Index: GuiERT.cpp
===================================================================
--- GuiERT.cpp  (revision 19953)
+++ GuiERT.cpp  (working copy)
@@ -13,8 +13,6 @@
 #include "GuiERT.h"
 #include "Qt2BC.h"
-#include "controllers/ControlERT.h"
-
 #include <QRadioButton>
 #include <QPushButton>
 #include <QCloseEvent>
@@ -60,11 +58,8 @@
 //
 /////////////////////////////////////////////////////////////////////
-typedef QController<ControlERT, GuiView<GuiERTDialog> > ERTBase;
-
-
 GuiERT::GuiERT(Dialog & parent)
-       : ERTBase(parent, _("TeX Code Settings"))
+       : GuiView<GuiERTDialog>(parent, _("TeX Code Settings"))
 {
 }


--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Reply via email to