oops, I forgot I wanted to fix that before committing xD
authorsheepluva
Tue, 27 Sep 2011 05:08:23 +0200
changeset 6050 07561ade87ca
parent 6048 ae213ef7030a
child 6052 5e3e7d19bdb5
oops, I forgot I wanted to fix that before committing xD
QTfrontend/pagetraining.cpp
--- a/QTfrontend/pagetraining.cpp	Tue Sep 27 04:31:08 2011 +0200
+++ b/QTfrontend/pagetraining.cpp	Tue Sep 27 05:08:23 2011 +0200
@@ -83,7 +83,6 @@
     tmpdir.cd("Data/Missions/Training");
     QStringList missionList = scriptList(tmpdir);
     missionList.sort();
-    missionList.replaceInStrings(QRegExp("$")," *");
 
     tmpdir.cd(datadir->absolutePath());
     tmpdir.cd("Missions/Training");
@@ -119,7 +118,10 @@
 
 void PageTraining::startSelected()
 {
-    emit startMission(lstMissions->currentItem()->data(Qt::UserRole).toString());
+    QListWidgetItem * curItem = lstMissions->currentItem();
+
+    if (curItem != NULL)
+        emit startMission(curItem->data(Qt::UserRole).toString());
 }
 
 
@@ -127,6 +129,7 @@
 {
     if (lstMissions->currentItem())
     {
+        // TODO also use .pngs in userdata folder
         QString thumbFile = datadir->absolutePath() + "/Graphics/Missions/Training/" + lstMissions->currentItem()->data(Qt::UserRole).toString() + ".png";
         if (QFile::exists(thumbFile))
             btnStart->setIcon(QIcon(thumbFile));