1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Minimize scope of local variables

This commit is contained in:
cketti 2015-03-06 23:08:34 +01:00
parent c4e202ecd9
commit abd2b20850
2 changed files with 4 additions and 7 deletions

View File

@ -277,8 +277,6 @@ public class AccountSetupBasics extends K9Activity
String[] emailParts = splitEmail(email); String[] emailParts = splitEmail(email);
String user = emailParts[0]; String user = emailParts[0];
String domain = emailParts[1]; String domain = emailParts[1];
URI incomingUri;
URI outgoingUri;
try { try {
String userEnc = UrlEncodingHelper.encodeUtf8(user); String userEnc = UrlEncodingHelper.encodeUtf8(user);
String passwordEnc = UrlEncodingHelper.encodeUtf8(password); String passwordEnc = UrlEncodingHelper.encodeUtf8(password);
@ -289,15 +287,15 @@ public class AccountSetupBasics extends K9Activity
incomingUsername = incomingUsername.replaceAll("\\$domain", domain); incomingUsername = incomingUsername.replaceAll("\\$domain", domain);
URI incomingUriTemplate = mProvider.incomingUriTemplate; URI incomingUriTemplate = mProvider.incomingUriTemplate;
incomingUri = new URI(incomingUriTemplate.getScheme(), incomingUsername + ":" URI incomingUri = new URI(incomingUriTemplate.getScheme(), incomingUsername + ":" + passwordEnc,
+ passwordEnc, incomingUriTemplate.getHost(), incomingUriTemplate.getPort(), null, incomingUriTemplate.getHost(), incomingUriTemplate.getPort(), null, null, null);
null, null);
String outgoingUsername = mProvider.outgoingUsernameTemplate; String outgoingUsername = mProvider.outgoingUsernameTemplate;
URI outgoingUriTemplate = mProvider.outgoingUriTemplate; URI outgoingUriTemplate = mProvider.outgoingUriTemplate;
URI outgoingUri;
if (outgoingUsername != null) { if (outgoingUsername != null) {
outgoingUsername = outgoingUsername.replaceAll("\\$email", email); outgoingUsername = outgoingUsername.replaceAll("\\$email", email);
outgoingUsername = outgoingUsername.replaceAll("\\$user", userEnc); outgoingUsername = outgoingUsername.replaceAll("\\$user", userEnc);

View File

@ -67,9 +67,8 @@ public class FolderSettings extends K9PreferenceActivity {
} }
boolean isPushCapable = false; boolean isPushCapable = false;
Store store;
try { try {
store = mAccount.getRemoteStore(); Store store = mAccount.getRemoteStore();
isPushCapable = store.isPushCapable(); isPushCapable = store.isPushCapable();
} catch (Exception e) { } catch (Exception e) {
Log.e(K9.LOG_TAG, "Could not get remote store", e); Log.e(K9.LOG_TAG, "Could not get remote store", e);