mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-30 00:01:19 +00:00
Fixed wrong devices being checked for a node (fixes #89).
Also, don't show the local device in device selection.
This commit is contained in:
parent
65199cbe23
commit
e131849171
2 changed files with 2 additions and 2 deletions
|
@ -151,6 +151,8 @@ public class FolderSettingsFragment extends PreferenceFragment
|
||||||
List<RestApi.Device> devicesList = mSyncthingService.getApi().getDevices();
|
List<RestApi.Device> devicesList = mSyncthingService.getApi().getDevices();
|
||||||
for (RestApi.Device n : devicesList) {
|
for (RestApi.Device n : devicesList) {
|
||||||
ExtendedCheckBoxPreference cbp = new ExtendedCheckBoxPreference(getActivity(), n);
|
ExtendedCheckBoxPreference cbp = new ExtendedCheckBoxPreference(getActivity(), n);
|
||||||
|
// Calling addPreference later causes it to change the checked state.
|
||||||
|
mDevices.addPreference(cbp);
|
||||||
cbp.setTitle(n.Name);
|
cbp.setTitle(n.Name);
|
||||||
cbp.setKey(KEY_NODE_SHARED);
|
cbp.setKey(KEY_NODE_SHARED);
|
||||||
cbp.setOnPreferenceChangeListener(FolderSettingsFragment.this);
|
cbp.setOnPreferenceChangeListener(FolderSettingsFragment.this);
|
||||||
|
@ -160,7 +162,6 @@ public class FolderSettingsFragment extends PreferenceFragment
|
||||||
cbp.setChecked(true);
|
cbp.setChecked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mDevices.addPreference(cbp);
|
|
||||||
}
|
}
|
||||||
mVersioning.setChecked(mFolder.Versioning instanceof RestApi.SimpleVersioning);
|
mVersioning.setChecked(mFolder.Versioning instanceof RestApi.SimpleVersioning);
|
||||||
if (mVersioning.isChecked()) {
|
if (mVersioning.isChecked()) {
|
||||||
|
|
|
@ -482,7 +482,6 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
||||||
JSONObject n = devices.getJSONObject(j);
|
JSONObject n = devices.getJSONObject(j);
|
||||||
r.DeviceIds.add(n.getString("DeviceID"));
|
r.DeviceIds.add(n.getString("DeviceID"));
|
||||||
}
|
}
|
||||||
r.DeviceIds.add(mLocalDeviceId);
|
|
||||||
|
|
||||||
r.ReadOnly = json.getBoolean("ReadOnly");
|
r.ReadOnly = json.getBoolean("ReadOnly");
|
||||||
r.RescanIntervalS = json.getInt("RescanIntervalS");
|
r.RescanIntervalS = json.getInt("RescanIntervalS");
|
||||||
|
|
Loading…
Reference in a new issue