summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/models/iconsmodel.h2
-rw-r--r--src/gui/models/itemsmodel.h2
-rw-r--r--src/gui/popups/popupmenu.cpp2
-rw-r--r--src/gui/widgets/tabs/setup_input.cpp2
-rw-r--r--src/gui/widgets/window.cpp7
-rw-r--r--src/gui/widgets/window.h5
-rw-r--r--src/gui/windows/changeemaildialog.cpp4
-rw-r--r--src/gui/windows/changepassworddialog.cpp6
-rw-r--r--src/gui/windows/charcreatedialog.cpp2
-rw-r--r--src/gui/windows/chatwindow.cpp6
-rw-r--r--src/gui/windows/outfitwindow.cpp2
-rw-r--r--src/gui/windows/registerdialog.cpp2
-rw-r--r--src/gui/windows/unregisterdialog.cpp2
-rw-r--r--src/gui/windows/updaterwindow.cpp4
14 files changed, 18 insertions, 30 deletions
diff --git a/src/gui/models/iconsmodel.h b/src/gui/models/iconsmodel.h
index c3031169c..b462f8a23 100644
--- a/src/gui/models/iconsmodel.h
+++ b/src/gui/models/iconsmodel.h
@@ -48,7 +48,7 @@ class IconsModel final : public ListModel
continue;
const ItemInfo &info = (*i->second);
- const std::string name = info.getName();
+ const std::string &name = info.getName();
if (name != "unnamed" && !info.getName().empty()
&& info.getName() != "unnamed")
{
diff --git a/src/gui/models/itemsmodel.h b/src/gui/models/itemsmodel.h
index 808ae0f04..83d9f0776 100644
--- a/src/gui/models/itemsmodel.h
+++ b/src/gui/models/itemsmodel.h
@@ -50,7 +50,7 @@ class ItemsModal final : public ListModel
continue;
const ItemInfo &info = *i->second;
- const std::string name = info.getName();
+ const std::string &name = info.getName();
if (name != "unnamed" && !info.getName().empty()
&& info.getName() != "unnamed")
{
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 504ad6426..c8416f66d 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -814,7 +814,7 @@ void PopupMenu::showChangePos(const int x, const int y)
const Guild *const guild = player_node->getGuild();
if (guild)
{
- const PositionsMap map = guild->getPositions();
+ const PositionsMap &map = guild->getPositions();
FOR_EACH (PositionsMap::const_iterator, itr, map)
{
mBrowserBox->addRow(strprintf("@@guild-pos-%u|%s@@",
diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp
index a29e0d797..74ee7a3dc 100644
--- a/src/gui/widgets/tabs/setup_input.cpp
+++ b/src/gui/widgets/tabs/setup_input.cpp
@@ -212,7 +212,7 @@ void Setup_Input::cancel()
void Setup_Input::action(const ActionEvent &event)
{
- const std::string id = event.getId();
+ const std::string &id = event.getId();
if (event.getSource() == mKeyList)
{
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 7cad9999c..c7212314d 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -1217,13 +1217,6 @@ bool Window::isResizeAllowed(const MouseEvent &event) const
return false;
}
-int Window::getGuiAlpha() const
-{
- const float alpha = std::max(client->getGuiAlpha(),
- theme->getMinimumOpacity());
- return static_cast<int>(alpha * 255.0F);
-}
-
Layout &Window::getLayout()
{
if (!mLayout)
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index 175cc25f0..1795f2843 100644
--- a/src/gui/widgets/window.h
+++ b/src/gui/widgets/window.h
@@ -448,11 +448,6 @@ class Window : public BasicContainer2,
*/
void setModal(const bool modal);
- /**
- * Gets the alpha value used by the window, in a GUIChan usable format.
- */
- int getGuiAlpha() const A_WARN_UNUSED;
-
Rect getWindowArea() const A_WARN_UNUSED;
bool isResizeAllowed(const MouseEvent &event) const A_WARN_UNUSED;
diff --git a/src/gui/windows/changeemaildialog.cpp b/src/gui/windows/changeemaildialog.cpp
index ce9ec84e8..0f4086a0b 100644
--- a/src/gui/windows/changeemaildialog.cpp
+++ b/src/gui/windows/changeemaildialog.cpp
@@ -119,8 +119,8 @@ void ChangeEmailDialog::action(const ActionEvent &event)
else if (eventId == "change_email")
{
const std::string username = mLoginData->username.c_str();
- const std::string newFirstEmail = mFirstEmailField->getText();
- const std::string newSecondEmail = mSecondEmailField->getText();
+ const std::string &newFirstEmail = mFirstEmailField->getText();
+ const std::string &newSecondEmail = mSecondEmailField->getText();
logger->log("ChangeEmailDialog::Email change, Username is %s",
username.c_str());
diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp
index 051fa6434..eb7380f20 100644
--- a/src/gui/windows/changepassworddialog.cpp
+++ b/src/gui/windows/changepassworddialog.cpp
@@ -98,9 +98,9 @@ void ChangePasswordDialog::action(const ActionEvent &event)
else if (eventId == "change_password")
{
const std::string username = mLoginData->username.c_str();
- const std::string oldPassword = mOldPassField->getText();
- const std::string newFirstPass = mFirstPassField->getText();
- const std::string newSecondPass = mSecondPassField->getText();
+ const std::string &oldPassword = mOldPassField->getText();
+ const std::string &newFirstPass = mFirstPassField->getText();
+ const std::string &newSecondPass = mSecondPassField->getText();
logger->log("ChangePasswordDialog::Password change, Username is %s",
username.c_str());
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index f0a9781f2..0fe412e5c 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -321,7 +321,7 @@ CharCreateDialog::~CharCreateDialog()
void CharCreateDialog::action(const ActionEvent &event)
{
- const std::string id = event.getId();
+ const std::string &id = event.getId();
if (id == "create")
{
if (getName().length() >= 4)
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index c3a3569f7..be2daf6a9 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -1021,7 +1021,7 @@ void ChatWindow::processEvent(const Channels channel,
void ChatWindow::addInputText(const std::string &text, const bool space)
{
const int caretPos = mChatInput->getCaretPosition();
- const std::string inputText = mChatInput->getText();
+ const std::string &inputText = mChatInput->getText();
std::ostringstream ss;
ss << inputText.substr(0, caretPos) << text;
@@ -1275,7 +1275,7 @@ void ChatWindow::autoComplete()
{
const int caretPos = mChatInput->getCaretPosition();
int startName = 0;
- const std::string inputText = mChatInput->getText();
+ const std::string &inputText = mChatInput->getText();
std::string name = inputText.substr(0, caretPos);
for (int f = caretPos - 1; f > -1; f --)
@@ -1643,7 +1643,7 @@ void ChatWindow::updateOnline(std::set<std::string> &onlinePlayers) const
}
else
{
- const std::string nick = tab->getNick();
+ const std::string &nick = tab->getNick();
if (actorManager)
{
const Being *const being = actorManager->findBeingByName(
diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp
index b1355ba46..601101bef 100644
--- a/src/gui/windows/outfitwindow.cpp
+++ b/src/gui/windows/outfitwindow.cpp
@@ -227,7 +227,7 @@ void OutfitWindow::save() const
void OutfitWindow::action(const ActionEvent &event)
{
- const std::string eventId = event.getId();
+ const std::string &eventId = event.getId();
if (eventId == "next")
{
next();
diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp
index 55a328fa8..6d3cf9d9f 100644
--- a/src/gui/windows/registerdialog.cpp
+++ b/src/gui/windows/registerdialog.cpp
@@ -182,7 +182,7 @@ void RegisterDialog::action(const ActionEvent &event)
}
else if (eventId == "register" && canSubmit())
{
- const std::string user = mUserField->getText();
+ const std::string &user = mUserField->getText();
logger->log("RegisterDialog::register Username is %s", user.c_str());
std::string errorMsg;
diff --git a/src/gui/windows/unregisterdialog.cpp b/src/gui/windows/unregisterdialog.cpp
index bb309c6f1..3d8627add 100644
--- a/src/gui/windows/unregisterdialog.cpp
+++ b/src/gui/windows/unregisterdialog.cpp
@@ -111,7 +111,7 @@ void UnRegisterDialog::action(const ActionEvent &event)
else if (eventId == "unregister")
{
const std::string username = mLoginData->username.c_str();
- const std::string password = mPasswordField->getText();
+ const std::string &password = mPasswordField->getText();
logger->log("UnregisterDialog::unregistered, Username is %s",
username.c_str());
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 80275325a..824d8e0f6 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -1072,7 +1072,7 @@ void UpdaterWindow::loadDirMods(const std::string &dir)
const ModInfo *const mod = (*modIt).second;
if (mod)
{
- const std::string localDir = mod->getLocalDir();
+ const std::string &localDir = mod->getLocalDir();
if (!localDir.empty())
resman->addToSearchPath(dir + "/" + localDir, false);
}
@@ -1095,7 +1095,7 @@ void UpdaterWindow::unloadMods(const std::string &dir)
const ModInfo *const mod = (*modIt).second;
if (mod)
{
- const std::string localDir = mod->getLocalDir();
+ const std::string &localDir = mod->getLocalDir();
if (!localDir.empty())
resman->removeFromSearchPath(dir + "/" + localDir);
}