summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-11-28 18:52:43 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-11-28 18:52:43 (GMT)
commit85dcc894ccf417ec8b057d868afb1d8006634ac4 (patch)
treeb32c7b747c91727c9caf00076c0b2468038242a7 /Swift/Controllers/XMLConsoleController.cpp
parent27f8faea9b516f45c932c6b36a626b78d92438d4 (diff)
downloadswift-85dcc894ccf417ec8b057d868afb1d8006634ac4.zip
swift-85dcc894ccf417ec8b057d868afb1d8006634ac4.tar.bz2
Some code cleanup.
Diffstat (limited to 'Swift/Controllers/XMLConsoleController.cpp')
-rw-r--r--Swift/Controllers/XMLConsoleController.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/Swift/Controllers/XMLConsoleController.cpp b/Swift/Controllers/XMLConsoleController.cpp
index ebc9912..4629573 100644
--- a/Swift/Controllers/XMLConsoleController.cpp
+++ b/Swift/Controllers/XMLConsoleController.cpp
@@ -1,25 +1,26 @@
#include "Swift/Controllers/XMLConsoleController.h"
#include "Swift/Controllers/UIInterfaces/XMLConsoleWidgetFactory.h"
-
#include "Swift/Controllers/UIEvents/RequestXMLConsoleUIEvent.h"
namespace Swift {
-XMLConsoleController::XMLConsoleController(UIEventStream* uiEventStream, XMLConsoleWidgetFactory* xmlConsoleWidgetFactory) {
- uiEventStream_ = uiEventStream;
- xmlConsoleWidgetFactory_ = xmlConsoleWidgetFactory;
- uiEventStream_->onUIEvent.connect(boost::bind(&XMLConsoleController::handleUIEvent, this, _1));
- xmlConsoleWidget_ = NULL;
+
+XMLConsoleController::XMLConsoleController(UIEventStream* uiEventStream, XMLConsoleWidgetFactory* xmlConsoleWidgetFactory) : xmlConsoleWidgetFactory(xmlConsoleWidgetFactory), xmlConsoleWidget(NULL) {
+ uiEventStream->onUIEvent.connect(boost::bind(&XMLConsoleController::handleUIEvent, this, _1));
+}
+
+XMLConsoleController::~XMLConsoleController() {
+ delete xmlConsoleWidget;
}
void XMLConsoleController::handleUIEvent(boost::shared_ptr<UIEvent> rawEvent) {
boost::shared_ptr<RequestXMLConsoleUIEvent> event = boost::dynamic_pointer_cast<RequestXMLConsoleUIEvent>(rawEvent);
if (event != NULL) {
- if (xmlConsoleWidget_ == NULL) {
- xmlConsoleWidget_ = xmlConsoleWidgetFactory_->createXMLConsoleWidget();
+ if (xmlConsoleWidget == NULL) {
+ xmlConsoleWidget = xmlConsoleWidgetFactory->createXMLConsoleWidget();
}
- xmlConsoleWidget_->show();
- xmlConsoleWidget_->activate();
+ xmlConsoleWidget->show();
+ xmlConsoleWidget->activate();
}
}