mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 12:19:54 +01:00
Merge branch 'merge-settings' into 'master'
Fix a couple of bugs in settings 1. SettingsFragment wasn't receiving events because it extended BaseFragment rather than BaseEventFragment 2. Removed broken logic for deciding whether to broadcast a SettingsUpdatedEvent 3. Added the namespace to SettingsUpdatedEvent so listeners can decide whether to react See merge request !97
This commit is contained in:
@@ -935,7 +935,11 @@ class DatabaseComponentImpl<T> implements DatabaseComponent {
|
||||
try {
|
||||
T txn = db.startTransaction();
|
||||
try {
|
||||
if (!s.equals(db.getSettings(txn, namespace))) {
|
||||
Settings old = db.getSettings(txn, namespace);
|
||||
Settings merged = new Settings();
|
||||
merged.putAll(old);
|
||||
merged.putAll(s);
|
||||
if (!merged.equals(old)) {
|
||||
db.mergeSettings(txn, s, namespace);
|
||||
changed = true;
|
||||
}
|
||||
@@ -947,7 +951,7 @@ class DatabaseComponentImpl<T> implements DatabaseComponent {
|
||||
} finally {
|
||||
lock.writeLock().unlock();
|
||||
}
|
||||
if (changed) eventBus.broadcast(new SettingsUpdatedEvent());
|
||||
if (changed) eventBus.broadcast(new SettingsUpdatedEvent(namespace));
|
||||
}
|
||||
|
||||
public void receiveAck(ContactId c, Ack a) throws DbException {
|
||||
|
||||
Reference in New Issue
Block a user