From 0bdaa773a4ee5a678c400a1b097190e3856ee5a6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Jun 2015 17:23:55 +0300 Subject: Convert UpdateType enum into strong typed enum. --- src/gui/windows/logindialog.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/gui/windows/logindialog.cpp') diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index 5230ef4fe..2d7adc09f 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -43,6 +43,7 @@ #include "net/charserverhandler.h" #include "net/loginhandler.h" +#include "net/updatetypeoperators.h" #include "utils/delete2.h" #include "utils/paths.h" @@ -129,7 +130,7 @@ LoginDialog::LoginDialog(LoginData *const data, mUpdateTypeDropDown->setActionEventId("updatetype"); mUpdateTypeDropDown->setSelected((mLoginData->updateType - | UpdateType::Custom) ^ UpdateType::Custom); + | UpdateType::Custom) ^ static_cast(UpdateType::Custom)); if (!mCustomUpdateHost->isSelected()) mUpdateHostText->setVisible(Visible_false); @@ -280,12 +281,14 @@ void LoginDialog::prepareUpdate() mLoginData->username = mUserField->getText(); mLoginData->password = mPassField->getText(); mLoginData->remember = mKeepCheck->isSelected(); - int updateType = mUpdateTypeDropDown->getSelected(); + UpdateTypeT updateType = static_cast( + mUpdateTypeDropDown->getSelected()); if (mCustomUpdateHost->isSelected() && !mUpdateHostText->getText().empty()) { - updateType |= UpdateType::Custom; + updateType = static_cast( + updateType | UpdateType::Custom); serverConfig.setValue("customUpdateHost", mUpdateHostText->getText()); @@ -326,7 +329,7 @@ void LoginDialog::prepareUpdate() } mLoginData->updateType = updateType; - serverConfig.setValue("updateType", updateType); + serverConfig.setValue("updateType", static_cast(updateType)); mRegisterButton->setEnabled(false); mServerButton->setEnabled(false); -- cgit v1.2.3-60-g2f50