--- a/QTfrontend/campaign.cpp Sat Apr 22 20:37:51 2017 +0200
+++ b/QTfrontend/campaign.cpp Sat Apr 22 22:23:49 2017 +0200
@@ -107,11 +107,10 @@
}
/** Returns the localized campaign name */
-QString getRealCampName(QString & campaignName)
+QString getRealCampName(const QString & campaignName)
{
- QString campaignNameOrig = campaignName;
- QString campaignNameSpaces = campaignName.replace(QString("_"), QString(" "));
- return getCampMetaInfo()->value(campaignNameOrig+".name", campaignNameSpaces).toString();
+ QString campaignNameSpaces = QString(campaignName).replace(QString("_"), QString(" "));
+ return getCampMetaInfo()->value(campaignName+".name", campaignNameSpaces).toString();
}
QList<MissionInfo> getCampMissionList(QString & campaignName, QString & teamName)
--- a/QTfrontend/campaign.h Sat Apr 22 20:37:51 2017 +0200
+++ b/QTfrontend/campaign.h Sat Apr 22 22:23:49 2017 +0200
@@ -37,7 +37,7 @@
QSettings* getCampMetaInfo();
bool isCampWon(QString & campaignName, QString & teamName);
bool isMissionWon(QString & campaignName, int missionInList, QString & teamName);
-QString getRealCampName(QString & campaignName);
+QString getRealCampName(const QString & campaignName);
QList<MissionInfo> getCampMissionList(QString & campaignName, QString & teamName);
#endif
--- a/QTfrontend/hwform.cpp Sat Apr 22 20:37:51 2017 +0200
+++ b/QTfrontend/hwform.cpp Sat Apr 22 22:23:49 2017 +0200
@@ -1911,7 +1911,7 @@
for(unsigned int i = 0; i < n; i++)
{
- QString campaignName = QString(entries[i]);
+ const QString & campaignName = entries[i];
QString tName = team.name();
ui.pageCampaign->CBCampaign->addItem(getRealCampName(campaignName), campaignName);
}