diff options
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/MainController.cpp | 2 | ||||
-rw-r--r-- | Swift/Controllers/UIEvents/RequestViewHistoryUIEvent.h | 2 | ||||
-rw-r--r-- | Swift/Controllers/UIInterfaces/ViewHistoryWindow.h | 3 | ||||
-rw-r--r-- | Swift/Controllers/ViewHistoryController.cpp | 12 | ||||
-rw-r--r-- | Swift/Controllers/ViewHistoryController.h | 2 |
5 files changed, 9 insertions, 12 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index ce3847c..61f9584 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -274,7 +274,7 @@ void MainController::handleConnected() { rosterController_->onSignOutRequest.connect(boost::bind(&MainController::signOut, this)); contactEditController_ = new ContactEditController(rosterController_, uiFactory_, uiEventStream_); - viewHistoryController_ = new ViewHistoryController(rosterController_, uiFactory_, uiEventStream_); + viewHistoryController_ = new ViewHistoryController(uiFactory_, uiEventStream_); chatsManager_ = new ChatsManager(jid_, client_->getStanzaChannel(), client_->getIQRouter(), eventController_, uiFactory_, uiFactory_, client_->getNickResolver(), client_->getPresenceOracle(), client_->getPresenceSender(), uiEventStream_, uiFactory_, useDelayForLatency_, networkFactories_->getTimerFactory(), client_->getMUCRegistry(), client_->getEntityCapsProvider(), client_->getMUCManager(), uiFactory_, profileSettings_); client_->onMessageReceived.connect(boost::bind(&ChatsManager::handleIncomingMessage, chatsManager_, _1)); diff --git a/Swift/Controllers/UIEvents/RequestViewHistoryUIEvent.h b/Swift/Controllers/UIEvents/RequestViewHistoryUIEvent.h index 22ad2d8..884adfd 100644 --- a/Swift/Controllers/UIEvents/RequestViewHistoryUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestViewHistoryUIEvent.h @@ -13,7 +13,7 @@ namespace Swift { class RequestViewHistoryUIEvent : public UIEvent { public: typedef boost::shared_ptr <RequestViewHistoryUIEvent> ref; - RequestViewHistoryUIEvent(const JID& jid = NULL) : jid(jid) { + RequestViewHistoryUIEvent(const JID& jid = "") : jid(jid) { } const JID& getJID() const { diff --git a/Swift/Controllers/UIInterfaces/ViewHistoryWindow.h b/Swift/Controllers/UIInterfaces/ViewHistoryWindow.h index 18ac86e..b5d8a69 100644 --- a/Swift/Controllers/UIInterfaces/ViewHistoryWindow.h +++ b/Swift/Controllers/UIInterfaces/ViewHistoryWindow.h @@ -12,8 +12,7 @@ namespace Swift { class ViewHistoryWindow { public: virtual ~ViewHistoryWindow() {}; - virtual void setEnabled(bool b) = 0; + virtual void setEnabled(bool enabled) = 0; virtual void show() = 0; - virtual void hide() = 0; }; } diff --git a/Swift/Controllers/ViewHistoryController.cpp b/Swift/Controllers/ViewHistoryController.cpp index 0aaacdf..19b4abb 100644 --- a/Swift/Controllers/ViewHistoryController.cpp +++ b/Swift/Controllers/ViewHistoryController.cpp @@ -12,11 +12,10 @@ #include <Swift/Controllers/UIEvents/RequestViewHistoryUIEvent.h> #include <Swift/Controllers/UIEvents/UIEventStream.h> #include <Swift/Controllers/UIInterfaces/ViewHistoryWindowFactory.h> -#include <Swift/Controllers/Roster/RosterController.h> namespace Swift { -ViewHistoryController::ViewHistoryController(RosterController* rosterController, ViewHistoryWindowFactory* viewHistoryWindowFactory, UIEventStream* uiEventStream): rosterController(rosterController), viewHistoryWindowFactory(viewHistoryWindowFactory), uiEventStream(uiEventStream), viewHistoryWindow(NULL) { +ViewHistoryController::ViewHistoryController(ViewHistoryWindowFactory* viewHistoryWindowFactory, UIEventStream* uiEventStream): rosterController(rosterController), viewHistoryWindowFactory(viewHistoryWindowFactory), uiEventStream(uiEventStream), viewHistoryWindow(NULL) { uiEventStream->onUIEvent.connect(boost::bind(&ViewHistoryController::handleUIEvent, this, _1)); } @@ -26,15 +25,14 @@ ViewHistoryController::~ViewHistoryController() { void ViewHistoryController::handleUIEvent(UIEvent::ref event) { RequestViewHistoryUIEvent::ref viewHistoryEvent = boost::dynamic_pointer_cast<RequestViewHistoryUIEvent>(event); - if (!viewHistoryWindow) { + if (viewHistoryEvent) { viewHistoryWindow = viewHistoryWindowFactory->createViewHistoryWindow(); } } -void ViewHistoryController::setAvailable(bool b) { - if (viewHistoryWindow) { - viewHistoryWindow->setEnabled(b); - } +void ViewHistoryController::setAvailable(bool enabled) { + /* This will disable some function when the time comes */ + enabled = false; /* only to avoid warnings for now */ } } diff --git a/Swift/Controllers/ViewHistoryController.h b/Swift/Controllers/ViewHistoryController.h index f306d19..1e806f9 100644 --- a/Swift/Controllers/ViewHistoryController.h +++ b/Swift/Controllers/ViewHistoryController.h @@ -15,7 +15,7 @@ namespace Swift { class RosterController; class ViewHistoryController { public: - ViewHistoryController(RosterController* rosterController, ViewHistoryWindowFactory* viewHistoryWindowFactory, UIEventStream* uiEventStream); + ViewHistoryController(ViewHistoryWindowFactory* viewHistoryWindowFactory, UIEventStream* uiEventStream); ~ViewHistoryController(); void setAvailable(bool b); |