diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
commit | 5afe88df2538274859a162ffd63ed52118e80c19 (patch) | |
tree | b610dfd58dc748fd63f49565b2a43eea2316714f /src/gui/serverdialog.cpp | |
parent | 73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff) | |
download | mana-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/serverdialog.cpp')
-rw-r--r-- | src/gui/serverdialog.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 3ea978e1..f0016322 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -112,12 +112,12 @@ public: { } - void draw(gcn::Graphics *graphics) + void draw(gcn::Graphics *graphics) override { if (!mListModel) return; - ServersListModel *model = static_cast<ServersListModel*>(mListModel); + auto *model = static_cast<ServersListModel*>(mListModel); updateAlpha(); @@ -165,7 +165,7 @@ public: } } - unsigned int getRowHeight() const + unsigned int getRowHeight() const override { return 2 * getFont()->getHeight(); } @@ -188,7 +188,7 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): mServersList = new ServersListBox(mServersListModel); - ScrollArea *usedScroll = new ScrollArea(mServersList); + auto *usedScroll = new ScrollArea(mServersList); usedScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); mDescription = new Label(std::string()); @@ -252,7 +252,7 @@ ServerDialog::~ServerDialog() { mDownload->cancel(); delete mDownload; - mDownload = 0; + mDownload = nullptr; } delete mServersListModel; } @@ -275,7 +275,7 @@ void ServerDialog::action(const gcn::ActionEvent &event) #endif ) { - OkDialog *dlg = new OkDialog(_("Error"), + auto *dlg = new OkDialog(_("Error"), _("Please select a valid server.")); dlg->addActionListener(this); } @@ -319,7 +319,7 @@ void ServerDialog::action(const gcn::ActionEvent &event) // Check whether a server is selected. if (index < 0) { - OkDialog *dlg = new OkDialog(_("Error"), + auto *dlg = new OkDialog(_("Error"), _("Please select a custom server.")); dlg->addActionListener(this); } @@ -348,7 +348,7 @@ void ServerDialog::keyPressed(gcn::KeyEvent &keyEvent) } else if (key.getValue() == Key::ENTER) { - action(gcn::ActionEvent(NULL, mConnectButton->getActionEventId())); + action(gcn::ActionEvent(nullptr, mConnectButton->getActionEventId())); } } @@ -523,7 +523,7 @@ void ServerDialog::loadServers() // Add the server to the local list if it's not already present bool found = false; int i = 0; - for (ServerInfos::iterator it = mServers.begin(); it != mServers.end(); + for (auto it = mServers.begin(); it != mServers.end(); ++it) { if (*it == server) @@ -641,7 +641,7 @@ int ServerDialog::downloadUpdate(void *ptr, DownloadStatus status, if (status == DOWNLOAD_STATUS_CANCELLED) return -1; - ServerDialog *sd = reinterpret_cast<ServerDialog*>(ptr); + auto *sd = reinterpret_cast<ServerDialog*>(ptr); bool finished = false; if (status == DOWNLOAD_STATUS_COMPLETE) |