diff options
| author | Chris Bessent <lost.dragonist@gmail.com> | 2020-01-10 16:55:19 -0700 |
|---|---|---|
| committer | Chris Bessent <lost.dragonist@gmail.com> | 2020-01-10 17:18:45 -0700 |
| commit | 3cfa7bbe74e0f72a08a6f9f1c366f4ed21aca6d5 (patch) | |
| tree | 15d39cd3388ec07e6b6b6fa292870ff81fc802da /src/downloadmanager.cpp | |
| parent | 08410deece846839b3e4e52e45d2d7b2264689e0 (diff) | |
Don't ask for the game when there's only one game
Diffstat (limited to 'src/downloadmanager.cpp')
| -rw-r--r-- | src/downloadmanager.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index fa2c959c..34eebf0c 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -951,13 +951,20 @@ void DownloadManager::queryInfo(int index) SelectionDialog selection(tr("Please select the source game code for %1").arg(getFileName(index))); std::vector<std::pair<QString, QString>> choices = m_NexusInterface->getGameChoices(m_ManagedGame); - for (auto choice : choices) { - selection.addChoice(choice.first, choice.second, choice.first); + if (choices.size() == 1) + { + info->m_FileInfo->gameName = choices[0].first; } - if (selection.exec() == QDialog::Accepted) { - info->m_FileInfo->gameName = selection.getChoiceData().toString(); - } else { - info->m_FileInfo->gameName = m_ManagedGame->gameShortName(); + else { + for (auto choice : choices) { + selection.addChoice(choice.first, choice.second, choice.first); + } + if (selection.exec() == QDialog::Accepted) { + info->m_FileInfo->gameName = selection.getChoiceData().toString(); + } + else { + info->m_FileInfo->gameName = m_ManagedGame->gameShortName(); + } } } info->m_ReQueried = true; |
