From dfaae6f6e804e7779ade870a211a1a14d3a5d9aa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Sep 2014 11:03:22 +0300 Subject: Remove getter for loginHandler. --- src/gui/windows/changeemaildialog.cpp | 6 ++---- src/gui/windows/changepassworddialog.cpp | 6 ++---- src/gui/windows/charselectdialog.cpp | 3 +-- src/gui/windows/logindialog.cpp | 4 ++-- src/gui/windows/registerdialog.cpp | 14 +++++--------- src/gui/windows/unregisterdialog.cpp | 6 ++---- src/gui/windows/worldselectdialog.cpp | 2 +- 7 files changed, 15 insertions(+), 26 deletions(-) (limited to 'src/gui/windows') diff --git a/src/gui/windows/changeemaildialog.cpp b/src/gui/windows/changeemaildialog.cpp index 84da15ead..408fdf9d4 100644 --- a/src/gui/windows/changeemaildialog.cpp +++ b/src/gui/windows/changeemaildialog.cpp @@ -130,10 +130,8 @@ void ChangeEmailDialog::action(const ActionEvent &event) std::stringstream errorMsg; int error = 0; - const unsigned int min = Net::getLoginHandler() - ->getMinPasswordLength(); - const unsigned int max = Net::getLoginHandler() - ->getMaxPasswordLength(); + const unsigned int min = loginHandler->getMinPasswordLength(); + const unsigned int max = loginHandler->getMaxPasswordLength(); if (newFirstEmail.length() < min) { diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp index 875fb2c3d..a5f97becb 100644 --- a/src/gui/windows/changepassworddialog.cpp +++ b/src/gui/windows/changepassworddialog.cpp @@ -110,10 +110,8 @@ void ChangePasswordDialog::action(const ActionEvent &event) std::stringstream errorMsg; int error = 0; - const unsigned int min = Net::getLoginHandler() - ->getMinPasswordLength(); - const unsigned int max = Net::getLoginHandler() - ->getMaxPasswordLength(); + const unsigned int min = loginHandler->getMinPasswordLength(); + const unsigned int max = loginHandler->getMaxPasswordLength(); // Check old Password if (oldPassword.empty()) diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index 95b3d6cfc..e2211d3fb 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -93,8 +93,7 @@ CharSelectDialog::CharSelectDialog(LoginData *const data) : setCloseButton(true); setFocusable(true); - const int optionalActions = Net::getLoginHandler() - ->supportedOptionalActions(); + const int optionalActions = loginHandler->supportedOptionalActions(); ContainerPlacer placer; placer = getPlacer(0, 0); diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index ffcbc8c69..0b642f224 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -193,7 +193,7 @@ void LoginDialog::postInit() mPassField->requestFocus(); mLoginButton->setEnabled(canSubmit()); - mRegisterButton->setEnabled(Net::getLoginHandler()->isRegistrationEnabled() + mRegisterButton->setEnabled(loginHandler->isRegistrationEnabled() || !mLoginData->registerUrl.empty()); } @@ -218,7 +218,7 @@ void LoginDialog::action(const ActionEvent &event) } else if (eventId == "register") { - if (Net::getLoginHandler()->isRegistrationEnabled()) + if (loginHandler->isRegistrationEnabled()) { prepareUpdate(); client->setState(STATE_REGISTER_PREP); diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index 7253c3630..5701395a7 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -73,7 +73,7 @@ RegisterDialog::RegisterDialog(LoginData *const data) : { setCloseButton(true); - const int optionalActions = Net::getLoginHandler()-> + const int optionalActions = loginHandler-> supportedOptionalActions(); // TRANSLATORS: register dialog. label. @@ -178,14 +178,10 @@ void RegisterDialog::action(const ActionEvent &event) std::string errorMsg; int error = 0; - const unsigned int minUser = Net::getLoginHandler() - ->getMinUserNameLength(); - const unsigned int maxUser = Net::getLoginHandler() - ->getMaxUserNameLength(); - const unsigned int minPass = Net::getLoginHandler() - ->getMinPasswordLength(); - const unsigned int maxPass = Net::getLoginHandler() - ->getMaxPasswordLength(); + const unsigned int minUser = loginHandler->getMinUserNameLength(); + const unsigned int maxUser = loginHandler->getMaxUserNameLength(); + const unsigned int minPass = loginHandler->getMinPasswordLength(); + const unsigned int maxPass = loginHandler->getMaxPasswordLength(); if (user.length() < minUser) { diff --git a/src/gui/windows/unregisterdialog.cpp b/src/gui/windows/unregisterdialog.cpp index 0135cb7c9..018b583fa 100644 --- a/src/gui/windows/unregisterdialog.cpp +++ b/src/gui/windows/unregisterdialog.cpp @@ -121,10 +121,8 @@ void UnRegisterDialog::action(const ActionEvent &event) std::stringstream errorMsg; bool error = false; - const unsigned int min = Net::getLoginHandler() - ->getMinPasswordLength(); - const unsigned int max = Net::getLoginHandler() - ->getMaxPasswordLength(); + const unsigned int min = loginHandler->getMinPasswordLength(); + const unsigned int max = loginHandler->getMaxPasswordLength(); if (password.length() < min) { diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp index db7db88aa..7cfb0319b 100644 --- a/src/gui/windows/worldselectdialog.cpp +++ b/src/gui/windows/worldselectdialog.cpp @@ -105,7 +105,7 @@ void WorldSelectDialog::action(const ActionEvent &event) { mChangeLoginButton->setEnabled(false); mChooseWorld->setEnabled(false); - Net::getLoginHandler()->chooseServer(mWorldList->getSelected(), + loginHandler->chooseServer(mWorldList->getSelected(), settings.persistentIp); // Check in case netcode moves us forward -- cgit v1.2.3-70-g09d2