summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-08-19 16:22:31 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-08-19 16:36:51 (GMT)
commitf416fe2749a959ad26544ead709683d3800059e4 (patch)
tree2813851a656f98300cba2dd7e1cf47597b19d891 /Swift/QtUI
parentb44ed4b36505ece31f29cdd0803af9949463f94b (diff)
downloadswift-f416fe2749a959ad26544ead709683d3800059e4.zip
swift-f416fe2749a959ad26544ead709683d3800059e4.tar.bz2
Extract dir providing functionality from application class.
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtSwift.cpp10
-rw-r--r--Swift/QtUI/QtSwift.h4
2 files changed, 11 insertions, 3 deletions
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 57b4edf..84ae3a1 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -21,7 +21,9 @@
#include <QSplitter>
#include "Swiften/Application/Application.h"
-#include "Swiften/Application/Platform/PlatformApplication.h"
+#include "Swiften/Application/PlatformApplication.h"
+#include "Swiften/Application/PlatformApplicationPathProvider.h"
+#include "Swiften/Avatars/AvatarFileStorage.h"
#include "Swiften/Base/String.h"
#include "Swiften/Base/Platform.h"
#include "Swiften/Elements/Presence.h"
@@ -66,9 +68,11 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) {
int numberOfAccounts = options["multi-account"].as<int>();
- tabs_ = options.count("no-tabs") && !splitter_ > 0 ? NULL : new QtChatTabs();
+ tabs_ = options.count("no-tabs") && !(splitter_ > 0) ? NULL : new QtChatTabs();
settings_ = new QtSettingsProvider();
application_ = new PlatformApplication(SWIFT_APPLICATION_NAME);
+ applicationPathProvider_ = new PlatformApplicationPathProvider(SWIFT_APPLICATION_NAME);
+ avatarStorage_ = new AvatarFileStorage(applicationPathProvider_->getAvatarDir());
chatWindowFactory_ = new QtChatWindowFactory(splitter_, settings_, tabs_);
soundPlayer_ = new QtSoundPlayer();
if (splitter_) {
@@ -90,7 +94,7 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) {
chatListWindowFactories_.push_back(chatListWindowFactory);
QtMUCSearchWindowFactory* mucSearchWindowFactory = new QtMUCSearchWindowFactory();
mucSearchWindowFactories_.push_back(mucSearchWindowFactory);
- MainController* mainController = new MainController(chatWindowFactory_, rosterWindowFactory, loginWindowFactory, eventWindowFactory, settings_, application_, systemTray, soundPlayer_, xmlConsoleWidgetFactory, chatListWindowFactory, mucSearchWindowFactory, options.count("latency-debug") > 0);
+ MainController* mainController = new MainController(chatWindowFactory_, rosterWindowFactory, loginWindowFactory, eventWindowFactory, settings_, application_, systemTray, soundPlayer_, xmlConsoleWidgetFactory, chatListWindowFactory, mucSearchWindowFactory, avatarStorage_, application_->getApplicationMessageDisplay(), options.count("latency-debug") > 0);
mainControllers_.push_back(mainController);
}
diff --git a/Swift/QtUI/QtSwift.h b/Swift/QtUI/QtSwift.h
index 567af32..d205f9f 100644
--- a/Swift/QtUI/QtSwift.h
+++ b/Swift/QtUI/QtSwift.h
@@ -24,6 +24,8 @@ class QSplitter;
namespace Swift {
class AutoUpdater;
class Application;
+ class ApplicationPathProvider;
+ class AvatarStorage;
class MainController;
class QtChatWindowFactory;
class QtMainWindowFactory;
@@ -57,6 +59,8 @@ namespace Swift {
QtSoundPlayer* soundPlayer_;
QtChatTabs* tabs_;
Application* application_;
+ ApplicationPathProvider* applicationPathProvider_;
+ AvatarStorage* avatarStorage_;
AutoUpdater* autoUpdater_;
};