mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Merge pull request #92 from andrewgaul/remove-combine-uuids
Prefer Utility.combine over Account.combinedUuids
This commit is contained in:
commit
981dc6cca6
@ -379,18 +379,6 @@ public class Account implements BaseAccount {
|
||||
mCryptoAutoSignature = prefs.getBoolean(mUuid + ".cryptoAutoSignature", false);
|
||||
}
|
||||
|
||||
private String combineUuids(String[] uuids) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0, length = uuids.length; i < length; i++) {
|
||||
if (sb.length() > 0) {
|
||||
sb.append(',');
|
||||
}
|
||||
sb.append(uuids[i]);
|
||||
}
|
||||
String accountUuids = sb.toString();
|
||||
return accountUuids;
|
||||
}
|
||||
|
||||
protected synchronized void delete(Preferences preferences) {
|
||||
String[] uuids = preferences.getPreferences().getString("accountUuids", "").split(",");
|
||||
String[] newUuids = new String[uuids.length - 1];
|
||||
@ -401,7 +389,7 @@ public class Account implements BaseAccount {
|
||||
}
|
||||
}
|
||||
|
||||
String accountUuids = combineUuids(newUuids);
|
||||
String accountUuids = Utility.combine(newUuids, ',');
|
||||
SharedPreferences.Editor editor = preferences.getPreferences().edit();
|
||||
editor.putString("accountUuids", accountUuids);
|
||||
|
||||
@ -519,7 +507,7 @@ public class Account implements BaseAccount {
|
||||
}
|
||||
}
|
||||
}
|
||||
String accountUuids = combineUuids(newUuids);
|
||||
String accountUuids = Utility.combine(newUuids, ',');
|
||||
editor.putString("accountUuids", accountUuids);
|
||||
editor.commit();
|
||||
preferences.refreshAccounts();
|
||||
|
Loading…
Reference in New Issue
Block a user