summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-04 23:41:36 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-04 23:41:36 +0300
commit35742eeead80cd713e5b418b9f701afe5edccee1 (patch)
treec83bfbe35675e52e5b51711fe45b034a4152dfa1
parentdb821a964c9a7f96222b00e6b41f91ba3384e29a (diff)
downloadManaVerse-35742eeead80cd713e5b418b9f701afe5edccee1.tar.gz
ManaVerse-35742eeead80cd713e5b418b9f701afe5edccee1.tar.bz2
ManaVerse-35742eeead80cd713e5b418b9f701afe5edccee1.tar.xz
ManaVerse-35742eeead80cd713e5b418b9f701afe5edccee1.zip
Fix possible update errors with empty update server.
-rw-r--r--src/gui/windows/updaterwindow.cpp13
-rw-r--r--src/gui/windows/updaterwindow.h2
2 files changed, 13 insertions, 2 deletions
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<std::string> &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;