summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-25 03:08:37 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-25 03:08:37 +0300
commit39029943851dfc318fabb95357e00b81d2735547 (patch)
treedfd195791587c51e6dca166dda8a016a1760d3bf /src/gui/widgets
parent10f59701112130cf953a2af7ef4ae82d9d823fe6 (diff)
downloadmanaverse-39029943851dfc318fabb95357e00b81d2735547.tar.gz
manaverse-39029943851dfc318fabb95357e00b81d2735547.tar.bz2
manaverse-39029943851dfc318fabb95357e00b81d2735547.tar.xz
manaverse-39029943851dfc318fabb95357e00b81d2735547.zip
Improve empty strings manipulation.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp4
-rw-r--r--src/gui/widgets/browserbox.cpp2
-rw-r--r--src/gui/widgets/chattab.cpp8
-rw-r--r--src/gui/widgets/passwordfield.cpp2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index dcb280596..5a5027982 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -344,7 +344,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event)
{
std::string name;
if (model->getAvatarAt(selected)->getLevel() == 0)
- name = "";
+ name.clear();
else
name = model->getAvatarAt(selected)->getName();
@@ -357,7 +357,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event)
{
std::string name;
if (model->getAvatarAt(selected)->getLevel() == 0)
- name = "";
+ name.clear();
else
name = model->getAvatarAt(selected)->getName();
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 55bbcc89c..776b2eb29 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -695,7 +695,7 @@ std::string BrowserBox::getTextAtPos(const int x, const int y) const
// textX = x - textX;
textY = y - textY;
- std::string str = "";
+ std::string str;
int lastY = 0;
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index d2d66e681..2fc19a473 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -110,7 +110,7 @@ void ChatTab::chatLog(std::string line, Own own,
CHATLOG tmp;
tmp.own = own;
- tmp.nick = "";
+ tmp.nick.clear();
tmp.text = line;
const size_t pos = line.find(" : ");
@@ -173,7 +173,7 @@ void ChatTab::chatLog(std::string line, Own own,
lineColor = "##S";
break;
case BY_CHANNEL:
- tmp.nick = "";
+ tmp.nick.clear();
// TODO: Use a predefined color
lineColor = "##2"; // Equiv. to BrowserBox::GREEN
break;
@@ -185,7 +185,7 @@ void ChatTab::chatLog(std::string line, Own own,
lineColor = "##I";
break;
case BY_LOGGER:
- tmp.nick = "";
+ tmp.nick.clear();
tmp.text = line;
lineColor = "##L";
break;
@@ -196,7 +196,7 @@ void ChatTab::chatLog(std::string line, Own own,
if (tmp.nick == ": ")
{
- tmp.nick = "";
+ tmp.nick.clear();
lineColor = "##S";
}
diff --git a/src/gui/widgets/passwordfield.cpp b/src/gui/widgets/passwordfield.cpp
index 512c12761..42bd8d0d0 100644
--- a/src/gui/widgets/passwordfield.cpp
+++ b/src/gui/widgets/passwordfield.cpp
@@ -39,7 +39,7 @@ void PasswordField::draw(gcn::Graphics *graphics)
if (mPasswordChar)
mText.assign(mText.length(), mPasswordChar);
else
- mText = "";
+ mText.clear();
TextField::draw(graphics);
mText = original;
BLOCK_END("PasswordField::draw")