summaryrefslogtreecommitdiff
path: root/src/gui/serverdialog.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2011-04-30 14:52:03 +0200
committerStefan Dombrowski <stefan@uni-bonn.de>2011-04-30 14:52:03 +0200
commitfe87acd14acd2aa33c9b8a03a77d80d6a7648f1b (patch)
treedbf7b84349728b3abcf88fade6ea3d3f5da1ecc8 /src/gui/serverdialog.cpp
parenta4d74829e50d9082deb1a9973bd3360d6babd147 (diff)
downloadmana-client-fe87acd14acd2aa33c9b8a03a77d80d6a7648f1b.tar.gz
mana-client-fe87acd14acd2aa33c9b8a03a77d80d6a7648f1b.tar.bz2
mana-client-fe87acd14acd2aa33c9b8a03a77d80d6a7648f1b.tar.xz
mana-client-fe87acd14acd2aa33c9b8a03a77d80d6a7648f1b.zip
Revert "Add option for sorting servers list"
This reverts commits e35b3bdd0a74464e4b4d3b931ca416f0c7864ba6 and e35b3bdd0a74464e4b4d3b931ca416f0c7864ba6. Sometimes the text fields and the list show different server selected, so you don't see to what server you connect. It is a big security risk sending your user name and password to the wrong server. Reviewed-by: Freeyorp, Bertram
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r--src/gui/serverdialog.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index d68e2eca..2994cbaf 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -52,7 +52,6 @@
#include <cstdlib>
#include <iostream>
#include <string>
-#include <algorithm>
static const int MAX_SERVERLIST = 6;
@@ -592,58 +591,6 @@ void ServerDialog::loadServers()
if (!found)
mServers.push_back(server);
}
-
- reorderList(config.getIntValue("serverListOrder"));
-}
-
-/**
- * Returns true if serv1 must appear before serv2
- */
-bool ServerDialog::sortByLastUsage(const ServerInfo& serv1, const ServerInfo& serv2)
-{
- int rank1 = -1;
- int rank2 = -1;
-
- for (int i = 0; i < MAX_SERVERLIST; ++i)
- {
- const std::string index = toString(i);
- const std::string nameKey = "MostUsedServerName" + index;
- std::string serv = config.getValue(nameKey, "");
- if (serv == serv1.hostname)
- rank1 = i;
- else if (serv == serv2.hostname)
- rank2 = i;
- }
-
- if (rank1 > rank2)
- return true;
-
- if (rank2 > rank1)
- return false;
-
- return ServerDialog::sortByName(serv1, serv2);
-}
-
-/**
- * Returns true if serv1 must appear before serv2
- */
-bool ServerDialog::sortByName(const ServerInfo& serv1, const ServerInfo& serv2)
-{
- return compareStrI(serv1.name, serv2.name) < 0;
-}
-
-/**
- * Reorders the server list
- * @param orderBy
- * - 0 : Order by last change (default)
- * - 1 : Order by name
- */
-void ServerDialog::reorderList(int orderBy)
-{
- if (orderBy == 0)
- std::sort(mServers.begin(), mServers.end(), ServerDialog::sortByLastUsage);
- else
- std::sort(mServers.begin(), mServers.end(), ServerDialog::sortByName);
}
void ServerDialog::loadCustomServers()