From c79403e1341ac533df1771b866d1f5cee15e12b5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 28 Aug 2012 01:59:04 +0300 Subject: Add const to more classes. --- src/gui/serverdialog.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/gui/serverdialog.h') diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h index b6a45dfd9..d493a86b9 100644 --- a/src/gui/serverdialog.h +++ b/src/gui/serverdialog.h @@ -55,7 +55,8 @@ class ServersListModel : public gcn::ListModel public: typedef std::pair VersionString; - ServersListModel(ServerInfos *servers, ServerDialog *parent); + ServersListModel(ServerInfos *const servers, + ServerDialog *const parent); /** * Used to get number of line in the list @@ -70,10 +71,10 @@ class ServersListModel : public gcn::ListModel /** * Used to get the corresponding Server struct */ - const ServerInfo &getServer(int elementIndex) const + const ServerInfo &getServer(const int elementIndex) const { return mServers->at(elementIndex); } - void setVersionString(int index, const std::string &version); + void setVersionString(const int index, const std::string &version); private: typedef std::vector VersionStrings; @@ -100,7 +101,7 @@ class ServerDialog : public Window, * * @see Window::Window */ - ServerDialog(ServerInfo *serverInfo, const std::string &dir); + ServerDialog(ServerInfo *const serverInfo, const std::string &dir); /** * Destructor @@ -123,7 +124,7 @@ class ServerDialog : public Window, void logic(); - void updateServer(ServerInfo server, int index); + void updateServer(ServerInfo server, const int index); void connectToSelectedServer(); @@ -141,14 +142,14 @@ class ServerDialog : public Window, */ void downloadServerList(); - void loadServers(bool addNew = true); + void loadServers(const bool addNew = true); void loadCustomServers(); void saveCustomServers(const ServerInfo ¤tServer = ServerInfo(), - int index = -1); + const int index = -1); - bool needUpdateServers(); + bool needUpdateServers() const; static int downloadUpdate(void *ptr, DownloadStatus status, size_t total, size_t remaining); -- cgit v1.2.3-60-g2f50