summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-04-16 20:02:31 +0200
committerPhilipp Sehmisch <crush@themanaworld.org>2009-04-16 20:02:31 +0200
commit255c491375005abb1d2de22fa5aa1a821ac3a4f6 (patch)
treeb474bd4c0d5429ddd45d992015a7ed73a12a1830 /src/gui/widgets
parent2fb36c5f27e2891bbd9968bdf9bbc7142ff28983 (diff)
parent69258182848b2781b0081d82453d33f42dd81679 (diff)
downloadMana-255c491375005abb1d2de22fa5aa1a821ac3a4f6.tar.gz
Mana-255c491375005abb1d2de22fa5aa1a821ac3a4f6.tar.bz2
Mana-255c491375005abb1d2de22fa5aa1a821ac3a4f6.tar.xz
Mana-255c491375005abb1d2de22fa5aa1a821ac3a4f6.zip
Merge branch 'master' of git@gitorious.org:tmw/mainline
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/channeltab.cpp11
-rw-r--r--src/gui/widgets/channeltab.h5
-rw-r--r--src/gui/widgets/chattab.cpp2
-rw-r--r--src/gui/widgets/chattab.h5
-rw-r--r--src/gui/widgets/whispertab.cpp8
-rw-r--r--src/gui/widgets/whispertab.h5
6 files changed, 22 insertions, 14 deletions
diff --git a/src/gui/widgets/channeltab.cpp b/src/gui/widgets/channeltab.cpp
index 0bafc10f..e3edbba0 100644
--- a/src/gui/widgets/channeltab.cpp
+++ b/src/gui/widgets/channeltab.cpp
@@ -28,8 +28,9 @@
#include "utils/gettext.h"
-ChannelTab::ChannelTab(Channel *channel) : ChatTab(channel->getName()),
- mChannel(channel)
+ChannelTab::ChannelTab(Channel *channel) :
+ ChatTab(channel->getName()),
+ mChannel(channel)
{
channel->setTab(this);
}
@@ -38,7 +39,8 @@ ChannelTab::~ChannelTab()
{
}
-void ChannelTab::handleInput(const std::string &msg) {
+void ChannelTab::handleInput(const std::string &msg)
+{
Net::getChatHandler()->sendToChannel(getChannel()->getId(), msg);
}
@@ -51,7 +53,8 @@ void ChannelTab::showHelp()
chatLog(_("/kick > Kick a user from the channel"));
}
-bool ChannelTab::handleCommand(std::string type, std::string args)
+bool ChannelTab::handleCommand(const std::string &type,
+ const std::string &args)
{
if (type == "help")
{
diff --git a/src/gui/widgets/channeltab.h b/src/gui/widgets/channeltab.h
index 886ae28e..2f668b89 100644
--- a/src/gui/widgets/channeltab.h
+++ b/src/gui/widgets/channeltab.h
@@ -33,11 +33,12 @@ class ChannelTab : public ChatTab
{
public:
- Channel *getChannel() { return mChannel; }
+ Channel *getChannel() const { return mChannel; }
void showHelp();
- bool handleCommand(std::string type, std::string args);
+ bool handleCommand(const std::string &type,
+ const std::string &args);
protected:
friend class Channel;
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 0e3ae423..44840423 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -274,7 +274,7 @@ void ChatTab::handleInput(const std::string &msg) {
Net::getChatHandler()->talk(msg);
}
-void ChatTab::handleCommand(std::string msg)
+void ChatTab::handleCommand(const std::string &msg)
{
commandHandler->handleCommand(msg, this);
}
diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h
index ccb85d2a..27c27480 100644
--- a/src/gui/widgets/chattab.h
+++ b/src/gui/widgets/chattab.h
@@ -113,7 +113,8 @@ class ChatTab : public Tab
* @returns true if the command was handled
* false if the command was not handled
*/
- virtual bool handleCommand(std::string type, std::string args)
+ virtual bool handleCommand(const std::string &type,
+ const std::string &args)
{ return false; }
protected:
@@ -124,7 +125,7 @@ class ChatTab : public Tab
virtual void handleInput(const std::string &msg);
- virtual void handleCommand(std::string msg);
+ virtual void handleCommand(const std::string &msg);
ScrollArea *mScrollArea;
BrowserBox *mTextOutput;
diff --git a/src/gui/widgets/whispertab.cpp b/src/gui/widgets/whispertab.cpp
index 975cac94..87a88222 100644
--- a/src/gui/widgets/whispertab.cpp
+++ b/src/gui/widgets/whispertab.cpp
@@ -43,7 +43,8 @@ WhisperTab::~WhisperTab()
chatWindow->removeWhisper(mNick);
}
-void WhisperTab::handleInput(const std::string &msg) {
+void WhisperTab::handleInput(const std::string &msg)
+{
if (msg.length() == 0) {
chatLog(_("Cannot send empty chat!"), BY_SERVER, false);
return;
@@ -55,7 +56,7 @@ void WhisperTab::handleInput(const std::string &msg) {
msg.c_str()), BY_PLAYER, false);
}
-void WhisperTab::handleCommand(std::string msg)
+void WhisperTab::handleCommand(const std::string &msg)
{
if (msg == "close")
delete this;
@@ -68,7 +69,8 @@ void WhisperTab::showHelp()
chatLog(_("/close > Close the whisper tab"));
}
-bool WhisperTab::handleCommand(std::string type, std::string args)
+bool WhisperTab::handleCommand(const std::string &type,
+ const std::string &args)
{
if (type == "help")
{
diff --git a/src/gui/widgets/whispertab.h b/src/gui/widgets/whispertab.h
index 0d39b6ec..af71025b 100644
--- a/src/gui/widgets/whispertab.h
+++ b/src/gui/widgets/whispertab.h
@@ -36,7 +36,8 @@ class WhisperTab : public ChatTab
void showHelp();
- bool handleCommand(std::string type, std::string args);
+ bool handleCommand(const std::string &type,
+ const std::string &args);
protected:
friend class ChatWindow;
@@ -52,7 +53,7 @@ class WhisperTab : public ChatTab
void handleInput(const std::string &msg);
- void handleCommand(std::string msg);
+ void handleCommand(const std::string &msg);
private:
std::string mNick;