summaryrefslogtreecommitdiff
path: root/src/utils
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/utils
parent9a970ba6bc80938b56f3ba731bf4614b40ba573d (diff)
downloadplus-6c05739c62484dae8d5ed9fb0dfdb6590aacfe88.tar.gz
plus-6c05739c62484dae8d5ed9fb0dfdb6590aacfe88.tar.bz2
plus-6c05739c62484dae8d5ed9fb0dfdb6590aacfe88.tar.xz
plus-6c05739c62484dae8d5ed9fb0dfdb6590aacfe88.zip
improve a bit strings declaration.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/cpu.cpp2
-rw-r--r--src/utils/stringutils.cpp2
-rw-r--r--src/utils/translation/poparser.cpp4
-rw-r--r--src/utils/translation/translationmanager.cpp11
4 files changed, 8 insertions, 11 deletions
diff --git a/src/utils/cpu.cpp b/src/utils/cpu.cpp
index 7f78341b5..e4615b4dd 100644
--- a/src/utils/cpu.cpp
+++ b/src/utils/cpu.cpp
@@ -90,7 +90,7 @@ void Cpu::detect()
void Cpu::printFlags()
{
- std::string str = "CPU features:";
+ std::string str("CPU features:");
if (mCpuFlags & FEATURE_MMX)
str.append(" mmx");
if (mCpuFlags & FEATURE_SSE)
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 18a3fba12..9c5a53791 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -387,7 +387,7 @@ void replaceSpecialChars(std::string &text)
}
if (idx + 1 < f && text[f] == ';')
{
- std::string str = " ";
+ std::string str(" ");
str[0] = static_cast<signed char>(atoi(text.substr(
idx, f - idx).c_str()));
text = text.substr(0, pos1) + str + text.substr(f + 1);
diff --git a/src/utils/translation/poparser.cpp b/src/utils/translation/poparser.cpp
index 55d4e01e2..b2034903d 100644
--- a/src/utils/translation/poparser.cpp
+++ b/src/utils/translation/poparser.cpp
@@ -133,7 +133,7 @@ bool PoParser::readMsgId()
if (mReadingStr)
return false;
- const std::string msgId1 = "msgid \"";
+ const std::string msgId1("msgid \"");
// check if in reading process
if (mReadingId)
@@ -175,7 +175,7 @@ bool PoParser::readMsgId()
bool PoParser::readMsgStr()
{
- const std::string msgStr1 = "msgstr \"";
+ const std::string msgStr1("msgstr \"");
// check if in reading process
if (mReadingStr)
diff --git a/src/utils/translation/translationmanager.cpp b/src/utils/translation/translationmanager.cpp
index 0a5e7bca5..6036ddeab 100644
--- a/src/utils/translation/translationmanager.cpp
+++ b/src/utils/translation/translationmanager.cpp
@@ -109,14 +109,11 @@ bool TranslationManager::translateFile(const std::string &fileName,
const size_t pos2 = str.find(">>", pos1 + 2);
if (pos2 == std::string::npos)
break;
- const std::string key = str.substr(pos1 + 2, pos2 - pos1 - 2);
- const std::string key2 = "<<" + str.substr(
- pos1 + 2, pos2 - pos1 - 2) + ">>";
- const std::string val = dict->getStr(key);
-
-// logger->log("key:" + key);
+ const std::string key(str.substr(pos1 + 2, pos2 - pos1 - 2));
+ const std::string key2("<<" + str.substr(
+ pos1 + 2, pos2 - pos1 - 2) + ">>");
+ const std::string val(dict->getStr(key));
replaceAll(str, key2, val);
-
oldPos1 = pos1;
}