From b592850c224965729dfb68fcdce486346ab8301a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 3 May 2014 17:31:26 +0300 Subject: Add support for update server mirrors. --- src/gui/windows/serverdialog.cpp | 7 +++++++ src/gui/windows/updaterwindow.cpp | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'src/gui') diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index c9695c2c1..653d62567 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -329,6 +329,7 @@ void ServerDialog::connectToSelectedServer() mServerInfo->supportUrl = server.supportUrl; mServerInfo->save = true; mServerInfo->persistentIp = server.persistentIp; + mServerInfo->updateMirrors = server.updateMirrors; if (chatLogger) chatLogger->setServerName(mServerInfo->hostname); @@ -637,6 +638,11 @@ void ServerDialog::loadServers(const bool addNew) subNode->xmlChildrenNode->content); server.persistentIp = (text == "1" || text == "true"); } + else if (xmlNameEqual(subNode, "updateMirror")) + { + server.updateMirrors.push_back(reinterpret_cast( + subNode->xmlChildrenNode->content)); + } } server.version.first = font->getWidth(version); @@ -659,6 +665,7 @@ void ServerDialog::loadServers(const bool addNew) mServers[i].supportUrl = server.supportUrl; mServers[i].althostname = server.althostname; mServers[i].persistentIp = server.persistentIp; + mServers[i].updateMirrors = server.updateMirrors; mServersListModel->setVersionString(i, version); found = true; break; diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 75460cf78..37bbabda3 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -540,6 +540,10 @@ void UpdaterWindow::download() "/").append(mCurrentFile), &updateProgress, false, false); } + const std::vector &mirrors = client->getMirrors(); + FOR_EACH (std::vector::const_iterator, it, mirrors) + mDownload->addMirror(*it); + if (mStoreInMemory) { mDownload->setWriteFunction(&UpdaterWindow::memoryWrite); -- cgit v1.2.3-70-g09d2