summaryrefslogtreecommitdiff
path: root/src/guiFileSelectMenu.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-21 23:40:48 +0200
committerGitHub <noreply@github.com>2017-04-21 23:40:48 +0200
commitdc0e9097d3144a3dda81039f666ee43ba29cbc36 (patch)
tree25f9db4f6357826bfb5456a642b522bb0b235d6f /src/guiFileSelectMenu.cpp
parentf151b2322003bbc89c2cd3c603ef1e1ab9d46439 (diff)
downloadminetest-dc0e9097d3144a3dda81039f666ee43ba29cbc36.tar.gz
minetest-dc0e9097d3144a3dda81039f666ee43ba29cbc36.tar.bz2
minetest-dc0e9097d3144a3dda81039f666ee43ba29cbc36.zip
Fix various performance issues reported by cppcheck + code style (CI) (#5635)
* Make CI happy with code style on master * guiFileSelectMenu: remove useless includes * some performance fixes pointed by cppcheck * remove some useless casts * TextDest: remove unused setFormSpec function
Diffstat (limited to 'src/guiFileSelectMenu.cpp')
-rw-r--r--src/guiFileSelectMenu.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/guiFileSelectMenu.cpp b/src/guiFileSelectMenu.cpp
index 0bb02f8a6..89d34a307 100644
--- a/src/guiFileSelectMenu.cpp
+++ b/src/guiFileSelectMenu.cpp
@@ -18,19 +18,17 @@
*/
#include "guiFileSelectMenu.h"
-#include "util/string.h"
-#include <locale.h>
GUIFileSelectMenu::GUIFileSelectMenu(gui::IGUIEnvironment* env,
- gui::IGUIElement* parent, s32 id, IMenuManager *menumgr,
- std::string title, std::string formname) :
-GUIModalMenu(env, parent, id, menumgr)
+ gui::IGUIElement* parent, s32 id, IMenuManager *menumgr,
+ const std::string &title, const std::string &formname) :
+ GUIModalMenu(env, parent, id, menumgr),
+ m_title(utf8_to_wide(title)),
+ m_accepted(false),
+ m_parent(parent),
+ m_text_dst(NULL),
+ m_formname(formname)
{
- m_title = utf8_to_wide(title);
- m_parent = parent;
- m_formname = formname;
- m_text_dst = 0;
- m_accepted = false;
}
GUIFileSelectMenu::~GUIFileSelectMenu()
@@ -107,16 +105,12 @@ bool GUIFileSelectMenu::OnEvent(const SEvent& event)
acceptInput();
quitMenu();
return true;
- break;
-
case gui::EGET_DIRECTORY_SELECTED:
case gui::EGET_FILE_SELECTED:
m_accepted=true;
acceptInput();
quitMenu();
return true;
- break;
-
default:
//ignore this event
break;