From 85faed5de109c0d5773626370bb6dbd338293f63 Mon Sep 17 00:00:00 2001 From: Silarn Date: Tue, 17 Apr 2018 19:14:17 -0500 Subject: Fix issues with download query --- src/downloadmanager.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/downloadmanager.cpp') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index d54d6f24..23a1931e 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -738,6 +738,20 @@ void DownloadManager::queryInfo(int index) return; } } + + if (info->m_FileInfo->gameName.size() == 0) { + SelectionDialog selection(tr("Please select the source game code for %1").arg(getFileName(index))); + + std::vector> choices = m_NexusInterface->getGameChoices(m_ManagedGame); + 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; setState(info, STATE_FETCHINGMODINFO); } @@ -1204,13 +1218,11 @@ void DownloadManager::nxmFilesAvailable(QString, int, QVariant userData, QVarian if (!info->m_FileInfo->version.isValid()) { info->m_FileInfo->version = info->m_FileInfo->newestVersion; } - // we receive some names html-encoded. This is used to decode it - QTextDocument doc; - doc.setHtml(fileInfo["modName"].toString()); - info->m_FileInfo->modName = doc.toPlainText(); info->m_FileInfo->fileCategory = convertFileCategory(fileInfo["category_id"].toInt()); info->m_FileInfo->fileTime = matchDate(fileInfo["date"].toString()); info->m_FileInfo->fileID = fileInfo["id"].toInt(); + info->m_FileInfo->fileName = fileInfo["uri"].toString(); + info->m_FileInfo->description = BBCode::convertToHTML(fileInfo["description"].toString()); found = true; break; } -- cgit v1.3.1