summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-25 13:48:24 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-25 13:48:24 +0300
commit6c05739c62484dae8d5ed9fb0dfdb6590aacfe88 (patch)
treedf4a3e32b8ad9e77d894280966a0066f4aef0a94 /src/gui
parent9a970ba6bc80938b56f3ba731bf4614b40ba573d (diff)
downloadmanaplus-6c05739c62484dae8d5ed9fb0dfdb6590aacfe88.tar.gz
manaplus-6c05739c62484dae8d5ed9fb0dfdb6590aacfe88.tar.bz2
manaplus-6c05739c62484dae8d5ed9fb0dfdb6590aacfe88.tar.xz
manaplus-6c05739c62484dae8d5ed9fb0dfdb6590aacfe88.zip
improve a bit strings declaration.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/logindialog.cpp2
-rw-r--r--src/gui/sdlfont.cpp2
-rw-r--r--src/gui/serverdialog.cpp26
-rw-r--r--src/gui/setup_input.cpp6
-rw-r--r--src/gui/setup_relations.cpp6
-rw-r--r--src/gui/shopwindow.cpp4
-rw-r--r--src/gui/theme.cpp6
-rw-r--r--src/gui/updaterwindow.cpp6
-rw-r--r--src/gui/userpalette.cpp2
-rw-r--r--src/gui/whoisonline.cpp2
-rw-r--r--src/gui/widgets/chattab.cpp4
-rw-r--r--src/gui/widgets/setupitem.cpp4
-rw-r--r--src/gui/widgets/tradetab.cpp2
13 files changed, 36 insertions, 36 deletions
diff --git a/src/gui/logindialog.cpp b/src/gui/logindialog.cpp
index c872b54a5..9af26b6ae 100644
--- a/src/gui/logindialog.cpp
+++ b/src/gui/logindialog.cpp
@@ -369,7 +369,7 @@ void LoginDialog::prepareUpdate()
}
else
{
- std::string str = "";
+ std::string str;
if (mUpdateHostDropDown)
{
str = mUpdateHostDropDown->getSelectedString();
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp
index 07da298b2..5e859be53 100644
--- a/src/gui/sdlfont.cpp
+++ b/src/gui/sdlfont.cpp
@@ -370,7 +370,7 @@ SDLFont::SDLFont(std::string filename,
if (!mFont)
{
logger->log("Error finding font " + filename);
- std::string backFile = "fonts/dejavusans.ttf";
+ std::string backFile("fonts/dejavusans.ttf");
mFont = openFont(fixDirSeparators(backFile).c_str(), size);
if (!mFont)
{
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 325d43502..fcebad81d 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -588,7 +588,7 @@ void ServerDialog::loadServers(const bool addNew)
}
const std::string lang = getLangShort();
- const std::string description2 = "description_" + lang;
+ const std::string description2("description_" + lang);
for_each_xml_child_node(serverNode, rootNode)
{
@@ -707,13 +707,13 @@ void ServerDialog::loadCustomServers()
for (int i = 0; i < MAX_SERVERLIST; ++i)
{
const std::string index = toString(i);
- const std::string nameKey = "MostUsedServerDescName" + index;
- const std::string descKey = "MostUsedServerDescription" + index;
- const std::string hostKey = "MostUsedServerName" + index;
- const std::string typeKey = "MostUsedServerType" + index;
- const std::string portKey = "MostUsedServerPort" + index;
+ const std::string nameKey("MostUsedServerDescName" + index);
+ const std::string descKey("MostUsedServerDescription" + index);
+ const std::string hostKey("MostUsedServerName" + index);
+ const std::string typeKey("MostUsedServerType" + index);
+ const std::string portKey("MostUsedServerPort" + index);
const std::string onlineListUrlKey
- = "MostUsedServerOnlineList" + index;
+ ("MostUsedServerOnlineList" + index);
ServerInfo server;
server.name = config.getValue(nameKey, "");
@@ -771,13 +771,13 @@ void ServerDialog::saveCustomServers(const ServerInfo &currentServer,
continue;
const std::string num = toString(savedServerCount);
- const std::string nameKey = "MostUsedServerDescName" + num;
- const std::string descKey = "MostUsedServerDescription" + num;
- const std::string hostKey = "MostUsedServerName" + num;
- const std::string typeKey = "MostUsedServerType" + num;
- const std::string portKey = "MostUsedServerPort" + num;
+ const std::string nameKey("MostUsedServerDescName" + num);
+ const std::string descKey("MostUsedServerDescription" + num);
+ const std::string hostKey("MostUsedServerName" + num);
+ const std::string typeKey("MostUsedServerType" + num);
+ const std::string portKey("MostUsedServerPort" + num);
const std::string onlineListUrlKey
- = "MostUsedServerOnlineList" + num;
+ ("MostUsedServerOnlineList" + num);
config.setValue(nameKey, toString(server.name));
config.setValue(descKey, toString(server.description));
diff --git a/src/gui/setup_input.cpp b/src/gui/setup_input.cpp
index 0a395e6bb..3873c2dd3 100644
--- a/src/gui/setup_input.cpp
+++ b/src/gui/setup_input.cpp
@@ -285,7 +285,7 @@ void Setup_Input::action(const gcn::ActionEvent &event)
else if (strStartWith(id, "tabs_"))
{
int k = 0;
- std::string str = "tabs_";
+ std::string str("tabs_");
while (pages[k])
{
if (str + pages[k] == id)
@@ -307,8 +307,8 @@ void Setup_Input::refreshAssignedKey(const int index)
const SetupActionData &key = setupActionData[selectedData][index];
if (key.actionId == static_cast<int>(Input::KEY_NO_VALUE))
{
- const std::string str = " \342\200\225\342\200\225\342\200\225"
- "\342\200\225\342\200\225 ";
+ const std::string str(" \342\200\225\342\200\225\342\200\225"
+ "\342\200\225\342\200\225 ");
mKeyListModel->setElementAt(index,
str + gettext(key.name.c_str()) + str);
}
diff --git a/src/gui/setup_relations.cpp b/src/gui/setup_relations.cpp
index 8a2641ea8..7e97800d5 100644
--- a/src/gui/setup_relations.cpp
+++ b/src/gui/setup_relations.cpp
@@ -238,9 +238,9 @@ public:
}
};
-static const std::string ACTION_DELETE = "delete";
-static const std::string ACTION_TABLE = "table";
-static const std::string ACTION_STRATEGY = "strategy";
+static const std::string ACTION_DELETE("delete");
+static const std::string ACTION_TABLE("table");
+static const std::string ACTION_STRATEGY("strategy");
Setup_Relations::Setup_Relations(const Widget2 *const widget) :
SetupTab(widget),
diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp
index e14dd9be9..feafdb51d 100644
--- a/src/gui/shopwindow.cpp
+++ b/src/gui/shopwindow.cpp
@@ -476,7 +476,7 @@ void ShopWindow::announce(ShopItems *const list, const int mode)
if (!list)
return;
- std::string data = "\302\202";
+ std::string data("\302\202");
if (mode == BUY)
data.append("Buy ");
else
@@ -537,7 +537,7 @@ void ShopWindow::giveList(const std::string &nick, const int mode)
if (!checkFloodCounter(mLastRequestTimeList))
return;
- std::string data = "\302\202";
+ std::string data("\302\202");
ShopItems *list;
if (mode == BUY)
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 21901e0a4..8f65b6671 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -292,7 +292,7 @@ Skin *Theme::load(const std::string &filename, const std::string &filename2,
}
else
{ // first use correct density images
- const std::string endStr = "_" + mScreenDensity + ".xml";
+ const std::string endStr("_" + mScreenDensity + ".xml");
std::string name = filename;
if (findCutLast(name, ".xml"))
skin = readSkin(name + endStr, full);
@@ -1254,8 +1254,8 @@ ThemeInfo *Theme::loadInfo(const std::string &themeName)
ThemeInfo *info = new ThemeInfo();
- const std::string fontSize2 = "fontSize_" + mScreenDensity;
- const std::string npcfontSize2 = "npcfontSize_" + mScreenDensity;
+ const std::string fontSize2("fontSize_" + mScreenDensity);
+ const std::string npcfontSize2("npcfontSize_" + mScreenDensity);
for_each_xml_child_node(infoNode, rootNode)
{
if (xmlNameEqual(infoNode, "name"))
diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp
index 1dc154b23..8b0dab6b3 100644
--- a/src/gui/updaterwindow.cpp
+++ b/src/gui/updaterwindow.cpp
@@ -50,10 +50,10 @@
#include "debug.h"
-const std::string xmlUpdateFile = "resources.xml";
-const std::string txtUpdateFile = "resources2.txt";
+const std::string xmlUpdateFile("resources.xml");
+const std::string txtUpdateFile("resources2.txt");
const std::string updateServer2
- = "http://download.evolonline.org/manaplus/updates/";
+ ("http://download.evolonline.org/manaplus/updates/");
/**
* Load the given file into a vector of updateFiles.
diff --git a/src/gui/userpalette.cpp b/src/gui/userpalette.cpp
index 13bbdced4..75b0f5898 100644
--- a/src/gui/userpalette.cpp
+++ b/src/gui/userpalette.cpp
@@ -75,7 +75,7 @@ const std::string ColorTypeNames[] =
std::string UserPalette::getConfigName(const std::string &typeName)
{
- std::string res = "Color" + typeName;
+ std::string res("Color" + typeName);
size_t pos = 5;
for (size_t i = 0; i < typeName.length(); i++)
{
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp
index 7590db30b..4fd630a46 100644
--- a/src/gui/whoisonline.cpp
+++ b/src/gui/whoisonline.cpp
@@ -341,7 +341,7 @@ void WhoIsOnline::loadWebList()
// Tokenize and add each line separately
char *line = strtok(mMemoryBuffer, "\n");
- const std::string gmText = "(GM)";
+ const std::string gmText("(GM)");
FOR_EACH (std::set<OnlinePlayer*>::iterator, itd, mOnlinePlayers)
delete *itd;
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 804da2f18..aba79034f 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -142,7 +142,7 @@ void ChatTab::chatLog(std::string line, Own own,
own = ACT_IS;
}
- std::string lineColor = "##C";
+ std::string lineColor("##C");
switch (own)
{
case BY_GM:
@@ -500,7 +500,7 @@ void ChatTab::loadFromLogFile(const std::string &name)
std::list<std::string>::const_iterator i = list.begin();
while (i != list.end())
{
- std::string line = "##9" + *i;
+ std::string line("##9" + *i);
addRow(line);
++i;
}
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp
index 011f26b83..417133ec6 100644
--- a/src/gui/widgets/setupitem.cpp
+++ b/src/gui/widgets/setupitem.cpp
@@ -513,8 +513,8 @@ void SetupItemLabel::createControls()
{
if (mIsSeparator)
{
- const std::string str = " \342\200\225\342\200\225\342\200\225"
- "\342\200\225\342\200\225 ";
+ const std::string str (" \342\200\225\342\200\225\342\200\225"
+ "\342\200\225\342\200\225 ");
mLabel = new Label(this, std::string(str).append(mText).append(str));
}
else
diff --git a/src/gui/widgets/tradetab.cpp b/src/gui/widgets/tradetab.cpp
index f266f1c8c..c0a4d4d33 100644
--- a/src/gui/widgets/tradetab.cpp
+++ b/src/gui/widgets/tradetab.cpp
@@ -40,7 +40,7 @@ TradeTab::~TradeTab()
void TradeTab::handleInput(const std::string &msg)
{
- std::string str = "\302\202" + msg;
+ std::string str("\302\202" + msg);
ChatTab::handleInput(str);
}