Skip to content

Commit

Permalink
Revert "WIP"
Browse files Browse the repository at this point in the history
This reverts commit 98b34c4.
  • Loading branch information
Catfriend1 committed Jan 25, 2019
1 parent 98b34c4 commit d955d9c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
import com.nutomic.syncthingandroid.model.Device;
import com.nutomic.syncthingandroid.model.Folder;
import com.nutomic.syncthingandroid.model.FolderIgnoreList;
import com.nutomic.syncthingandroid.model.MinDiskFree;
import com.nutomic.syncthingandroid.model.Versioning;
import com.nutomic.syncthingandroid.service.Constants;
import com.nutomic.syncthingandroid.service.RestApi;
import com.nutomic.syncthingandroid.service.SyncthingService;
Expand Down Expand Up @@ -253,11 +251,6 @@ public void onCreate(Bundle savedInstanceState) {
}
mConfig.getFolderIgnoreList(restApi, mFolder, this::onReceiveFolderIgnoreList);
mFolderNeedsToUpdate = false;

if (mFolder.minDiskFree != null) {
Log.d(TAG, "minDiskFree: unit= " + mFolder.minDiskFree.unit);
Log.d(TAG, "minDiskFree: value= " + mFolder.minDiskFree.value);
}
}

// If the extra is set, we should automatically share the current folder with the given device.
Expand Down Expand Up @@ -662,7 +655,7 @@ private void initFolder() {
mFolder.rescanIntervalS = 3600;
mFolder.paused = false;
mFolder.type = Constants.FOLDER_TYPE_SEND_RECEIVE; // Default for {@link #checkWriteAndUpdateUI}.
mFolder.versioning = new Versioning();
mFolder.versioning = new Folder.Versioning();
}

private void addEmptyDeviceListView() {
Expand Down Expand Up @@ -778,14 +771,14 @@ private void updateVersioning(Bundle arguments) {
return;
}
if (mFolder.versioning == null) {
mFolder.versioning = new Versioning();
mFolder.versioning = new Folder.Versioning();
}

String type = arguments.getString("type");
arguments.remove("type");

if (type.equals("none")) {
mFolder.versioning = new Versioning();
mFolder.versioning = new Folder.Versioning();
} else {
for (String key : arguments.keySet()) {
mFolder.versioning.params.put(key, arguments.getString(key));
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/com/nutomic/syncthingandroid/model/Folder.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@

import com.nutomic.syncthingandroid.service.Constants;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class Folder {

Expand Down Expand Up @@ -42,6 +45,16 @@ public class Folder {
// Folder Status
public String invalid;

public static class Versioning implements Serializable {
public String type;
public Map<String, String> params = new HashMap<>();
}

public static class MinDiskFree {
public float value;
public String unit;
}

public void addDevice(final Device device) {
Device d = new Device();
d.deviceID = device.deviceID;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.nutomic.syncthingandroid.model.Folder;
import com.nutomic.syncthingandroid.model.FolderIgnoreList;
import com.nutomic.syncthingandroid.model.Gui;
import com.nutomic.syncthingandroid.model.Versioning;
import com.nutomic.syncthingandroid.R;
import com.nutomic.syncthingandroid.service.Constants;
import com.nutomic.syncthingandroid.service.SyncthingRunnable;
Expand Down Expand Up @@ -438,7 +437,7 @@ public List<Folder> getFolders() {
<param key="cleanoutDays" val="90"></param>
</versioning>
*/
folder.versioning = new Versioning();
folder.versioning = new Folder.Versioning();
Element elementVersioning = (Element) r.getElementsByTagName("versioning").item(0);
folder.versioning.type = getAttributeOrDefault(elementVersioning, "type", "");
NodeList nodeVersioningParam = elementVersioning.getElementsByTagName("param");
Expand Down

0 comments on commit d955d9c

Please sign in to comment.