summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/serverdialog.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 140e4b629..41b0076e1 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -124,6 +124,9 @@ std::string ServersListModel::getElementAt(int elementIndex)
void ServersListModel::setVersionString(int index, const std::string &version)
{
+ if (index >= mVersionStrings.size())
+ return;
+
if (version.empty())
{
mVersionStrings[index] = VersionString(0, "");
@@ -604,6 +607,13 @@ void ServerDialog::downloadServerList()
if (listFile.empty())
listFile = "http://manasource.org/serverlist.xml";
+ if (mDownload)
+ {
+ mDownload->cancel();
+ delete mDownload;
+ mDownload = 0;
+ }
+
mDownload = new Net::Download(this, listFile, &downloadUpdate);
mDownload->setFile(mDir + "/serverlist.xml");
mDownload->start();
@@ -702,7 +712,6 @@ void ServerDialog::loadServers(bool addNew)
break;
}
}
-
if (!found && addNew)
mServers.push_back(server);
}