mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-12-05 00:02:27 -08:00
Refactor rounds
This commit is contained in:
1 parent
d5acd04a19
commit
1e4deb2182
10 files changed
+38
-63
No files matched your search
+5
-5
@@ -50,12 +50,12 @@ public class RoundsPreferenceDialogFragmentCompat extends PreferenceDialogFragme
|
||||
rounds = 1;
|
||||
}
|
||||
|
||||
long oldRounds = mPM.getNumRounds();
|
||||
long oldRounds = mPM.getNumberKeyEncryptionRounds();
|
||||
try {
|
||||
mPM.setNumRounds(rounds);
|
||||
mPM.setNumberKeyEncryptionRounds(rounds);
|
||||
} catch (NumberFormatException e) {
|
||||
Toast.makeText(getContext(), R.string.error_rounds_too_large, Toast.LENGTH_LONG).show();
|
||||
mPM.setNumRounds(Integer.MAX_VALUE);
|
||||
mPM.setNumberKeyEncryptionRounds(Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
Handler handler = new Handler();
|
||||
@@ -75,7 +75,7 @@ public class RoundsPreferenceDialogFragmentCompat extends PreferenceDialogFragme
|
||||
// Get the time from the related Preference
|
||||
Database db = App.getDB();
|
||||
mPM = db.getPwDatabase();
|
||||
long numRounds = mPM.getNumRounds();
|
||||
long numRounds = mPM.getNumberKeyEncryptionRounds();
|
||||
|
||||
DialogPreference preference = getPreference();
|
||||
if (preference instanceof RoundsPreference) {
|
||||
@@ -100,7 +100,7 @@ public class RoundsPreferenceDialogFragmentCompat extends PreferenceDialogFragme
|
||||
public void run() {
|
||||
if (!mSuccess) {
|
||||
displayMessage(mCtx);
|
||||
mPM.setNumRounds(mOldRounds);
|
||||
mPM.setNumberKeyEncryptionRounds(mOldRounds);
|
||||
}
|
||||
|
||||
super.run();
|
||||
|
||||
Reference in new issue
Block a user