Browse Source

Remove the reverse song constant lookup

Marcus Huderle 6 years ago
parent
commit
d87d5e6f00
3 changed files with 1 additions and 26 deletions
  1. 1
    5
      mainwindow.cpp
  2. 0
    20
      project.cpp
  3. 0
    1
      project.h

+ 1
- 5
mainwindow.cpp View File

@@ -203,11 +203,7 @@ void MainWindow::displayMapProperties() {
203 203
 
204 204
     QStringList songs = project->getSongNames();
205 205
     ui->comboBox_Song->addItems(songs);
206
-    QString song = map->song;
207
-    if (!songs.contains(song)) {
208
-        song = project->getSongName(song.toInt());
209
-    }
210
-    ui->comboBox_Song->setCurrentText(song);
206
+    ui->comboBox_Song->setCurrentText(map->song);
211 207
 
212 208
     ui->comboBox_Location->addItems(project->getLocations());
213 209
     ui->comboBox_Location->setCurrentText(map->location);

+ 0
- 20
project.cpp View File

@@ -1114,26 +1114,6 @@ QStringList Project::getSongNames() {
1114 1114
     return names;
1115 1115
 }
1116 1116
 
1117
-QString Project::getSongName(int songNumber) {
1118
-    QStringList names;
1119
-    QString text = readTextFile(root + "/include/constants/songs.h");
1120
-    if (!text.isNull()) {
1121
-        QStringList songDefinePrefixes;
1122
-        songDefinePrefixes << "SE_" << "BGM_";
1123
-        QMap<QString, int> songDefines = readCDefines(text, songDefinePrefixes);
1124
-
1125
-        // Loop through song defines, and fine the one with the matching song number.
1126
-        QMap<QString, int>::iterator iter = songDefines.begin();
1127
-        while (iter != songDefines.end()) {
1128
-            if (iter.value() == songNumber) {
1129
-                return iter.key();
1130
-            }
1131
-            iter++;
1132
-        }
1133
-    }
1134
-    return "";
1135
-}
1136
-
1137 1117
 QMap<QString, int> Project::getMapObjGfxConstants() {
1138 1118
     QMap<QString, int> constants;
1139 1119
     QString text = readTextFile(root + "/include/constants/map_objects.h");

+ 0
- 1
project.h View File

@@ -69,7 +69,6 @@ public:
69 69
 
70 70
     QList<QStringList>* parse(QString text);
71 71
     QStringList getSongNames();
72
-    QString getSongName(int);
73 72
     QStringList getLocations();
74 73
     QStringList getVisibilities();
75 74
     QStringList getWeathers();