summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-02 12:46:32 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-02 12:46:32 +0300
commit11caa7aeeb3a7b40823da8573576d2354b7504b5 (patch)
treefe34c20ea973e65104747b59675acf6363e7b5d2 /src/gui/widgets/tabs
parent0c4ed5a9594b849b436fca13c6992dee923915ed (diff)
downloadmv-11caa7aeeb3a7b40823da8573576d2354b7504b5.tar.gz
mv-11caa7aeeb3a7b40823da8573576d2354b7504b5.tar.bz2
mv-11caa7aeeb3a7b40823da8573576d2354b7504b5.tar.xz
mv-11caa7aeeb3a7b40823da8573576d2354b7504b5.zip
Add missing const and static into gui classes.
Diffstat (limited to 'src/gui/widgets/tabs')
-rw-r--r--src/gui/widgets/tabs/chattab.cpp11
-rw-r--r--src/gui/widgets/tabs/guildchattab.cpp6
-rw-r--r--src/gui/widgets/tabs/setup_input.cpp9
-rw-r--r--src/gui/widgets/tabs/setup_input.h9
-rw-r--r--src/gui/widgets/tabs/setuptabscroll.h2
-rw-r--r--src/gui/widgets/tabs/whispertab.cpp5
6 files changed, 15 insertions, 27 deletions
diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp
index 1795fd03e..331101209 100644
--- a/src/gui/widgets/tabs/chattab.cpp
+++ b/src/gui/widgets/tabs/chattab.cpp
@@ -418,15 +418,8 @@ void ChatTab::clearText()
void ChatTab::handleInput(const std::string &msg)
{
- if (chatWindow)
- {
- Net::getChatHandler()->talk(chatWindow->doReplace(msg),
- mChannelName);
- }
- else
- {
- Net::getChatHandler()->talk(msg, mChannelName);
- }
+ Net::getChatHandler()->talk(ChatWindow::doReplace(msg),
+ mChannelName);
}
void ChatTab::handleCommand(const std::string &msg)
diff --git a/src/gui/widgets/tabs/guildchattab.cpp b/src/gui/widgets/tabs/guildchattab.cpp
index 364b83968..8de95991f 100644
--- a/src/gui/widgets/tabs/guildchattab.cpp
+++ b/src/gui/widgets/tabs/guildchattab.cpp
@@ -107,11 +107,7 @@ void GuildChatTab::handleInput(const std::string &msg)
{
if (!guildManager)
return;
-
- if (chatWindow)
- guildManager->chat(chatWindow->doReplace(msg));
- else
- guildManager->chat(msg);
+ guildManager->chat(ChatWindow::doReplace(msg));
}
void GuildChatTab::showHelp()
diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp
index 2ce99d971..9ce6fd616 100644
--- a/src/gui/widgets/tabs/setup_input.cpp
+++ b/src/gui/widgets/tabs/setup_input.cpp
@@ -270,7 +270,7 @@ void Setup_Input::action(const gcn::ActionEvent &event)
else if (id == "resetkeys")
{
inputManager.resetKeys();
- inputManager.update();
+ InputManager::update();
refreshKeys();
}
else if (id == "default")
@@ -378,8 +378,9 @@ void Setup_Input::keyUnresolved()
}
void Setup_Input::fixTranslation(SetupActionData *const actionDatas,
- const int actionStart, const int actionEnd,
- const std::string &text) const
+ const int actionStart,
+ const int actionEnd,
+ const std::string &text)
{
int k = 0;
@@ -397,7 +398,7 @@ void Setup_Input::fixTranslation(SetupActionData *const actionDatas,
}
}
-void Setup_Input::fixTranslations() const
+void Setup_Input::fixTranslations()
{
fixTranslation(setupActionData1, static_cast<int>(Input::KEY_SHORTCUT_1),
static_cast<int>(Input::KEY_SHORTCUT_20), "Item Shortcut %d");
diff --git a/src/gui/widgets/tabs/setup_input.h b/src/gui/widgets/tabs/setup_input.h
index cb2e5cac0..135cb3339 100644
--- a/src/gui/widgets/tabs/setup_input.h
+++ b/src/gui/widgets/tabs/setup_input.h
@@ -82,11 +82,12 @@ class Setup_Input final : public SetupTab
std::string keyToString(const int index) const A_WARN_UNUSED;
private:
- void fixTranslations() const;
+ static void fixTranslations();
- void fixTranslation(SetupActionData *const actionDatas,
- const int actionStart, const int actionEnd,
- const std::string &text) const;
+ static void fixTranslation(SetupActionData *const actionDatas,
+ const int actionStart,
+ const int actionEnd,
+ const std::string &text);
KeyListModel *mKeyListModel;
ListBox *mKeyList;
diff --git a/src/gui/widgets/tabs/setuptabscroll.h b/src/gui/widgets/tabs/setuptabscroll.h
index e3d495690..fb7de574d 100644
--- a/src/gui/widgets/tabs/setuptabscroll.h
+++ b/src/gui/widgets/tabs/setuptabscroll.h
@@ -60,7 +60,7 @@ class SetupTabScroll : public SetupTab
override final
{ }
- int getPreferredFirstItemSize() A_WARN_UNUSED
+ int getPreferredFirstItemSize() const A_WARN_UNUSED
{ return mPreferredFirstItemSize; }
void widgetResized(const gcn::Event &event) override final;
diff --git a/src/gui/widgets/tabs/whispertab.cpp b/src/gui/widgets/tabs/whispertab.cpp
index 659704638..2d1e2969a 100644
--- a/src/gui/widgets/tabs/whispertab.cpp
+++ b/src/gui/widgets/tabs/whispertab.cpp
@@ -52,10 +52,7 @@ WhisperTab::~WhisperTab()
void WhisperTab::handleInput(const std::string &msg)
{
std::string newMsg;
- if (chatWindow)
- newMsg = chatWindow->doReplace(msg);
- else
- newMsg = msg;
+ newMsg = ChatWindow::doReplace(msg);
Net::getChatHandler()->privateMessage(mNick, newMsg);
if (player_node)