From 35742eeead80cd713e5b418b9f701afe5edccee1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 4 Oct 2014 23:41:36 +0300 Subject: Fix possible update errors with empty update server. --- src/gui/windows/updaterwindow.cpp | 13 +++++++++++-- src/gui/windows/updaterwindow.h | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src/gui/windows') diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 752aa21e6..5dc0a7708 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -208,7 +208,8 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost, mDownloadComplete(true), mUserCancel(false), mLoadUpdates(applyUpdates), - mValidateXml(false) + mValidateXml(false), + mSkipPatches(false) { setWindowName("UpdaterWindow"); setResizable(true); @@ -237,6 +238,14 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost, addKeyListener(this); + if (mUpdateHost.empty()) + { + const std::vector &mirrors = settings.updateMirrors; + if (mirrors.begin() != mirrors.end()) + mUpdateHost = *mirrors.begin(); + mSkipPatches = true; + } + loadWindowState(); } @@ -934,7 +943,7 @@ void UpdaterWindow::logic() } else { - if (!mUpdateHost.empty()) + if (!mSkipPatches) { // Download of updates completed mCurrentFile = "latest.txt"; diff --git a/src/gui/windows/updaterwindow.h b/src/gui/windows/updaterwindow.h index 59afa5a24..a5d893a5b 100644 --- a/src/gui/windows/updaterwindow.h +++ b/src/gui/windows/updaterwindow.h @@ -260,6 +260,8 @@ class UpdaterWindow final : public Window, bool mLoadUpdates; bool mValidateXml; + + bool mSkipPatches; }; extern UpdaterWindow *updaterWindow; -- cgit v1.2.3-70-g09d2