diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/windows/serverdialog.cpp | 11 | ||||
-rw-r--r-- | src/gui/windows/serverdialog.h | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index ab630e960..1970e8ca4 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -258,7 +258,8 @@ void ServerDialog::connectToSelectedServer() if (chatLogger != nullptr) chatLogger->setServerName(mServerInfo->hostname); - saveCustomServers(*mServerInfo); + saveCustomServers(*mServerInfo, + -1); if (!LoginDialog::savedPasswordKey.empty()) { @@ -312,7 +313,8 @@ void ServerDialog::action(const ActionEvent &event) { mServersList->setSelected(0); mServers.erase(mServers.begin() + index); - saveCustomServers(); + saveCustomServers(ServerInfo(), + -1); } } else if (eventId == "info") @@ -357,7 +359,8 @@ void ServerDialog::keyPressed(KeyEvent &event) { mServersList->setSelected(0); mServers.erase(mServers.begin() + index); - saveCustomServers(); + saveCustomServers(ServerInfo(), + -1); } return; } @@ -413,7 +416,7 @@ void ServerDialog::logic() MutexLocker tempLock(&mMutex); if (mDownloadStatus == ServerDialogDownloadStatus::COMPLETE) { - loadServers(); + loadServers(true); mDownloadStatus = ServerDialogDownloadStatus::OVER; mDescription->setCaption(std::string()); logger->log("Servers list updated"); diff --git a/src/gui/windows/serverdialog.h b/src/gui/windows/serverdialog.h index b541e7f65..484c28507 100644 --- a/src/gui/windows/serverdialog.h +++ b/src/gui/windows/serverdialog.h @@ -111,12 +111,12 @@ class ServerDialog final : public Window, */ void downloadServerList(); - void loadServers(const bool addNew = true); + void loadServers(const bool addNew); void loadCustomServers(); - void saveCustomServers(const ServerInfo ¤tServer = ServerInfo(), - const int index = -1); + void saveCustomServers(const ServerInfo ¤tServer, + const int index); bool needUpdateServers() const; |