1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-09 11:41:29 +00:00

Enable largeBlocks for new folders by default (fixes #300) (#301)

* Enable largeBlocks for new folders by default (fixes #300)

* Remove duplicate code to set folder defaults on creation
This commit is contained in:
Catfriend1 2019-03-05 23:46:11 +01:00 committed by GitHub
parent 5151c3485b
commit 9187280687
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 9 deletions

View file

@ -663,13 +663,6 @@ public class FolderActivity extends SyncthingActivity {
? getIntent().getStringExtra(EXTRA_FOLDER_ID)
: generateRandomFolderId();
mFolder.label = getIntent().getStringExtra(EXTRA_FOLDER_LABEL);
mFolder.fsWatcherEnabled = true;
mFolder.fsWatcherDelayS = 10;
/**
* Folder rescan interval defaults to 3600s as it is the default in
* syncthing when the file watcher is enabled and a new folder is created.
*/
mFolder.rescanIntervalS = 3600;
mFolder.paused = false;
mFolder.type = Constants.FOLDER_TYPE_SEND_RECEIVE; // Default for {@link #checkWriteAndUpdateUI}.
mFolder.minDiskFree = new Folder.MinDiskFree();

View file

@ -27,6 +27,10 @@ public class Folder {
public boolean fsWatcherEnabled = true;
public int fsWatcherDelayS = 10;
private List<Device> devices = new ArrayList<>();
/**
* Folder rescan interval defaults to 3600s as it is the default in
* syncthing when the file watcher is enabled and a new folder is created.
*/
public int rescanIntervalS = 3600;
public boolean ignorePerms = true;
public boolean autoNormalize = true;
@ -43,7 +47,7 @@ public class Folder {
public boolean disableSparseFiles = false;
public boolean disableTempIndexes = false;
public boolean paused = false;
public boolean useLargeBlocks = false;
public boolean useLargeBlocks = true;
public int weakHashThresholdPct = 25;
public String markerName = ".stfolder";

View file

@ -435,7 +435,7 @@ public class ConfigXml {
folder.hashers = getContentOrDefault(r.getElementsByTagName("hashers").item(0), 0);
folder.order = getContentOrDefault(r.getElementsByTagName("order").item(0), "random");
folder.paused = getContentOrDefault(r.getElementsByTagName("paused").item(0), false);
folder.useLargeBlocks = getContentOrDefault(r.getElementsByTagName("useLargeBlocks").item(0), false);
folder.useLargeBlocks = getContentOrDefault(r.getElementsByTagName("useLargeBlocks").item(0), true);
folder.copyOwnershipFromParent = getContentOrDefault(r.getElementsByTagName("copyOwnershipFromParent").item(0), false);
// Devices