diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-01 23:56:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-02 14:28:17 +0300 |
commit | 520a495c466793c29f3e721634dfe6cc616b8ede (patch) | |
tree | 749b67f5d4df83f6f4997dabeb66ec394eabccd7 /src/gui/windows | |
parent | f9030497b6196ce2fadb6b6ada5d784be227d9a6 (diff) | |
download | mv-520a495c466793c29f3e721634dfe6cc616b8ede.tar.gz mv-520a495c466793c29f3e721634dfe6cc616b8ede.tar.bz2 mv-520a495c466793c29f3e721634dfe6cc616b8ede.tar.xz mv-520a495c466793c29f3e721634dfe6cc616b8ede.zip |
Add missing const.
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/changeemaildialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/changepassworddialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 6 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.h | 6 | ||||
-rw-r--r-- | src/gui/windows/itemamountwindow.cpp | 6 | ||||
-rw-r--r-- | src/gui/windows/itemamountwindow.h | 14 | ||||
-rw-r--r-- | src/gui/windows/logindialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/statuswindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/unregisterdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/whoisonline.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/whoisonline.h | 2 |
11 files changed, 26 insertions, 20 deletions
diff --git a/src/gui/windows/changeemaildialog.cpp b/src/gui/windows/changeemaildialog.cpp index 0f4086a0b..420dc3b76 100644 --- a/src/gui/windows/changeemaildialog.cpp +++ b/src/gui/windows/changeemaildialog.cpp @@ -118,7 +118,7 @@ void ChangeEmailDialog::action(const ActionEvent &event) } else if (eventId == "change_email") { - const std::string username = mLoginData->username.c_str(); + const std::string username = mLoginData->username; const std::string &newFirstEmail = mFirstEmailField->getText(); const std::string &newSecondEmail = mSecondEmailField->getText(); logger->log("ChangeEmailDialog::Email change, Username is %s", diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp index eb7380f20..383b6a63e 100644 --- a/src/gui/windows/changepassworddialog.cpp +++ b/src/gui/windows/changepassworddialog.cpp @@ -97,7 +97,7 @@ void ChangePasswordDialog::action(const ActionEvent &event) } else if (eventId == "change_password") { - const std::string username = mLoginData->username.c_str(); + const std::string username = mLoginData->username; const std::string &oldPassword = mOldPassField->getText(); const std::string &newFirstPass = mFirstPassField->getText(); const std::string &newSecondPass = mSecondPassField->getText(); diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 1b1973f63..ad646ce82 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -1334,7 +1334,7 @@ void ChatWindow::autoComplete() } } -std::string ChatWindow::autoComplete(StringVect &names, +std::string ChatWindow::autoComplete(const StringVect &names, std::string partName) { StringVectCIter i = names.begin(); @@ -1365,7 +1365,7 @@ std::string ChatWindow::autoComplete(StringVect &names, } std::string ChatWindow::autoComplete(const std::string &partName, - History *const words) const + const History *const words) const { if (!words) return ""; @@ -1605,7 +1605,7 @@ void ChatWindow::initTradeFilter() } } -void ChatWindow::updateOnline(std::set<std::string> &onlinePlayers) const +void ChatWindow::updateOnline(const std::set<std::string> &onlinePlayers) const { const Party *party = nullptr; const Guild *guild = nullptr; diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index 3999d6b8a..114c6008c 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -240,7 +240,7 @@ class ChatWindow final : public Window, const bool ignoreRecord = false, const bool tryRemoveColors = true); - void updateOnline(std::set<std::string> &onlinePlayers) const; + void updateOnline(const std::set<std::string> &onlinePlayers) const; void loadState(); @@ -331,9 +331,9 @@ class ChatWindow final : public Window, std::string autoCompleteHistory(const std::string &partName) const; std::string autoComplete(const std::string &partName, - History *const words) const; + const History *const words) const; - static std::string autoComplete(StringVect &names, + static std::string autoComplete(const StringVect &names, std::string partName); /** Used for showing item popup on clicking links **/ diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index 9c2e039f9..92ceeae76 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -53,8 +53,10 @@ #include "debug.h" -void ItemAmountWindow::finish(Item *const item, const int amount, - const int price, const Usage usage) +void ItemAmountWindow::finish(const Item *const item, + const int amount, + const int price, + const Usage usage) { switch (usage) { diff --git a/src/gui/windows/itemamountwindow.h b/src/gui/windows/itemamountwindow.h index d2dca064e..ec36265af 100644 --- a/src/gui/windows/itemamountwindow.h +++ b/src/gui/windows/itemamountwindow.h @@ -93,11 +93,15 @@ class ItemAmountWindow final : public Window, ~ItemAmountWindow(); private: - static void finish(Item *const item, const int amount, - const int price, const Usage usage); - - ItemAmountWindow(const Usage usage, Window *const parent, - Item *const item, const int maxRange = 0); + static void finish(const Item *const item, + const int amount, + const int price, + const Usage usage); + + ItemAmountWindow(const Usage usage, + Window *const parent, + Item *const item, + const int maxRange = 0); IntTextField *mItemAmountTextField; /**< Item amount caption. */ IntTextField *mItemPriceTextField; /**< Item price caption. */ diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index b2242d3f6..d1202dea7 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -302,7 +302,7 @@ void LoginDialog::prepareUpdate() if (checkPath(mUpdateHostText->getText())) { mLoginData->updateHost = mUpdateHostText->getText(); - *mUpdateHost = mUpdateHostText->getText(); + *mUpdateHost = mLoginData->updateHost; } else { diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp index a45c206f5..e76658b05 100644 --- a/src/gui/windows/statuswindow.cpp +++ b/src/gui/windows/statuswindow.cpp @@ -646,7 +646,7 @@ void StatusWindow::updateMoneyBar(ProgressBar *const bar) return; const int money = PlayerInfo::getAttribute(PlayerInfo::MONEY); - bar->setText(Units::formatCurrency(money).c_str()); + bar->setText(Units::formatCurrency(money)); if (money > 0) { const float progress = static_cast<float>(money) diff --git a/src/gui/windows/unregisterdialog.cpp b/src/gui/windows/unregisterdialog.cpp index 3d8627add..e35c27aa2 100644 --- a/src/gui/windows/unregisterdialog.cpp +++ b/src/gui/windows/unregisterdialog.cpp @@ -110,7 +110,7 @@ void UnRegisterDialog::action(const ActionEvent &event) } else if (eventId == "unregister") { - const std::string username = mLoginData->username.c_str(); + const std::string username = mLoginData->username; const std::string &password = mPasswordField->getText(); logger->log("UnregisterDialog::unregistered, Username is %s", username.c_str()); diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 34ae7aa49..0bf05a129 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -292,7 +292,7 @@ void WhoIsOnline::handlerPlayerRelation(const std::string &nick, } } -void WhoIsOnline::loadList(std::vector<OnlinePlayer*> &list) +void WhoIsOnline::loadList(const std::vector<OnlinePlayer*> &list) { mBrowserBox->clearRows(); const size_t numOnline = list.size(); diff --git a/src/gui/windows/whoisonline.h b/src/gui/windows/whoisonline.h index 915150409..448321866 100644 --- a/src/gui/windows/whoisonline.h +++ b/src/gui/windows/whoisonline.h @@ -125,7 +125,7 @@ public: */ void loadWebList(); - void loadList(std::vector<OnlinePlayer*> &list); + void loadList(const std::vector<OnlinePlayer*> &list); void handleLink(const std::string& link, MouseEvent *event) override final; |