summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-13 17:57:32 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-13 17:57:32 +0300
commitc4d8fa788e0f89d73ba5ae2b66b79ad0351c5fbf (patch)
tree37b78a9b847d938b5a34acf2f000fef3f31eef44
parent1302ad311b666459c4de36420af09c2a1e7867d0 (diff)
downloadManaVerse-c4d8fa788e0f89d73ba5ae2b66b79ad0351c5fbf.tar.gz
ManaVerse-c4d8fa788e0f89d73ba5ae2b66b79ad0351c5fbf.tar.bz2
ManaVerse-c4d8fa788e0f89d73ba5ae2b66b79ad0351c5fbf.tar.xz
ManaVerse-c4d8fa788e0f89d73ba5ae2b66b79ad0351c5fbf.zip
Add missing const references to constructor parameters.
-rw-r--r--src/gui/models/worldlistmodel.h2
-rw-r--r--src/gui/widgets/tabs/shortcuttab.h2
-rw-r--r--src/gui/widgets/tabs/socialfriendstab.h2
-rw-r--r--src/gui/widgets/tabs/socialplayerstab.h2
-rw-r--r--src/gui/windows/worldselectdialog.cpp2
-rw-r--r--src/gui/windows/worldselectdialog.h2
-rw-r--r--src/net/serverurlinfo.h4
-rw-r--r--src/resources/map/mapitem.cpp9
-rw-r--r--src/resources/map/mapitem.h8
-rw-r--r--src/utils/translation/podict.cpp2
-rw-r--r--src/utils/translation/podict.h2
11 files changed, 22 insertions, 15 deletions
diff --git a/src/gui/models/worldlistmodel.h b/src/gui/models/worldlistmodel.h
index 4436f848c..f22c808bb 100644
--- a/src/gui/models/worldlistmodel.h
+++ b/src/gui/models/worldlistmodel.h
@@ -35,7 +35,7 @@
class WorldListModel final : public ListModel
{
public:
- explicit WorldListModel(Worlds worlds) :
+ explicit WorldListModel(const Worlds &worlds) :
mWorlds(worlds)
{
}
diff --git a/src/gui/widgets/tabs/shortcuttab.h b/src/gui/widgets/tabs/shortcuttab.h
index 7c4419442..61652777f 100644
--- a/src/gui/widgets/tabs/shortcuttab.h
+++ b/src/gui/widgets/tabs/shortcuttab.h
@@ -31,7 +31,7 @@ class ShortcutTab final : public Tab
{
public:
ShortcutTab(const Widget2 *const widget,
- std::string name,
+ const std::string &name,
ShortcutContainer *const content) :
Tab(widget),
mContent(content)
diff --git a/src/gui/widgets/tabs/socialfriendstab.h b/src/gui/widgets/tabs/socialfriendstab.h
index 9c9525cd3..5bd13220b 100644
--- a/src/gui/widgets/tabs/socialfriendstab.h
+++ b/src/gui/widgets/tabs/socialfriendstab.h
@@ -42,7 +42,7 @@ class SocialFriendsTab final : public SocialTab
{
public:
SocialFriendsTab(const Widget2 *const widget,
- std::string name,
+ const std::string &name,
const Opaque showBackground) :
SocialTab(widget),
mBeings(new BeingsListModel),
diff --git a/src/gui/widgets/tabs/socialplayerstab.h b/src/gui/widgets/tabs/socialplayerstab.h
index f4c3f2bbe..87b0335c1 100644
--- a/src/gui/widgets/tabs/socialplayerstab.h
+++ b/src/gui/widgets/tabs/socialplayerstab.h
@@ -43,7 +43,7 @@ class SocialPlayersTab final : public SocialTab
{
public:
SocialPlayersTab(const Widget2 *const widget,
- std::string name,
+ const std::string &name,
const Opaque showBackground) :
SocialTab(widget),
mBeings(new BeingsListModel)
diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp
index a80c56085..919440a40 100644
--- a/src/gui/windows/worldselectdialog.cpp
+++ b/src/gui/windows/worldselectdialog.cpp
@@ -42,7 +42,7 @@
extern WorldInfo **server_info;
-WorldSelectDialog::WorldSelectDialog(Worlds worlds) :
+WorldSelectDialog::WorldSelectDialog(const Worlds &worlds) :
// TRANSLATORS: world select dialog name
Window(_("Select World"), Modal_false, nullptr, "world.xml"),
ActionListener(),
diff --git a/src/gui/windows/worldselectdialog.h b/src/gui/windows/worldselectdialog.h
index 6d31d2a53..4c6dc0f8c 100644
--- a/src/gui/windows/worldselectdialog.h
+++ b/src/gui/windows/worldselectdialog.h
@@ -49,7 +49,7 @@ class WorldSelectDialog final : public Window,
*
* @see Window::Window
*/
- explicit WorldSelectDialog(Worlds worlds);
+ explicit WorldSelectDialog(const Worlds &worlds);
A_DELETE_COPY(WorldSelectDialog)
diff --git a/src/net/serverurlinfo.h b/src/net/serverurlinfo.h
index 8ef5b4d7b..ea04a8c2f 100644
--- a/src/net/serverurlinfo.h
+++ b/src/net/serverurlinfo.h
@@ -33,8 +33,8 @@ struct ServerUrlInfo final
{
}
- ServerUrlInfo(const std::string name0,
- const std::string url0) :
+ ServerUrlInfo(const std::string &name0,
+ const std::string &url0) :
name(name0),
url(url0)
{
diff --git a/src/resources/map/mapitem.cpp b/src/resources/map/mapitem.cpp
index ce9e38fec..ff4b6b13e 100644
--- a/src/resources/map/mapitem.cpp
+++ b/src/resources/map/mapitem.cpp
@@ -57,7 +57,8 @@ MapItem::MapItem(const int type) :
setType(type);
}
-MapItem::MapItem(const int type, std::string comment) :
+MapItem::MapItem(const int type,
+ const std::string &comment) :
mImage(nullptr),
mComment(comment),
mName(),
@@ -68,8 +69,10 @@ MapItem::MapItem(const int type, std::string comment) :
setType(type);
}
-MapItem::MapItem(const int type, std::string comment,
- const int x, const int y) :
+MapItem::MapItem(const int type,
+ const std::string &comment,
+ const int x,
+ const int y) :
mImage(nullptr),
mComment(comment),
mName(),
diff --git a/src/resources/map/mapitem.h b/src/resources/map/mapitem.h
index c8bcf1cda..cefbaea57 100644
--- a/src/resources/map/mapitem.h
+++ b/src/resources/map/mapitem.h
@@ -39,9 +39,13 @@ class MapItem final
explicit MapItem(const int type);
- MapItem(const int type, std::string comment);
+ MapItem(const int type,
+ const std::string &comment);
- MapItem(const int type, std::string comment, const int x, const int y);
+ MapItem(const int type,
+ const std::string &comment,
+ const int x,
+ const int y);
A_DELETE_COPY(MapItem)
diff --git a/src/utils/translation/podict.cpp b/src/utils/translation/podict.cpp
index 56fd42467..cd374319f 100644
--- a/src/utils/translation/podict.cpp
+++ b/src/utils/translation/podict.cpp
@@ -31,7 +31,7 @@ PoDict *reverseDictionary = nullptr;
PoDict *mainTranslator = nullptr;
#endif // ENABLE_CUSTOMNLS
-PoDict::PoDict(std::string lang) :
+PoDict::PoDict(const std::string &lang) :
mPoLines(),
mLang(lang)
{
diff --git a/src/utils/translation/podict.h b/src/utils/translation/podict.h
index d40aa1499..d8f47b896 100644
--- a/src/utils/translation/podict.h
+++ b/src/utils/translation/podict.h
@@ -31,7 +31,7 @@ typedef std::map <std::string, std::string> PoMap;
class PoDict final
{
public:
- explicit PoDict(std::string lang);
+ explicit PoDict(const std::string &lang);
A_DELETE_COPY(PoDict)