summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs/chat
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-24 22:04:29 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-24 22:04:29 +0300
commit7ae8a11e0e99ab28730a8ca98388a6ec0ea1923e (patch)
tree6b440c246a9ed2c3d915c98f6b090a45673a2fb7 /src/gui/widgets/tabs/chat
parent860d3e8e1bbe99b77763d533aebba9fde01e74c6 (diff)
downloadmv-7ae8a11e0e99ab28730a8ca98388a6ec0ea1923e.tar.gz
mv-7ae8a11e0e99ab28730a8ca98388a6ec0ea1923e.tar.bz2
mv-7ae8a11e0e99ab28730a8ca98388a6ec0ea1923e.tar.xz
mv-7ae8a11e0e99ab28730a8ca98388a6ec0ea1923e.zip
Add strong typed bool type TryRemoveColors.
Diffstat (limited to 'src/gui/widgets/tabs/chat')
-rw-r--r--src/gui/widgets/tabs/chat/chattab.cpp7
-rw-r--r--src/gui/widgets/tabs/chat/chattab.h4
2 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/widgets/tabs/chat/chattab.cpp b/src/gui/widgets/tabs/chat/chattab.cpp
index 072ab677e..dd2ff9a54 100644
--- a/src/gui/widgets/tabs/chat/chattab.cpp
+++ b/src/gui/widgets/tabs/chat/chattab.cpp
@@ -109,7 +109,7 @@ ChatTab::~ChatTab()
void ChatTab::chatLog(std::string line,
ChatMsgType::Type own,
const IgnoreRecord ignoreRecord,
- const bool tryRemoveColors)
+ const TryRemoveColors tryRemoveColors)
{
// Trim whitespace
trim(line);
@@ -117,7 +117,8 @@ void ChatTab::chatLog(std::string line,
if (line.empty())
return;
- if (tryRemoveColors && own == ChatMsgType::BY_OTHER &&
+ if (tryRemoveColors == TryRemoveColors_true &&
+ own == ChatMsgType::BY_OTHER &&
config.getBoolValue("removeColors"))
{
line = removeColors(line);
@@ -364,7 +365,7 @@ void ChatTab::chatLog(const std::string &nick, std::string msg)
chatLog(std::string(nick).append(" : ").append(msg),
byWho,
IgnoreRecord_false,
- false);
+ TryRemoveColors_false);
}
void ChatTab::chatInput(const std::string &message)
diff --git a/src/gui/widgets/tabs/chat/chattab.h b/src/gui/widgets/tabs/chat/chattab.h
index 7af3920ef..6eee19b9d 100644
--- a/src/gui/widgets/tabs/chat/chattab.h
+++ b/src/gui/widgets/tabs/chat/chattab.h
@@ -27,6 +27,7 @@
#include "enums/simpletypes/ignorerecord.h"
#include "enums/simpletypes/online.h"
+#include "enums/simpletypes/tryremovecolors.h"
#include "gui/widgets/browserbox.h"
@@ -81,7 +82,8 @@ class ChatTab notfinal : public Tab
void chatLog(std::string line,
ChatMsgType::Type own = ChatMsgType::BY_SERVER,
const IgnoreRecord ignoreRecord = IgnoreRecord_false,
- const bool tryRemoveColors = true);
+ const TryRemoveColors tryRemoveColors
+ = TryRemoveColors_true);
/**
* Adds the text to the message list