summaryrefslogtreecommitdiff
path: root/src/gui/npcdialog.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-22 13:02:26 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-22 14:32:45 +0100
commit81e4f170d8ba4ccbcfa1e6c07bd0522dfc3b6e08 (patch)
treee2619b16a5331e5760d94be389d0a3a01427293f /src/gui/npcdialog.cpp
parentd047db79f7034e0e75a85a656d18f40716d197b9 (diff)
downloadmana-81e4f170d8ba4ccbcfa1e6c07bd0522dfc3b6e08.tar.gz
mana-81e4f170d8ba4ccbcfa1e6c07bd0522dfc3b6e08.tar.bz2
mana-81e4f170d8ba4ccbcfa1e6c07bd0522dfc3b6e08.tar.xz
mana-81e4f170d8ba4ccbcfa1e6c07bd0522dfc3b6e08.zip
General code cleanups
* Use default member initializers * Use range-based loops * Don't use 'else' after 'return' * Removed some unused includes * Construct empty strings with std::string() instead of "" * Clear strings with .clear() instead of assigning "" * Check whether strings are empty with .empty() instead of comparing to "" * Removed redundant initializations
Diffstat (limited to 'src/gui/npcdialog.cpp')
-rw-r--r--src/gui/npcdialog.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index 13e1ac0d..0ad9e959 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -106,7 +106,7 @@ NpcDialog::NpcDialog(int npcId)
mItemList->setVisible(true);
// Setup string input box
- mTextField = new TextField("");
+ mTextField = new TextField(std::string());
mTextField->setVisible(true);
// Setup int input box
@@ -211,7 +211,7 @@ void NpcDialog::action(const gcn::ActionEvent &event)
}
else if (mActionState == NPC_ACTION_INPUT)
{
- std::string printText = ""; // Text that will get printed in the textbox
+ std::string printText; // Text that will get printed in the textbox
if (mInputState == NPC_INPUT_LIST)
{
@@ -243,7 +243,7 @@ void NpcDialog::action(const gcn::ActionEvent &event)
}
if (!mLogInteraction)
- setText("");
+ setText(std::string());
}
else if (event.getId() == "reset")
{
@@ -569,7 +569,7 @@ void NpcEventListener::event(Event::Channel channel,
}
catch (BadEvent)
{
- dialog->textRequest("");
+ dialog->textRequest(std::string());
}
}
else if (event.getType() == Event::Next)