Browse Source

Import pull request #255: Merge branch 'master' of https://github.com/deckmar/transdroid into deckmar-master

pull/280/head
Eric Kok 9 years ago
parent
commit
b283192e9a
  1. 14
      app/src/main/java/org/transdroid/core/app/settings/ApplicationSettings.java

14
app/src/main/java/org/transdroid/core/app/settings/ApplicationSettings.java

@ -165,8 +165,8 @@ public class ApplicationSettings {
return new ServerSetting(order, return new ServerSetting(order,
prefs.getString("server_name_" + order, null), prefs.getString("server_name_" + order, null),
type, type,
prefs.getString("server_address_" + order, null), trim(prefs.getString("server_address_" + order, null)),
prefs.getString("server_localaddress_" + order, null), trim(prefs.getString("server_localaddress_" + order, null)),
Integer.parseInt(localPort), Integer.parseInt(localPort),
prefs.getString("server_localnetwork_" + order, null), prefs.getString("server_localnetwork_" + order, null),
Integer.parseInt(port), Integer.parseInt(port),
@ -719,4 +719,14 @@ public class ApplicationSettings {
edit.apply(); edit.apply();
} }
/**
* Trims away whitespace around a string, or returns null if str is null
* @param str The string to trim, or null
* @return The trimmed string, or null if str is null
*/
private String trim(String str) {
if (str == null) return null;
return str.trim();
}
} }

Loading…
Cancel
Save