summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtSwift.cpp')
-rw-r--r--Swift/QtUI/QtSwift.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
new file mode 100644
index 0000000..e7d4152
--- /dev/null
+++ b/Swift/QtUI/QtSwift.cpp
@@ -0,0 +1,43 @@
+#include "QtSwift.h"
+
+#include "QtLoginWindowFactory.h"
+#include "QtChatWindowFactory.h"
+#include "QtMainWindowFactory.h"
+#include "QtTreeWidgetFactory.h"
+
+#include <boost/bind.hpp>
+
+#include "Swiften/Application/Application.h"
+#include "Swiften/Application/Platform/PlatformApplication.h"
+#include "Swiften/Base/String.h"
+#include "Swiften/Elements/Presence.h"
+#include "Swiften/Client/Client.h"
+#include "Swiften/Controllers/ChatController.h"
+#include "Swiften/Controllers/MainController.h"
+
+namespace Swift{
+
+QtSwift::QtSwift() :
+ treeWidgetFactory_(new QtTreeWidgetFactory()),
+ chatWindowFactory_(new QtChatWindowFactory(treeWidgetFactory_)),
+ rosterWindowFactory_(new QtMainWindowFactory(treeWidgetFactory_)),
+ loginWindowFactory_(new QtLoginWindowFactory()) {
+ QCoreApplication::setApplicationName("Swift");
+ QCoreApplication::setOrganizationName("Swift");
+ QCoreApplication::setOrganizationDomain("swift.im");
+ settings_ = new QtSettingsProvider();
+ application_ = new PlatformApplication("Swift");
+ mainController_ = new MainController(chatWindowFactory_, rosterWindowFactory_, loginWindowFactory_, treeWidgetFactory_, settings_, application_);
+}
+
+QtSwift::~QtSwift() {
+ delete chatWindowFactory_;
+ delete rosterWindowFactory_;
+ delete loginWindowFactory_;
+ delete treeWidgetFactory_;
+ delete mainController_;
+ delete settings_;
+ delete application_;
+}
+
+}