diff options
author | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2018-07-19 17:13:55 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2018-07-19 18:40:10 (GMT) |
commit | 5b4a0ba19ae6994db6a193a231fd2486bff6f0ec (patch) | |
tree | eb5616c9977d0a76c0442879fce4cdc023e19c4e /Swift | |
parent | cc4bdf756f3e9f9451231d59d2b5dcacd1af6d1e (diff) | |
download | swift-5b4a0ba19ae6994db6a193a231fd2486bff6f0ec.zip swift-5b4a0ba19ae6994db6a193a231fd2486bff6f0ec.tar.bz2 |
Rename MainController to AccountController
Change-Id: I9c006a2435294f2afb95a95bd856ad64274a8752
Test-Information:
None.
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/Controllers/AccountController.cpp (renamed from Swift/Controllers/MainController.cpp) | 96 | ||||
-rw-r--r-- | Swift/Controllers/AccountController.h (renamed from Swift/Controllers/MainController.h) | 6 | ||||
-rw-r--r-- | Swift/Controllers/SConscript | 2 | ||||
-rw-r--r-- | Swift/QtUI/QtSwift.cpp | 10 | ||||
-rw-r--r-- | Swift/QtUI/QtSwift.h | 4 |
5 files changed, 59 insertions, 59 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/AccountController.cpp index 91140c2..048d140 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/AccountController.cpp @@ -6,3 +6,3 @@ -#include <Swift/Controllers/MainController.h> +#include <Swift/Controllers/AccountController.h> @@ -101,3 +101,3 @@ static const std::string CLIENT_NODE = "http://swift.im"; -MainController::MainController( +AccountController::AccountController( EventLoop* eventLoop, @@ -162,3 +162,3 @@ MainController::MainController( eventController_ = new EventController(); - eventController_->onEventQueueLengthChange.connect(boost::bind(&MainController::handleEventQueueLengthChange, this, _1)); + eventController_->onEventQueueLengthChange.connect(boost::bind(&AccountController::handleEventQueueLengthChange, this, _1)); @@ -175,9 +175,9 @@ MainController::MainController( - loginWindow_->onLoginRequest.connect(boost::bind(&MainController::handleLoginRequest, this, _1, _2, _3, _4, _5, _6, _7)); - loginWindow_->onPurgeSavedLoginRequest.connect(boost::bind(&MainController::handlePurgeSavedLoginRequest, this, _1)); - loginWindow_->onCancelLoginRequest.connect(boost::bind(&MainController::handleCancelLoginRequest, this)); - loginWindow_->onQuitRequest.connect(boost::bind(&MainController::handleQuitRequest, this)); + loginWindow_->onLoginRequest.connect(boost::bind(&AccountController::handleLoginRequest, this, _1, _2, _3, _4, _5, _6, _7)); + loginWindow_->onPurgeSavedLoginRequest.connect(boost::bind(&AccountController::handlePurgeSavedLoginRequest, this, _1)); + loginWindow_->onCancelLoginRequest.connect(boost::bind(&AccountController::handleCancelLoginRequest, this)); + loginWindow_->onQuitRequest.connect(boost::bind(&AccountController::handleQuitRequest, this)); idleDetector_->setIdleTimeSeconds(settings->getSetting(SettingConstants::IDLE_TIMEOUT)); - idleDetector_->onIdleChanged.connect(boost::bind(&MainController::handleInputIdleChanged, this, _1)); + idleDetector_->onIdleChanged.connect(boost::bind(&AccountController::handleInputIdleChanged, this, _1)); @@ -187,3 +187,3 @@ MainController::MainController( - settings_->onSettingChanged.connect(boost::bind(&MainController::handleSettingChanged, this, _1)); + settings_->onSettingChanged.connect(boost::bind(&AccountController::handleSettingChanged, this, _1)); @@ -191,4 +191,4 @@ MainController::MainController( -MainController::~MainController() { - idleDetector_->onIdleChanged.disconnect(boost::bind(&MainController::handleInputIdleChanged, this, _1)); +AccountController::~AccountController() { + idleDetector_->onIdleChanged.disconnect(boost::bind(&AccountController::handleInputIdleChanged, this, _1)); @@ -211,3 +211,3 @@ MainController::~MainController() { -void MainController::purgeCachedCredentials() { +void AccountController::purgeCachedCredentials() { safeClear(password_); @@ -215,3 +215,3 @@ void MainController::purgeCachedCredentials() { -void MainController::resetClient() { +void AccountController::resetClient() { purgeCachedCredentials(); @@ -277,3 +277,3 @@ void MainController::resetClient() { -void MainController::handleSettingChanged(const std::string& settingPath) { +void AccountController::handleSettingChanged(const std::string& settingPath) { if (settingPath == SettingConstants::SHOW_NOTIFICATIONS.getKey()) { @@ -283,3 +283,3 @@ void MainController::handleSettingChanged(const std::string& settingPath) { -void MainController::resetPendingReconnects() { +void AccountController::resetPendingReconnects() { timeBeforeNextReconnect_ = -1; @@ -292,3 +292,3 @@ void MainController::resetPendingReconnects() { -void MainController::resetCurrentError() { +void AccountController::resetCurrentError() { if (lastDisconnectError_) { @@ -299,3 +299,3 @@ void MainController::resetCurrentError() { -void MainController::handleConnected() { +void AccountController::handleConnected() { boundJID_ = client_->getJID(); @@ -317,5 +317,5 @@ void MainController::handleConnected() { rosterController_ = new RosterController(boundJID_, client_->getRoster(), client_->getAvatarManager(), uiFactory_, client_->getNickManager(), client_->getNickResolver(), client_->getPresenceOracle(), client_->getSubscriptionManager(), eventController_, uiEventStream_, client_->getIQRouter(), settings_, client_->getEntityCapsProvider(), client_->getClientBlockListManager(), client_->getVCardManager(), *chattables_); - rosterController_->onChangeStatusRequest.connect(boost::bind(&MainController::handleChangeStatusRequest, this, _1, _2)); - rosterController_->onSignOutRequest.connect(boost::bind(&MainController::signOut, this)); - rosterController_->getWindow()->onShowCertificateRequest.connect(boost::bind(&MainController::handleShowCertificateRequest, this)); + rosterController_->onChangeStatusRequest.connect(boost::bind(&AccountController::handleChangeStatusRequest, this, _1, _2)); + rosterController_->onSignOutRequest.connect(boost::bind(&AccountController::signOut, this)); + rosterController_->getWindow()->onShowCertificateRequest.connect(boost::bind(&AccountController::handleShowCertificateRequest, this)); @@ -384,3 +384,3 @@ void MainController::handleConnected() { GetDiscoInfoRequest::ref discoInfoRequest = GetDiscoInfoRequest::create(JID(boundJID_.getDomain()), client_->getIQRouter()); - discoInfoRequest->onResponse.connect(boost::bind(&MainController::handleServerDiscoInfoResponse, this, _1, _2)); + discoInfoRequest->onResponse.connect(boost::bind(&AccountController::handleServerDiscoInfoResponse, this, _1, _2)); discoInfoRequest->send(); @@ -403,3 +403,3 @@ void MainController::handleConnected() { -void MainController::handleEventQueueLengthChange(int count) { +void AccountController::handleEventQueueLengthChange(int count) { dock_->setNumberOfPendingMessages(count); @@ -407,3 +407,3 @@ void MainController::handleEventQueueLengthChange(int count) { -void MainController::reconnectAfterError() { +void AccountController::reconnectAfterError() { if (reconnectTimer_) { @@ -414,3 +414,3 @@ void MainController::reconnectAfterError() { -void MainController::handleChangeStatusRequest(StatusShow::Type show, const std::string &statusText) { +void AccountController::handleChangeStatusRequest(StatusShow::Type show, const std::string &statusText) { std::shared_ptr<Presence> presence(new Presence()); @@ -440,3 +440,3 @@ void MainController::handleChangeStatusRequest(StatusShow::Type show, const std: -void MainController::sendPresence(std::shared_ptr<Presence> presence) { +void AccountController::sendPresence(std::shared_ptr<Presence> presence) { rosterController_->getWindow()->setMyStatusType(presence->getShow()); @@ -454,3 +454,3 @@ void MainController::sendPresence(std::shared_ptr<Presence> presence) { -void MainController::handleInputIdleChanged(bool idle) { +void AccountController::handleInputIdleChanged(bool idle) { if (!statusTracker_) { @@ -482,3 +482,3 @@ void MainController::handleInputIdleChanged(bool idle) { -void MainController::handleShowCertificateRequest() { +void AccountController::handleShowCertificateRequest() { std::vector<Certificate::ref> chain = client_->getStanzaChannel()->getPeerCertificateChain(); @@ -487,3 +487,3 @@ void MainController::handleShowCertificateRequest() { -void MainController::handleLoginRequest(const std::string &username, const std::string &password, const std::string& certificatePath, CertificateWithKey::ref certificate, const ClientOptions& options, bool remember, bool loginAutomatically) { +void AccountController::handleLoginRequest(const std::string &username, const std::string &password, const std::string& certificatePath, CertificateWithKey::ref certificate, const ClientOptions& options, bool remember, bool loginAutomatically) { jid_ = JID(username); @@ -535,3 +535,3 @@ void MainController::handleLoginRequest(const std::string &username, const std:: -void MainController::handlePurgeSavedLoginRequest(const std::string& username) { +void AccountController::handlePurgeSavedLoginRequest(const std::string& username) { settings_->removeProfile(username); @@ -540,3 +540,3 @@ void MainController::handlePurgeSavedLoginRequest(const std::string& username) { -void MainController::performLoginFromCachedCredentials() { +void AccountController::performLoginFromCachedCredentials() { if (settings_->getSetting(SettingConstants::FORGET_PASSWORDS) && password_.empty()) { @@ -565,4 +565,4 @@ void MainController::performLoginFromCachedCredentials() { client_->onDataWritten.connect(boost::bind(&XMLConsoleController::handleDataWritten, xmlConsoleController_, _1)); - client_->onDisconnected.connect(boost::bind(&MainController::handleDisconnected, this, _1)); - client_->onConnected.connect(boost::bind(&MainController::handleConnected, this)); + client_->onDisconnected.connect(boost::bind(&AccountController::handleDisconnected, this, _1)); + client_->onConnected.connect(boost::bind(&AccountController::handleConnected, this)); @@ -570,7 +570,7 @@ void MainController::performLoginFromCachedCredentials() { - client_->getVCardManager()->onVCardChanged.connect(boost::bind(&MainController::handleVCardReceived, this, _1, _2)); + client_->getVCardManager()->onVCardChanged.connect(boost::bind(&AccountController::handleVCardReceived, this, _1, _2)); presenceNotifier_ = new PresenceNotifier(client_->getStanzaChannel(), notifier_, client_->getMUCRegistry(), client_->getAvatarManager(), client_->getNickResolver(), client_->getPresenceOracle(), networkFactories_->getTimerFactory()); - presenceNotifier_->onNotificationActivated.connect(boost::bind(&MainController::handleNotificationClicked, this, _1)); + presenceNotifier_->onNotificationActivated.connect(boost::bind(&AccountController::handleNotificationClicked, this, _1)); eventNotifier_ = new EventNotifier(eventController_, notifier_, client_->getAvatarManager(), client_->getNickResolver()); - eventNotifier_->onNotificationActivated.connect(boost::bind(&MainController::handleNotificationClicked, this, _1)); + eventNotifier_->onNotificationActivated.connect(boost::bind(&AccountController::handleNotificationClicked, this, _1)); if (certificate_) { @@ -597,3 +597,3 @@ void MainController::performLoginFromCachedCredentials() { -void MainController::handleDisconnected(const boost::optional<ClientError>& error) { +void AccountController::handleDisconnected(const boost::optional<ClientError>& error) { if (rosterController_) { @@ -702,3 +702,3 @@ void MainController::handleDisconnected(const boost::optional<ClientError>& erro -void MainController::setReconnectTimer() { +void AccountController::setReconnectTimer() { if (timeBeforeNextReconnect_ < 0) { @@ -712,3 +712,3 @@ void MainController::setReconnectTimer() { reconnectTimer_ = networkFactories_->getTimerFactory()->createTimer(timeBeforeNextReconnect_ * 1000); - reconnectTimer_->onTick.connect(boost::bind(&MainController::reconnectAfterError, this)); + reconnectTimer_->onTick.connect(boost::bind(&AccountController::reconnectAfterError, this)); reconnectTimer_->start(); @@ -716,3 +716,3 @@ void MainController::setReconnectTimer() { -void MainController::handleCancelLoginRequest() { +void AccountController::handleCancelLoginRequest() { signOut(); @@ -720,3 +720,3 @@ void MainController::handleCancelLoginRequest() { -void MainController::signOut() { +void AccountController::signOut() { if (settings_->getSetting(SettingConstants::FORGET_PASSWORDS)) { @@ -731,3 +731,3 @@ void MainController::signOut() { -void MainController::logout() { +void AccountController::logout() { if (settings_->getSetting(SettingConstants::FORGET_PASSWORDS)) { @@ -747,3 +747,3 @@ void MainController::logout() { -void MainController::setManagersOffline() { +void AccountController::setManagersOffline() { if (chatsManager_) { @@ -762,3 +762,3 @@ void MainController::setManagersOffline() { -void MainController::handleServerDiscoInfoResponse(std::shared_ptr<DiscoInfo> info, ErrorPayload::ref error) { +void AccountController::handleServerDiscoInfoResponse(std::shared_ptr<DiscoInfo> info, ErrorPayload::ref error) { if (!error) { @@ -776,3 +776,3 @@ void MainController::handleServerDiscoInfoResponse(std::shared_ptr<DiscoInfo> in -void MainController::enableMessageCarbons() { +void AccountController::enableMessageCarbons() { auto enableCarbonsRequest = EnableCarbonsRequest::create(client_->getIQRouter()); @@ -790,3 +790,3 @@ void MainController::enableMessageCarbons() { -void MainController::handleVCardReceived(const JID& jid, VCard::ref vCard) { +void AccountController::handleVCardReceived(const JID& jid, VCard::ref vCard) { if (!jid.equals(jid_, JID::WithoutResource) || !vCard) { @@ -806,3 +806,3 @@ void MainController::handleVCardReceived(const JID& jid, VCard::ref vCard) { -void MainController::handleNotificationClicked(const JID& jid) { +void AccountController::handleNotificationClicked(const JID& jid) { assert(chatsManager_); @@ -818,3 +818,3 @@ void MainController::handleNotificationClicked(const JID& jid) { -void MainController::handleQuitRequest() { +void AccountController::handleQuitRequest() { if (client_ && client_->isActive()) { @@ -837,3 +837,3 @@ void MainController::handleQuitRequest() { -std::string MainController::serializeClientOptions(const ClientOptions& options) { +std::string AccountController::serializeClientOptions(const ClientOptions& options) { std::string result; diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/AccountController.h index b345e0e..30ae265 100644 --- a/Swift/Controllers/MainController.h +++ b/Swift/Controllers/AccountController.h @@ -84,5 +84,5 @@ namespace Swift { - class MainController { + class AccountController { public: - MainController( + AccountController( EventLoop* eventLoop, @@ -101,3 +101,3 @@ namespace Swift { bool useDelayForLatency); - ~MainController(); + ~AccountController(); diff --git a/Swift/Controllers/SConscript b/Swift/Controllers/SConscript index 31b4541..cbd3bf3 100644 --- a/Swift/Controllers/SConscript +++ b/Swift/Controllers/SConscript @@ -53,3 +53,3 @@ if env["SCONS_STAGE"] == "build" : "HistoryViewController.cpp", - "MainController.cpp", + "AccountController.cpp", "PresenceNotifier.cpp", diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp index 28c7044..8de5d70 100644 --- a/Swift/QtUI/QtSwift.cpp +++ b/Swift/QtUI/QtSwift.cpp @@ -37,3 +37,3 @@ #include <Swift/Controllers/BuildVersion.h> -#include <Swift/Controllers/MainController.h> +#include <Swift/Controllers/AccountController.h> #include <Swift/Controllers/SettingConstants.h> @@ -301,3 +301,3 @@ QtSwift::~QtSwift() { } - for (auto* controller : mainControllers_) { + for (auto* controller : accountControllers_) { delete controller; @@ -405,3 +405,3 @@ QtLoginWindow* QtSwift::addAccount() { uiFactories_.push_back(uiFactory); - MainController* mainController = new MainController( + AccountController* accountController = new AccountController( &clientMainThreadCaller_, @@ -420,5 +420,5 @@ QtLoginWindow* QtSwift::addAccount() { useDelayForLatency_); - mainControllers_.push_back(mainController); + accountControllers_.push_back(accountController); - //FIXME - mainController has already created the window, so we can pass null here and get the old one + //FIXME - accountController has already created the window, so we can pass null here and get the old one auto loginWindow = uiFactory->createLoginWindow(nullptr); diff --git a/Swift/QtUI/QtSwift.h b/Swift/QtUI/QtSwift.h index d876cd8..811b6e4 100644 --- a/Swift/QtUI/QtSwift.h +++ b/Swift/QtUI/QtSwift.h @@ -45,3 +45,3 @@ namespace Swift { class EventLoop; - class MainController; + class AccountController; class Notifier; @@ -91,3 +91,3 @@ namespace Swift { QtChatWindowFactory* chatWindowFactory_; - std::vector<MainController*> mainControllers_; + std::vector<AccountController*> accountControllers_; std::vector<QtSystemTray*> systemTrays_; |