summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/chatwindow.cpp4
-rw-r--r--src/gui/windows/logindialog.cpp5
-rw-r--r--src/gui/windows/ministatuswindow.cpp2
-rw-r--r--src/gui/windows/npcdialog.cpp4
-rw-r--r--src/gui/windows/updaterwindow.cpp2
5 files changed, 10 insertions, 7 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 1551c10ae..5be54a6f9 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -801,7 +801,7 @@ void ChatWindow::keyPressed(KeyEvent &event)
mChatInput->getText().length()));
}
else if (actionId == InputAction::GUI_INSERT &&
- mChatInput->getText() != "")
+ !mChatInput->getText().empty())
{
// Add the current message to the history and clear the text
if (mHistory.empty() || mChatInput->getText() != mHistory.back())
@@ -1505,7 +1505,7 @@ std::string ChatWindow::autoCompleteHistory(const std::string &partName) const
f++;
line = line.substr(0, f);
- if (line != "")
+ if (!line.empty())
nameList.push_back(line);
++i;
diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp
index c39486dda..34f84fee4 100644
--- a/src/gui/windows/logindialog.cpp
+++ b/src/gui/windows/logindialog.cpp
@@ -125,8 +125,11 @@ LoginDialog::LoginDialog(LoginData &data,
}
mUpdateHostText->adjustSize();
- if (mPassField->getText().empty() && LoginDialog::savedPassword != "")
+ if (mPassField->getText().empty() &&
+ !LoginDialog::savedPassword.empty())
+ {
mPassField->setText(LoginDialog::savedPassword);
+ }
mUpdateTypeDropDown->setActionEventId("updatetype");
mUpdateTypeDropDown->setSelected((mLoginData->updateType
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index fc2e9a82c..e0fe46bb3 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -507,7 +507,7 @@ void MiniStatusWindow::loadBars()
{
const std::string str = config.getValue(
"ministatus" + toString(f), "");
- if (str == "")
+ if (str.empty())
continue;
ProgressBar *const bar = mBarNames[str];
if (!bar)
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index 27386af5b..452567b94 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -489,7 +489,7 @@ void NpcDialog::action(const ActionEvent &event)
const int sz = mComplexInventory->getSize();
if (sz == 0)
{
- str = "";
+ str.clear();
}
else
{
@@ -1385,7 +1385,7 @@ std::string NpcDialog::complexItemToStr(const ComplexItem *const item)
}
else
{
- str = "";
+ str.clear();
}
return str;
}
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index e6e97553a..09f529259 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -145,7 +145,7 @@ static std::vector<UpdateFile> loadTxtFile(const std::string &fileName)
thisFile.name = name;
thisFile.hash = hash;
thisFile.type = "data";
- thisFile.group = "";
+ thisFile.group.clear();
thisFile.required = true;
thisFile.desc.clear();