summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/downloadmanager.cpp58
-rw-r--r--src/loglist.cpp5
-rw-r--r--src/organizer_en.ts156
-rw-r--r--src/settings.cpp1
-rw-r--r--src/version.rc4
5 files changed, 116 insertions, 108 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp
index 8b644b8c..7b416d50 100644
--- a/src/downloadmanager.cpp
+++ b/src/downloadmanager.cpp
@@ -432,6 +432,13 @@ bool DownloadManager::addDownload(QNetworkReply *reply, const QStringList &URLs,
}
}
+ // baseName could be a URL at this point so strip out the URL query
+ int queryIndex = baseName.indexOf("?");
+ if (queryIndex >= 0)
+ {
+ baseName.truncate(queryIndex);
+ }
+
startDisableDirWatcher();
newDownload->setName(getDownloadFileName(baseName), false);
endDisableDirWatcher();
@@ -951,13 +958,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;
@@ -1823,8 +1837,14 @@ void DownloadManager::nxmFileInfoFromMd5Available(QString gameName, QVariant use
auto fileDetails = results["file_details"].toMap();
if (fileDetails["file_name"].toString().compare(info->m_FileName, Qt::CaseInsensitive) == 0) {
- chosenIdx = i;
- break;
+ if (chosenIdx < 0) {
+ chosenIdx = i; //intentional to not break in order to check other results
+ }
+ else {
+ log::debug("Multiple files with same name found during MD5 search.");
+ chosenIdx = -1;
+ break;
+ }
}
}
}
@@ -1839,7 +1859,7 @@ void DownloadManager::nxmFileInfoFromMd5Available(QString gameName, QVariant use
if (chosenIdx < 0) {
chosenIdx = i; //intentional to not break in order to check other results
} else {
- log::debug("Multiple active files found during MD5 search. Defaulting to time stamps...");
+ log::debug("Multiple active files found during MD5 search.");
chosenIdx = -1;
break;
}
@@ -1847,24 +1867,14 @@ void DownloadManager::nxmFileInfoFromMd5Available(QString gameName, QVariant use
}
}
- //Look for the most recent one
+ //Unable to determine the correct mod / file. Revert to the old method
if (chosenIdx < 0) {
- int mostRecentTime = INT_MIN;
- for (int i = 0; i < resultlist.count(); i++) {
- auto results = resultlist[i].toMap();
- auto fileDetails = results["file_details"].toMap();
-
- int fileTime = fileDetails["uploaded_timestamp"].toInt();
- if (fileTime > mostRecentTime) {
- chosenIdx = i;
- mostRecentTime = fileTime;
- }
- }
+ //don't use the normal state set function as we don't want to create a meta file
+ info->m_State = DownloadManager::STATE_READY;
+ queryInfo(m_ActiveDownloads.indexOf(info));
+ return;
}
- //If nothing is preferred, just use the first one
- if (chosenIdx < 0) chosenIdx = 0;
-
auto results = resultlist[chosenIdx].toMap();
auto fileDetails = results["file_details"].toMap();
auto modDetails = results["mod"].toMap();
diff --git a/src/loglist.cpp b/src/loglist.cpp
index c884be49..5d6710c7 100644
--- a/src/loglist.cpp
+++ b/src/loglist.cpp
@@ -162,12 +162,9 @@ LogList::LogList(QWidget* parent)
{
setModel(&LogModel::instance());
- const QFontMetrics fm(font());
- const int timestampWidth = fm.horizontalAdvance("00:00:00.000");
-
header()->setMinimumSectionSize(0);
header()->resizeSection(0, 20);
- header()->resizeSection(1, timestampWidth + 8);
+ header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
setAutoScroll(true);
scrollToBottom();
diff --git a/src/organizer_en.ts b/src/organizer_en.ts
index f01334fc..48ed30e5 100644
--- a/src/organizer_en.ts
+++ b/src/organizer_en.ts
@@ -672,32 +672,32 @@ Are you absolutely sure you want to proceed?</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="486"/>
+ <location filename="downloadmanager.cpp" line="493"/>
<source>failed to download %1: could not open output file: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="509"/>
+ <location filename="downloadmanager.cpp" line="516"/>
<source>Download again?</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="509"/>
+ <location filename="downloadmanager.cpp" line="516"/>
<source>A file with the same name &quot;%1&quot; has already been downloaded. Do you want to download it again? The new file will receive a different name.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="564"/>
+ <location filename="downloadmanager.cpp" line="571"/>
<source>Wrong Game</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="564"/>
+ <location filename="downloadmanager.cpp" line="571"/>
<source>The download link is for a mod for &quot;%1&quot; but this instance of MO has been set up for &quot;%2&quot;.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="572"/>
+ <location filename="downloadmanager.cpp" line="579"/>
<source>There is already a download queued for this file.
Mod %1
@@ -705,12 +705,12 @@ File %2</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="579"/>
+ <location filename="downloadmanager.cpp" line="586"/>
<source>Already Queued</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="588"/>
+ <location filename="downloadmanager.cpp" line="595"/>
<source>There is already a download started for this file.
Mod %1: %2
@@ -718,277 +718,277 @@ File %3: %4</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="623"/>
+ <location filename="downloadmanager.cpp" line="630"/>
<source>Already Started</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="652"/>
- <location filename="downloadmanager.cpp" line="785"/>
+ <location filename="downloadmanager.cpp" line="659"/>
+ <location filename="downloadmanager.cpp" line="792"/>
<source>remove: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="671"/>
+ <location filename="downloadmanager.cpp" line="678"/>
<source>failed to delete %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="678"/>
+ <location filename="downloadmanager.cpp" line="685"/>
<source>failed to delete meta file for %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="738"/>
+ <location filename="downloadmanager.cpp" line="745"/>
<source>restore: invalid download index: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="807"/>
+ <location filename="downloadmanager.cpp" line="814"/>
<source>cancel: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="820"/>
+ <location filename="downloadmanager.cpp" line="827"/>
<source>pause: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="842"/>
+ <location filename="downloadmanager.cpp" line="849"/>
<source>resume: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="853"/>
+ <location filename="downloadmanager.cpp" line="860"/>
<source>resume (int): invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="877"/>
+ <location filename="downloadmanager.cpp" line="884"/>
<source>No known download urls. Sorry, this download can&apos;t be resumed.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="918"/>
- <location filename="downloadmanager.cpp" line="970"/>
+ <location filename="downloadmanager.cpp" line="925"/>
+ <location filename="downloadmanager.cpp" line="984"/>
<source>query: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="940"/>
+ <location filename="downloadmanager.cpp" line="947"/>
<source>Please enter the nexus mod id</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="940"/>
+ <location filename="downloadmanager.cpp" line="947"/>
<source>Mod ID:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="951"/>
+ <location filename="downloadmanager.cpp" line="958"/>
<source>Please select the source game code for %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1003"/>
+ <location filename="downloadmanager.cpp" line="1017"/>
<source>Hashing download file &apos;%1&apos;</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1004"/>
+ <location filename="downloadmanager.cpp" line="1018"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1033"/>
+ <location filename="downloadmanager.cpp" line="1047"/>
<source>VisitNexus: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1054"/>
+ <location filename="downloadmanager.cpp" line="1068"/>
<source>Nexus ID for this Mod is unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1061"/>
+ <location filename="downloadmanager.cpp" line="1075"/>
<source>OpenFile: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1078"/>
+ <location filename="downloadmanager.cpp" line="1092"/>
<source>OpenFileInDownloadsFolder: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1113"/>
+ <location filename="downloadmanager.cpp" line="1127"/>
<source>get pending: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1122"/>
+ <location filename="downloadmanager.cpp" line="1136"/>
<source>get path: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1131"/>
+ <location filename="downloadmanager.cpp" line="1145"/>
<source>Main</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1132"/>
+ <location filename="downloadmanager.cpp" line="1146"/>
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1133"/>
+ <location filename="downloadmanager.cpp" line="1147"/>
<source>Optional</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1134"/>
+ <location filename="downloadmanager.cpp" line="1148"/>
<source>Old</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1135"/>
+ <location filename="downloadmanager.cpp" line="1149"/>
<source>Miscellaneous</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1136"/>
+ <location filename="downloadmanager.cpp" line="1150"/>
<source>Deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1137"/>
+ <location filename="downloadmanager.cpp" line="1151"/>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1144"/>
+ <location filename="downloadmanager.cpp" line="1158"/>
<source>display name: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1164"/>
+ <location filename="downloadmanager.cpp" line="1178"/>
<source>file name: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1173"/>
+ <location filename="downloadmanager.cpp" line="1187"/>
<source>file time: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1192"/>
+ <location filename="downloadmanager.cpp" line="1206"/>
<source>file size: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1202"/>
+ <location filename="downloadmanager.cpp" line="1216"/>
<source>progress: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1212"/>
+ <location filename="downloadmanager.cpp" line="1226"/>
<source>state: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1222"/>
+ <location filename="downloadmanager.cpp" line="1236"/>
<source>infocomplete: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1237"/>
- <location filename="downloadmanager.cpp" line="1245"/>
- <location filename="downloadmanager.cpp" line="1258"/>
+ <location filename="downloadmanager.cpp" line="1251"/>
+ <location filename="downloadmanager.cpp" line="1259"/>
+ <location filename="downloadmanager.cpp" line="1272"/>
<source>mod id: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1266"/>
+ <location filename="downloadmanager.cpp" line="1280"/>
<source>ishidden: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1275"/>
+ <location filename="downloadmanager.cpp" line="1289"/>
<source>file info: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1285"/>
+ <location filename="downloadmanager.cpp" line="1299"/>
<source>mark installed: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1330"/>
+ <location filename="downloadmanager.cpp" line="1344"/>
<source>mark uninstalled: invalid download index %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1496"/>
+ <location filename="downloadmanager.cpp" line="1510"/>
<source>Memory allocation error (in processing progress event).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1506"/>
+ <location filename="downloadmanager.cpp" line="1520"/>
<source>Memory allocation error (in processing downloaded data).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1622"/>
+ <location filename="downloadmanager.cpp" line="1636"/>
<source>Information updated</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1624"/>
- <location filename="downloadmanager.cpp" line="1641"/>
+ <location filename="downloadmanager.cpp" line="1638"/>
+ <location filename="downloadmanager.cpp" line="1655"/>
<source>No matching file found on Nexus! Maybe this file is no longer available or it was renamed?</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1626"/>
+ <location filename="downloadmanager.cpp" line="1640"/>
<source>No file on Nexus matches the selected file by name. Please manually choose the correct one.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1782"/>
+ <location filename="downloadmanager.cpp" line="1796"/>
<source>No download server available. Please try again later.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1952"/>
+ <location filename="downloadmanager.cpp" line="1962"/>
<source>Failed to request file info from nexus: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1979"/>
+ <location filename="downloadmanager.cpp" line="1989"/>
<source>Warning: Content type is: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1984"/>
+ <location filename="downloadmanager.cpp" line="1994"/>
<source>Download header content length: %1 downloaded file size: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="1986"/>
+ <location filename="downloadmanager.cpp" line="1996"/>
<source>Download failed: %1 (%2)</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="2008"/>
+ <location filename="downloadmanager.cpp" line="2018"/>
<source>We were unable to download the file due to errors after four retries. There may be an issue with the Nexus servers.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="2091"/>
+ <location filename="downloadmanager.cpp" line="2101"/>
<source>failed to re-open %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="downloadmanager.cpp" line="2136"/>
+ <location filename="downloadmanager.cpp" line="2146"/>
<source>Unable to write download to drive (return %1).
Check the drive&apos;s available storage.
@@ -1642,37 +1642,37 @@ This is likely due to a corrupted or incompatible download or unrecognized archi
<context>
<name>LogList</name>
<message>
- <location filename="loglist.cpp" line="219"/>
+ <location filename="loglist.cpp" line="216"/>
<source>&amp;Copy all</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="loglist.cpp" line="221"/>
+ <location filename="loglist.cpp" line="218"/>
<source>C&amp;lear all</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="loglist.cpp" line="223"/>
+ <location filename="loglist.cpp" line="220"/>
<source>&amp;Level</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="loglist.cpp" line="243"/>
+ <location filename="loglist.cpp" line="240"/>
<source>&amp;Debug</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="loglist.cpp" line="244"/>
+ <location filename="loglist.cpp" line="241"/>
<source>&amp;Info</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="loglist.cpp" line="245"/>
+ <location filename="loglist.cpp" line="242"/>
<source>&amp;Warnings</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="loglist.cpp" line="246"/>
+ <location filename="loglist.cpp" line="243"/>
<source>&amp;Errors</source>
<translation type="unfinished"></translation>
</message>
@@ -6357,18 +6357,18 @@ If the folder was still in use, restart MO and try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="settings.cpp" line="1288"/>
- <location filename="settings.cpp" line="1331"/>
+ <location filename="settings.cpp" line="1289"/>
+ <location filename="settings.cpp" line="1332"/>
<source>attempt to store setting for unknown plugin &quot;%1&quot;</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="settings.cpp" line="1815"/>
+ <location filename="settings.cpp" line="1816"/>
<source>Failed</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="settings.cpp" line="1816"/>
+ <location filename="settings.cpp" line="1817"/>
<source>Failed to start the helper application: %1</source>
<translation type="unfinished"></translation>
</message>
diff --git a/src/settings.cpp b/src/settings.cpp
index 5170a5de..eff68aca 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -93,6 +93,7 @@ void Settings::processUpdates(
const QVersionNumber& currentVersion, const QVersionNumber& lastVersion)
{
if (firstStart()) {
+ set(m_Settings, "General", "version", currentVersion.toString());
return;
}
diff --git a/src/version.rc b/src/version.rc
index f6d89d2e..e6481a5a 100644
--- a/src/version.rc
+++ b/src/version.rc
@@ -3,8 +3,8 @@
// If VS_FF_PRERELEASE is not set, MO labels the build as a release and uses VER_FILEVERSION to determine version number.
// Otherwise, if letters are used in VER_FILEVERSION_STR, uses the full MOBase::VersionInfo parser
// Otherwise, uses the numbers from VER_FILEVERSION and sets the release type as pre-alpha
-#define VER_FILEVERSION 2,2,2
-#define VER_FILEVERSION_STR "2.2.2\0"
+#define VER_FILEVERSION 2,2,2,1
+#define VER_FILEVERSION_STR "2.2.2.1\0"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION