diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-06-29 00:11:14 +0200 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-06-29 00:13:44 +0200 |
commit | d8de4b413ed3f681aafe6e9a8fc447ddfb541cb6 (patch) | |
tree | 9b6cb38e5dc99b695491eb5b14f8e2206962d98c /src/gui/windows/updaterwindow.cpp | |
parent | 427c4ba42ff64cdf4f9c370cfd9c29785a85d27c (diff) | |
download | manaplus-use_urljoin_downloaderwindow.tar.gz manaplus-use_urljoin_downloaderwindow.tar.bz2 manaplus-use_urljoin_downloaderwindow.tar.xz manaplus-use_urljoin_downloaderwindow.zip |
use urljoin() to join URL components / no longer require slashes in oneuse_urljoin_downloaderwindow
of the components.
Diffstat (limited to 'src/gui/windows/updaterwindow.cpp')
-rw-r--r-- | src/gui/windows/updaterwindow.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 87a2b1894..ecdb9b528 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -589,15 +589,16 @@ void UpdaterWindow::download() if (mDownloadStatus == UpdateDownloadStatus::UPDATE_PATCH) { mDownload = new Net::Download(this, - branding.getStringValue("updateMirror1") + mCurrentFile, + urlJoin(branding.getStringValue("updateMirror1"), mCurrentFile), &updateProgress, true, false, mValidateXml); + for (int f = 2; f < 8; f ++) { const std::string url = branding.getStringValue( "updateMirror" + toString(f)); if (!url.empty()) - mDownload->addMirror(url + mCurrentFile); + mDownload->addMirror(urlJoin(url, mCurrentFile)); } } else @@ -611,9 +612,9 @@ void UpdaterWindow::download() mDownloadStatus == UpdateDownloadStatus::UPDATE_RESOURCES2) { const std::string str = urlJoin(mUpdateServerPath, mCurrentFile); - mDownload->addMirror(updateServer3 + str); - mDownload->addMirror(updateServer4 + str); - mDownload->addMirror(updateServer5 + str); + mDownload->addMirror(urlJoin(updateServer3, str)); + mDownload->addMirror(urlJoin(updateServer4, str)); + mDownload->addMirror(urlJoin(updateServer5, str)); } else { @@ -828,7 +829,7 @@ void UpdaterWindow::logic() // Parse current memory buffer as news and dispose of the data loadPatch(); - mUpdateHost = updateServer2 + mUpdateServerPath; + mUpdateHost = urlJoin(updateServer2, mUpdateServerPath); mUpdatesDir = pathJoin(mUpdatesDir, "fix"); mCurrentFile = xmlUpdateFile; mValidateXml = true; |