aboutsummaryrefslogtreecommitdiff
path: root/libs/uibase/src/nxmurl.cpp
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-05-16 19:51:40 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-05-16 19:51:40 -0500
commit549b84b0f8815737c93913b200dde3821a062cb0 (patch)
treef6bfd96729016847438beda9416c93f447838077 /libs/uibase/src/nxmurl.cpp
parenta0747cabb420d699be3a1dd4c63f47c5153bd7b9 (diff)
mo2: catch up to upstream 2.5.3 Betas 3-11
Multi-area sync against the upstream MO2 2.5.3 beta line. Roughly three logical sections share the diff: Catch-up (Betas 3-11): - nxmaccessmanager: drop "supporter" from validRoles so non-premium supporters get the right download path (Beta 10) - mainwindow: disable tutorial triggers at the trigger sites; Qt 6.11 lockup on child windows (Beta 4) - basic_games: add Kingdom Come Deliverance 2, Slay the Spire 2 (Betas 11, 6) - uibase: add NXM collections parsing fields/accessors + (?:nxm|modl) scheme support in NXMUrl (Beta 9) - Starfield: blueprintPrefix() on IPluginGame; plugins.txt write suppression for blueprint plugins; hasInvalidBlueprint / hasUnpairedBlueprint diagnoses; Title-keyed content catalog consolidation (Betas 3-5) - downloadmanager + systemtraymanager + organizercore + iuserinterface + settings: add Beta 11 "show notifications when downloads complete or fail" toggle and the showNotification plumbing - nxmaccessmanager: restore upstream re-entry guard for OAuth refresh and the styled OAuth response page (Beta 11) - organizer_en.ts and game-bethesda *_en.ts: pull upstream HEAD strings Workarounds tab removed: - Delete settingsdialogworkarounds.{h,cpp}; drop the tab in settingsdialog.ui; move "Enable archives parsing" into General - Hardcode GameSettings::forceEnableCoreFiles() to true so the primary-master toggle-off bug (DLCs unchecked on tab refresh) can't recur; setter becomes a no-op - No-op stubs for offlineMode, useProxy, useCustomBrowser, Steam appID/credentials, executablesBlacklist, skipFileSuffixes, skipDirectories — UI gone, accessors keep call sites green - settingsdialognexus drops the custom-browser wiring; spawn drops the "Change the blacklist" Retry path Beta 9 download manager port: - fileID-first match in nxmFilesAvailable and nxmFileInfoFromMd5Available; filename remains the fallback - NexusInterface::isActiveFileStatus() helper; rewrite of nxmUpdatesAvailable to use pickNewestVersion / findUpdateChainSuccessors / resolveInstalledFileId. ARCHIVED_HIDDEN now correctly treated as inactive - std::optional<unsigned int> reservedID on DownloadInfo factories and on the three addDownload overloads; startDownloadURLs and startDownloadURLWithMeta return the canonical DownloadID instead of m_ActiveDownloads.size()-1 (which was the index, not an ID) - QHash<unsigned int, DownloadInfo*> m_ByID maintained alongside m_ActiveDownloads at every mutation site; downloadInfoByID is now O(1) via m_ByID.value(id, nullptr) LOOT remains intentionally stripped (lootcli build cruft cleaned up separately). BSA wide-path skipped — Linux UTF-8 paths already work. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'libs/uibase/src/nxmurl.cpp')
-rw-r--r--libs/uibase/src/nxmurl.cpp33
1 files changed, 23 insertions, 10 deletions
diff --git a/libs/uibase/src/nxmurl.cpp b/libs/uibase/src/nxmurl.cpp
index 33bb22f..bdb9f7b 100644
--- a/libs/uibase/src/nxmurl.cpp
+++ b/libs/uibase/src/nxmurl.cpp
@@ -29,16 +29,29 @@ NXMUrl::NXMUrl(const QString& url)
{
QUrl nxm(url);
QUrlQuery query(nxm);
- QRegularExpression exp("(?:nxm|modl)://[a-z0-9]+/mods/(\\d+)/files/(\\d+)",
- QRegularExpression::CaseInsensitiveOption);
- auto match = exp.match(url);
- if (!match.hasMatch()) {
+
+ static const QRegularExpression modRegex(
+ "(?:nxm|modl)://[a-z0-9]+/mods/(\\d+)/files/(\\d+)",
+ QRegularExpression::CaseInsensitiveOption);
+ static const QRegularExpression collectionRegex(
+ "(?:nxm|modl)://[a-z0-9]+/collections/([a-z0-9]+)/revisions/(\\d+)",
+ QRegularExpression::CaseInsensitiveOption);
+
+ m_Game = nxm.host();
+
+ if (const auto modMatch = modRegex.match(url); modMatch.hasMatch()) {
+ m_Collection = false;
+ m_ModId = modMatch.captured(1).toInt();
+ m_FileId = modMatch.captured(2).toInt();
+ m_Key = query.queryItemValue("key");
+ m_Expires = query.queryItemValue("expires").toInt();
+ m_UserId = query.queryItemValue("user_id").toInt();
+ } else if (const auto collectionMatch = collectionRegex.match(url);
+ collectionMatch.hasMatch()) {
+ m_Collection = true;
+ m_CollectionId = collectionMatch.captured(1);
+ m_CollectionRevision = collectionMatch.captured(2).toInt();
+ } else {
throw MOBase::InvalidNXMLinkException(url);
}
- m_Game = nxm.host();
- m_ModId = match.captured(1).toInt();
- m_FileId = match.captured(2).toInt();
- m_Key = query.queryItemValue("key");
- m_Expires = query.queryItemValue("expires").toInt();
- m_UserId = query.queryItemValue("user_id").toInt();
}