diff options
author | Tobias Markmann <tm@ayena.de> | 2015-10-26 13:00:29 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2015-10-30 15:50:52 (GMT) |
commit | 7f321edd9ada1f531b1fbc3325ef61449218f40c (patch) | |
tree | f0a1998447a41fa2cedff39edd1c179eefb4b298 /Swift/Controllers/HighlightAction.h | |
parent | 50a3962e4d0b16fd0316be54121cfb293c3117bd (diff) | |
download | swift-7f321edd9ada1f531b1fbc3325ef61449218f40c.zip swift-7f321edd9ada1f531b1fbc3325ef61449218f40c.tar.bz2 |
Only highlight text if a highlight color is set
This commit has the default rule set the default color and
changes HighlightAction::highlightText_ symbol to
HighlightAction::highlightWholeMessage_ as it is more
descriptive of its use.
Test-Information:
Tested highlighting with the default rule set, and one with
a highlight color set for the chat rule.
Change-Id: Ic638e6347bdf6623ab5959341486233494f005f0
Diffstat (limited to 'Swift/Controllers/HighlightAction.h')
-rw-r--r-- | Swift/Controllers/HighlightAction.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Swift/Controllers/HighlightAction.h b/Swift/Controllers/HighlightAction.h index a9e0cee..3930eee 100644 --- a/Swift/Controllers/HighlightAction.h +++ b/Swift/Controllers/HighlightAction.h @@ -11,28 +11,28 @@ */ #pragma once #include <string> -#include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> +#include <boost/archive/text_oarchive.hpp> namespace Swift { class HighlightRule; class HighlightAction { public: - HighlightAction() : highlightText_(false), playSound_(false) {} + HighlightAction() : highlightWholeMessage_(false), playSound_(false) {} /** * Gets the flag that indicates the entire message should be highlighted. */ - bool highlightAllText() const { return highlightText_; } - void setHighlightAllText(bool highlightText); + bool highlightWholeMessage() const { return highlightWholeMessage_; } + void setHighlightWholeMessage(bool highlightText); /** * Gets the foreground highlight color. */ const std::string& getTextColor() const { return textColor_; } void setTextColor(const std::string& textColor) { textColor_ = textColor; } @@ -49,19 +49,19 @@ namespace Swift { /** * Gets the sound filename. If the string is empty, assume a default sound file. */ const std::string& getSoundFile() const { return soundFile_; } void setSoundFile(const std::string& soundFile) { soundFile_ = soundFile; } - bool isEmpty() const { return !highlightText_ && !playSound_; } + bool isEmpty() const { return !highlightWholeMessage_ && !playSound_; } private: friend class boost::serialization::access; template<class Archive> void serialize(Archive & ar, const unsigned int version); - bool highlightText_; + bool highlightWholeMessage_; std::string textColor_; std::string textBackground_; bool playSound_; std::string soundFile_; }; @@ -69,13 +69,13 @@ namespace Swift { bool operator ==(HighlightAction const& a, HighlightAction const& b); bool operator !=(HighlightAction const& a, HighlightAction const& b); template<class Archive> void HighlightAction::serialize(Archive& ar, const unsigned int /*version*/) { - ar & highlightText_; + ar & highlightWholeMessage_; ar & textColor_; ar & textBackground_; ar & playSound_; ar & soundFile_; } |