Commit 5a6478c8 authored by Drahomír Karchňák's avatar Drahomír Karchňák

Fix up

parent e3387ab4
......@@ -223,10 +223,8 @@ public class CheckSettingsTask extends AsyncTask<Void, Void, JSONArray>
// Servers
Log.i(getClass().getSimpleName(), "Servers");
final Set<String> serverSet;
final JSONArray servers = resultListItem.optJSONArray("servers");
final JSONArray servers = resultListItem.getJSONArray("servers");
if (servers == null || servers.length() == 0) {
Log.i(getClass().getSimpleName(), "No servers found in the response.");
......@@ -234,10 +232,12 @@ public class CheckSettingsTask extends AsyncTask<Void, Void, JSONArray>
}
else
{
Log.i(getClass().getSimpleName(), "Loading server list");
serverSet = new TreeSet<String>();
for (int i = 0; i < servers.length(); i++)
{
final JSONObject serverObj = (JSONObject) servers.get(i);
final JSONObject serverObj = servers.getJSONObject(i);
final String serverName = serverObj.getString("name");
final String serverUuid = serverObj.getString("uuid");
......@@ -245,7 +245,7 @@ public class CheckSettingsTask extends AsyncTask<Void, Void, JSONArray>
serverSet.add(server.encode());
Log.i(getClass().getSimpleName(), "Server: " + serverName + "(" + serverUuid + ")");
Log.i(getClass().getSimpleName(), server.toString());
}
}
ConfigHelper.setServers(activity, serverSet);
......
......@@ -74,5 +74,8 @@ public class Server
return true;
}
}
@Override
public String toString() {
return "Server: " + name + "(" + uuid + ")";
}
}
\ No newline at end of file
......@@ -270,10 +270,7 @@ public class SettingsResource extends ServerResource
jsonItem.put("versions", jsonControlServerVersion);
//servers
boolean userServerSelection = request.optBoolean("user_server_selection", false);
//TODO - TEMPORARY
userServerSelection = true;
final boolean userServerSelection = request.optBoolean("user_server_selection", false);
if(userServerSelection) {
final String serverType;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment