fix campaign missions not showing up for me
authorsheepluva
Sat, 22 Apr 2017 22:23:49 +0200
changeset 12305 d3a52e51efd4
parent 12304 95cd64676f73
child 12306 cdd884397760
fix campaign missions not showing up for me
QTfrontend/campaign.cpp
QTfrontend/campaign.h
QTfrontend/hwform.cpp
--- 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);
     }