diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/char_select.cpp | 2 | ||||
-rw-r--r-- | src/gui/char_server.cpp | 4 | ||||
-rw-r--r-- | src/gui/chat.cpp | 23 | ||||
-rw-r--r-- | src/gui/color.cpp | 2 | ||||
-rw-r--r-- | src/gui/debugwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/emotecontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/emoteshortcutcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/emotewindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/equipmentwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/inttextfield.cpp | 2 | ||||
-rw-r--r-- | src/gui/inventorywindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/itemcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/itempopup.cpp | 2 | ||||
-rw-r--r-- | src/gui/itemshortcutcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/login.cpp | 2 | ||||
-rw-r--r-- | src/gui/ministatus.cpp | 2 | ||||
-rw-r--r-- | src/gui/recorder.cpp | 2 | ||||
-rw-r--r-- | src/gui/register.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_colors.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_keyboard.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_video.cpp | 2 | ||||
-rw-r--r-- | src/gui/shortcutcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/status.cpp | 2 | ||||
-rw-r--r-- | src/gui/trade.cpp | 2 | ||||
-rw-r--r-- | src/gui/updatewindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 2 |
26 files changed, 31 insertions, 44 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index 3b088d46..34218477 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -46,7 +46,7 @@ #include "../utils/gettext.h" #include "../utils/strprintf.h" -#include "../utils/trim.h" +#include "../utils/stringutils.h" // Defined in main.cpp, used here for setting the char create dialog extern CharServerHandler charServerHandler; diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp index 8e7b0dbc..89bfa93a 100644 --- a/src/gui/char_server.cpp +++ b/src/gui/char_server.cpp @@ -29,7 +29,7 @@ #include "../serverinfo.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" extern SERVER_INFO **server_info; @@ -101,7 +101,7 @@ void ServerSelectDialog::action(const gcn::ActionEvent &event) { mOkButton->setEnabled(false); const SERVER_INFO *si = server_info[mServerList->getSelected()]; - mLoginData->hostname = iptostring(si->address); + mLoginData->hostname = ipToString(si->address); mLoginData->port = si->port; mLoginData->updateHost = si->updateHost; state = mNextState; diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 89588cee..ac13355c 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -46,8 +46,7 @@ #include "../utils/gettext.h" #include "../utils/strprintf.h" -#include "../utils/tostring.h" -#include "../utils/trim.h" +#include "../utils/stringutils.h" ChatWindow::ChatWindow(Network * network): Window(""), mNetwork(network), mTmpVisible(false) @@ -338,15 +337,8 @@ void ChatWindow::whisper(const std::string &nick, std::string msg) std::string playerName = player_node->getName(); std::string tempNick = recvnick; - for (unsigned int i = 0; i < playerName.size(); i++) - { - playerName[i] = (char) tolower(playerName[i]); - } - - for (unsigned int i = 0; i < tempNick.size(); i++) - { - tempNick[i] = (char) tolower(tempNick[i]); - } + toLower(playerName); + toLower(tempNick); if (tempNick.compare(playerName) == 0 || msg.empty()) return; @@ -407,14 +399,9 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg) start = msg.find('[', start + 1); } - std::string temp = msg.substr(start+1, end - start - 1); - - trim(temp); + std::string temp = msg.substr(start + 1, end - start - 1); - for (unsigned int i = 0; i < temp.size(); i++) - { - temp[i] = (char) tolower(temp[i]); - } + toLower(trim(temp)); const ItemInfo itemInfo = ItemDB::get(temp); if (itemInfo.getName() != _("Unknown item")) diff --git a/src/gui/color.cpp b/src/gui/color.cpp index 31fa8ea4..f9b89857 100644 --- a/src/gui/color.cpp +++ b/src/gui/color.cpp @@ -24,7 +24,7 @@ #include "../configuration.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" Color::Color() { diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp index 5a5acfad..2ed891db 100644 --- a/src/gui/debugwindow.cpp +++ b/src/gui/debugwindow.cpp @@ -33,7 +33,7 @@ #include "../particle.h" #include "../map.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" DebugWindow::DebugWindow(): Window("Debug") diff --git a/src/gui/emotecontainer.cpp b/src/gui/emotecontainer.cpp index 94ce9736..e22b031b 100644 --- a/src/gui/emotecontainer.cpp +++ b/src/gui/emotecontainer.cpp @@ -38,7 +38,7 @@ #include "../utils/dtor.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" const int EmoteContainer::gridWidth = 34; // emote icon width + 4 const int EmoteContainer::gridHeight = 36; // emote icon height + 4 diff --git a/src/gui/emoteshortcutcontainer.cpp b/src/gui/emoteshortcutcontainer.cpp index b66592c1..a0739723 100644 --- a/src/gui/emoteshortcutcontainer.cpp +++ b/src/gui/emoteshortcutcontainer.cpp @@ -38,7 +38,7 @@ #include "../utils/dtor.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" static const int MAX_ITEMS = 12; diff --git a/src/gui/emotewindow.cpp b/src/gui/emotewindow.cpp index 745d10a9..48635720 100644 --- a/src/gui/emotewindow.cpp +++ b/src/gui/emotewindow.cpp @@ -30,7 +30,7 @@ #include "../localplayer.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" EmoteWindow::EmoteWindow(): Window(_("Emote")) diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index 7361f7ab..02a0729b 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -40,7 +40,7 @@ #include "../resources/resourcemanager.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" // Positions of the boxes, 2nd dimension is X and Y respectively. static const int boxPosition[][2] = { diff --git a/src/gui/inttextfield.cpp b/src/gui/inttextfield.cpp index 9f633965..d3fe448b 100644 --- a/src/gui/inttextfield.cpp +++ b/src/gui/inttextfield.cpp @@ -22,7 +22,7 @@ #include "inttextfield.h" #include "sdlinput.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" IntTextField::IntTextField(int def): TextField(toString(def)), diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 880994d7..fea86b81 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -44,7 +44,7 @@ #include "../utils/gettext.h" #include "../utils/strprintf.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" InventoryWindow::InventoryWindow(int invSize): Window(_("Inventory")), diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 6e73731b..eed31f7a 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -38,7 +38,7 @@ #include "../resources/image.h" #include "../resources/resourcemanager.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" const int ItemContainer::gridWidth = 36; // item icon width + 4 const int ItemContainer::gridHeight = 42; // item icon height + 10 diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index 9e7cb8a9..48aa7c8c 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -37,7 +37,7 @@ #include "../resources/iteminfo.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" ItemPopup::ItemPopup(): Window() diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp index 9d1b6375..e5990a28 100644 --- a/src/gui/itemshortcutcontainer.cpp +++ b/src/gui/itemshortcutcontainer.cpp @@ -35,7 +35,7 @@ #include "../resources/image.h" #include "../resources/resourcemanager.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" ItemShortcutContainer::ItemShortcutContainer(): ShortcutContainer(), diff --git a/src/gui/login.cpp b/src/gui/login.cpp index e9964f2e..e91f7616 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -38,7 +38,7 @@ #include "../configuration.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" static const int MAX_SERVER_LIST_SIZE = 5; static const int LOGIN_DIALOG_WIDTH = 220; diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp index 7058d572..25f17bd3 100644 --- a/src/gui/ministatus.cpp +++ b/src/gui/ministatus.cpp @@ -28,7 +28,7 @@ #include "../graphics.h" #include "../localplayer.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" MiniStatusWindow::MiniStatusWindow(): Window("") diff --git a/src/gui/recorder.cpp b/src/gui/recorder.cpp index 8177f108..ce097db2 100644 --- a/src/gui/recorder.cpp +++ b/src/gui/recorder.cpp @@ -28,7 +28,7 @@ #include "widgets/layout.h" -#include "../utils/trim.h" +#include "../utils/stringutils.h" Recorder::Recorder(ChatWindow *chat, const std::string &title, const std::string &buttonTxt) : diff --git a/src/gui/register.cpp b/src/gui/register.cpp index e17f5902..c2190501 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -39,7 +39,7 @@ #include "../utils/gettext.h" #include "../utils/strprintf.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" /** * Listener used while dealing with wrong data. It is used to direct the focus diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp index d8053ae6..49c99996 100644 --- a/src/gui/setup_colors.cpp +++ b/src/gui/setup_colors.cpp @@ -40,7 +40,7 @@ #include "../configuration.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" Setup_Colors::Setup_Colors() : mSelected(-1) diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp index ab85900a..aba8cf35 100644 --- a/src/gui/setup_keyboard.cpp +++ b/src/gui/setup_keyboard.cpp @@ -36,7 +36,7 @@ #include "../keyboardconfig.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" /** * The list model for key function list. diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index fd7481a5..aa39dd36 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -46,7 +46,7 @@ #include "../particle.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" extern Graphics *graphics; diff --git a/src/gui/shortcutcontainer.cpp b/src/gui/shortcutcontainer.cpp index 282349dc..74609fa1 100644 --- a/src/gui/shortcutcontainer.cpp +++ b/src/gui/shortcutcontainer.cpp @@ -25,7 +25,7 @@ #include "../resources/image.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" float ShortcutContainer::mAlpha = config.getValue("guialpha", 0.8); diff --git a/src/gui/status.cpp b/src/gui/status.cpp index f6ca9698..b1a973fe 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -33,7 +33,7 @@ #include "../utils/gettext.h" #include "../utils/strprintf.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" StatusWindow::StatusWindow(LocalPlayer *player): Window(player->getName()), diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index 529d06b0..2f6007a9 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -44,7 +44,7 @@ #include "../utils/gettext.h" #include "../utils/strprintf.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" TradeWindow::TradeWindow(Network *network): Window(_("Trade: You")), diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 76a2d626..6ec62337 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -44,7 +44,7 @@ #include "../resources/resourcemanager.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" /** * Calculates the Alder-32 checksum for the given file. diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 9b86a536..a1a02e1e 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -37,7 +37,7 @@ #include "../resources/monsterinfo.h" #include "../resources/resourcemanager.h" -#include "../utils/tostring.h" +#include "../utils/stringutils.h" extern volatile int tick_time; |