From d87d5e6f006d249fd5b496d09755ee8bd39877ba Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 3 Mar 2018 12:20:59 -0800 Subject: [PATCH] Remove the reverse song constant lookup --- mainwindow.cpp | 6 +----- project.cpp | 20 -------------------- project.h | 1 - 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 3ee30ad2..fd5bebc5 100755 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -203,11 +203,7 @@ void MainWindow::displayMapProperties() { QStringList songs = project->getSongNames(); ui->comboBox_Song->addItems(songs); - QString song = map->song; - if (!songs.contains(song)) { - song = project->getSongName(song.toInt()); - } - ui->comboBox_Song->setCurrentText(song); + ui->comboBox_Song->setCurrentText(map->song); ui->comboBox_Location->addItems(project->getLocations()); ui->comboBox_Location->setCurrentText(map->location); diff --git a/project.cpp b/project.cpp index 6768e1fd..974dbefe 100755 --- a/project.cpp +++ b/project.cpp @@ -1114,26 +1114,6 @@ QStringList Project::getSongNames() { return names; } -QString Project::getSongName(int songNumber) { - QStringList names; - QString text = readTextFile(root + "/include/constants/songs.h"); - if (!text.isNull()) { - QStringList songDefinePrefixes; - songDefinePrefixes << "SE_" << "BGM_"; - QMap songDefines = readCDefines(text, songDefinePrefixes); - - // Loop through song defines, and fine the one with the matching song number. - QMap::iterator iter = songDefines.begin(); - while (iter != songDefines.end()) { - if (iter.value() == songNumber) { - return iter.key(); - } - iter++; - } - } - return ""; -} - QMap Project::getMapObjGfxConstants() { QMap constants; QString text = readTextFile(root + "/include/constants/map_objects.h"); diff --git a/project.h b/project.h index d595821b..465b4fb9 100755 --- a/project.h +++ b/project.h @@ -69,7 +69,6 @@ public: QList* parse(QString text); QStringList getSongNames(); - QString getSongName(int); QStringList getLocations(); QStringList getVisibilities(); QStringList getWeathers();