diff options
| author | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2021-12-06 03:51:08 -0600 |
|---|---|---|
| committer | Mikaƫl Capelle <capelle.mikael@gmail.com> | 2022-04-19 15:17:23 +0200 |
| commit | c4b2be45d29a247422e60bb8fdf1664c10384eee (patch) | |
| tree | 729640dc3e5105fe6eea04a5a03451176fc91a7e /src/organizercore.cpp | |
| parent | ec01532ecbd2d7c99d1b3bdd8cf261795df59327 (diff) | |
First pass for Qt6 compatibility
Diffstat (limited to 'src/organizercore.cpp')
| -rw-r--r-- | src/organizercore.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 7cf3212a..0807957b 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1428,17 +1428,20 @@ void OrganizerCore::requestDownload(const QUrl &url, QNetworkReply *reply) QString gameName = ""; int modID = 0; int fileID = 0; - QRegExp nameExp("www\\.nexusmods\\.com/(\\a+)/"); - if (nameExp.indexIn(url.toString()) != -1) { - gameName = nameExp.cap(1); + QRegularExpression nameExp("www\\.nexusmods\\.com/(\\a+)/"); + auto match = nameExp.match(url.toString()); + if (match.hasMatch()) { + gameName = match.captured(1); } - QRegExp modExp("mods/(\\d+)"); - if (modExp.indexIn(url.toString()) != -1) { - modID = modExp.cap(1).toInt(); + QRegularExpression modExp("mods/(\\d+)"); + match = modExp.match(url.toString()); + if (match.hasMatch()) { + modID = match.captured(1).toInt(); } - QRegExp fileExp("fid=(\\d+)"); - if (fileExp.indexIn(reply->url().toString()) != -1) { - fileID = fileExp.cap(1).toInt(); + QRegularExpression fileExp("fid=(\\d+)"); + match = fileExp.match(url.toString()); + if (match.hasMatch()) { + fileID = match.captured(1).toInt(); } m_DownloadManager.addDownload(reply, new ModRepositoryFileInfo(gameName, modID, fileID)); |
