Eliminated redundant commit of Preferences

This commit is contained in:
Daniel Applebaum 2009-01-09 06:13:28 +00:00
parent 1f9bf1ec50
commit f0867387c8
1 changed files with 5 additions and 3 deletions

View File

@ -258,6 +258,8 @@ public class Account implements Serializable {
}
public void save(Preferences preferences) {
SharedPreferences.Editor editor = preferences.mSharedPreferences.edit();
if (!preferences.mSharedPreferences.getString("accountUuids", "").contains(mUuid)) {
/*
* When the account is first created we assign it a unique account number. The
@ -286,12 +288,12 @@ public class Account implements Serializable {
String accountUuids = preferences.mSharedPreferences.getString("accountUuids", "");
accountUuids += (accountUuids.length() != 0 ? "," : "") + mUuid;
SharedPreferences.Editor editor = preferences.mSharedPreferences.edit();
// SharedPreferences.Editor editor = preferences.mSharedPreferences.edit();
editor.putString("accountUuids", accountUuids);
editor.commit();
// editor.commit();
}
SharedPreferences.Editor editor = preferences.mSharedPreferences.edit();
// SharedPreferences.Editor editor = preferences.mSharedPreferences.edit();
editor.putString(mUuid + ".storeUri", Utility.base64Encode(mStoreUri));
editor.putString(mUuid + ".localStoreUri", mLocalStoreUri);