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/Controllers
parentb44ed4b36505ece31f29cdd0803af9949463f94b (diff)
downloadswift-f416fe2749a959ad26544ead709683d3800059e4.zip
swift-f416fe2749a959ad26544ead709683d3800059e4.tar.bz2
Extract dir providing functionality from application class.
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/MainController.cpp8
-rw-r--r--Swift/Controllers/MainController.h5
2 files changed, 7 insertions, 6 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index 22e78fe..f010c49 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -64,9 +64,8 @@ static const String CLIENT_VERSION = "1.0-devel";
static const String CLIENT_NODE = "http://swift.im";
-MainController::MainController(ChatWindowFactory* chatWindowFactory, MainWindowFactory *mainWindowFactory, LoginWindowFactory *loginWindowFactory, EventWindowFactory* eventWindowFactory, SettingsProvider *settings, Application* application, SystemTray* systemTray, SoundPlayer* soundPlayer, XMLConsoleWidgetFactory* xmlConsoleWidgetFactory, ChatListWindowFactory* chatListWindowFactory, MUCSearchWindowFactory* mucSearchWindowFactory, bool useDelayForLatency)
+MainController::MainController(ChatWindowFactory* chatWindowFactory, MainWindowFactory *mainWindowFactory, LoginWindowFactory *loginWindowFactory, EventWindowFactory* eventWindowFactory, SettingsProvider *settings, Application* application, SystemTray* systemTray, SoundPlayer* soundPlayer, XMLConsoleWidgetFactory* xmlConsoleWidgetFactory, ChatListWindowFactory* chatListWindowFactory, MUCSearchWindowFactory* mucSearchWindowFactory, AvatarStorage* avatarStorage, ApplicationMessageDisplay* applicationMessageDisplay, bool useDelayForLatency)
: timerFactory_(&boostIOServiceThread_.getIOService()), idleDetector_(&idleQuerier_, &timerFactory_, 100), chatWindowFactory_(chatWindowFactory), mainWindowFactory_(mainWindowFactory), loginWindowFactory_(loginWindowFactory), settings_(settings), loginWindow_(NULL), useDelayForLatency_(useDelayForLatency) {
- application_ = application;
presenceOracle_ = NULL;
avatarManager_ = NULL;
chatsManager_ = NULL;
@@ -86,10 +85,11 @@ MainController::MainController(ChatWindowFactory* chatWindowFactory, MainWindowF
timeBeforeNextReconnect_ = -1;
mucSearchWindowFactory_ = mucSearchWindowFactory;
eventWindowFactory_ = eventWindowFactory;
+ applicationMessageDisplay_ = applicationMessageDisplay;
chatListWindowFactory_ = chatListWindowFactory;
uiEventStream_ = new UIEventStream();
- avatarStorage_ = new AvatarFileStorage(application_->getAvatarDir());
+ avatarStorage_ = avatarStorage;
eventController_ = new EventController();
eventController_->onEventQueueLengthChange.connect(boost::bind(&MainController::handleEventQueueLengthChange, this, _1));
@@ -249,7 +249,7 @@ void MainController::handleConnected() {
}
void MainController::handleEventQueueLengthChange(int count) {
- application_->getApplicationMessageDisplay()->setMessage(count == 0 ? "" : boost::lexical_cast<std::string>(count).c_str());
+ applicationMessageDisplay_->setMessage(count == 0 ? "" : boost::lexical_cast<std::string>(count).c_str());
}
void MainController::reconnectAfterError() {
diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/MainController.h
index f17bc9b..2bda61a 100644
--- a/Swift/Controllers/MainController.h
+++ b/Swift/Controllers/MainController.h
@@ -42,6 +42,7 @@ namespace Swift {
class XMPPRosterController;
class PresenceSender;
class DiscoInfoResponder;
+ class ApplicationMessageDisplay;
class AvatarManager;
class LoginWindow;
class EventLoop;
@@ -64,7 +65,7 @@ namespace Swift {
class MainController {
public:
- MainController(ChatWindowFactory* chatWindowFactory, MainWindowFactory *mainWindowFactory, LoginWindowFactory *loginWindowFactory, EventWindowFactory* eventWindowFactory, SettingsProvider *settings, Application* application, SystemTray* systemTray, SoundPlayer* soundPlayer, XMLConsoleWidgetFactory* xmlConsoleWidgetFactory, ChatListWindowFactory* chatListWindowFactory_, MUCSearchWindowFactory* mucSearchWindowFactory, bool useDelayForLatency);
+ MainController(ChatWindowFactory* chatWindowFactory, MainWindowFactory *mainWindowFactory, LoginWindowFactory *loginWindowFactory, EventWindowFactory* eventWindowFactory, SettingsProvider *settings, Application* application, SystemTray* systemTray, SoundPlayer* soundPlayer, XMLConsoleWidgetFactory* xmlConsoleWidgetFactory, ChatListWindowFactory* chatListWindowFactory_, MUCSearchWindowFactory* mucSearchWindowFactory, AvatarStorage* avatarStorage, ApplicationMessageDisplay* applicationMessageDisplay, bool useDelayForLatency);
~MainController();
@@ -101,8 +102,8 @@ namespace Swift {
LoginWindowFactory* loginWindowFactory_;
EventWindowFactory* eventWindowFactory_;
SettingsProvider *settings_;
- Application* application_;
AvatarStorage* avatarStorage_;
+ ApplicationMessageDisplay* applicationMessageDisplay_;
ChatController* chatController_;
XMPPRosterController* xmppRosterController_;
RosterController* rosterController_;