summaryrefslogtreecommitdiff
path: root/src/gui/worldselectdialog.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
commit5afe88df2538274859a162ffd63ed52118e80c19 (patch)
treeb610dfd58dc748fd63f49565b2a43eea2316714f /src/gui/worldselectdialog.cpp
parent73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff)
downloadmana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz
mana-5afe88df2538274859a162ffd63ed52118e80c19.zip
Apply C++11 fixits
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
Diffstat (limited to 'src/gui/worldselectdialog.cpp')
-rw-r--r--src/gui/worldselectdialog.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/worldselectdialog.cpp b/src/gui/worldselectdialog.cpp
index f6084f32..f2b31085 100644
--- a/src/gui/worldselectdialog.cpp
+++ b/src/gui/worldselectdialog.cpp
@@ -51,14 +51,14 @@ class WorldListModel : public gcn::ListModel
{
}
- virtual ~WorldListModel() {}
+ ~WorldListModel() override {}
- int getNumberOfElements()
+ int getNumberOfElements() override
{
return mWorlds.size();
}
- std::string getElementAt(int i)
+ std::string getElementAt(int i) override
{
const WorldInfo *si = mWorlds[i];
return si->name + " (" + toString(si->online_users) + ")";
@@ -72,7 +72,7 @@ WorldSelectDialog::WorldSelectDialog(Worlds worlds):
{
mWorldListModel = new WorldListModel(worlds);
mWorldList = new ListBox(mWorldListModel);
- ScrollArea *worldsScroll = new ScrollArea(mWorldList);
+ auto *worldsScroll = new ScrollArea(mWorldList);
mChangeLoginButton = new Button(_("Change Login"), "login", this);
mChooseWorld = new Button(_("Choose World"), "world", this);
@@ -130,11 +130,11 @@ void WorldSelectDialog::keyPressed(gcn::KeyEvent &keyEvent)
if (key.getValue() == Key::ESCAPE)
{
- action(gcn::ActionEvent(NULL, mChangeLoginButton->getActionEventId()));
+ action(gcn::ActionEvent(nullptr, mChangeLoginButton->getActionEventId()));
}
else if (key.getValue() == Key::ENTER)
{
- action(gcn::ActionEvent(NULL, mChooseWorld->getActionEventId()));
+ action(gcn::ActionEvent(nullptr, mChooseWorld->getActionEventId()));
}
}