mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-26 22:31:16 +00:00
Fixed deleting folders not working.
This commit is contained in:
parent
d993f1917f
commit
9940f5c437
2 changed files with 4 additions and 4 deletions
|
@ -812,13 +812,13 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
||||||
*/
|
*/
|
||||||
public boolean deleteFolder(Folder folder, Activity activity) {
|
public boolean deleteFolder(Folder folder, Activity activity) {
|
||||||
try {
|
try {
|
||||||
JSONArray folders = mConfig.getJSONArray("Folder");
|
JSONArray folders = mConfig.getJSONArray("Folders");
|
||||||
|
|
||||||
for (int i = 0; i < folders.length(); i++) {
|
for (int i = 0; i < folders.length(); i++) {
|
||||||
JSONObject json = folders.getJSONObject(i);
|
JSONObject json = folders.getJSONObject(i);
|
||||||
if (folder.ID.equals(json.getString("ID"))) {
|
if (folder.ID.equals(json.getString("ID"))) {
|
||||||
mConfig.remove("Folder");
|
mConfig.remove("Folders");
|
||||||
mConfig.put("Folder", delete(folders, folders.getJSONObject(i)));
|
mConfig.put("Folders", delete(folders, folders.getJSONObject(i)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -868,7 +868,6 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
||||||
String error = null;
|
String error = null;
|
||||||
try {
|
try {
|
||||||
JSONObject json = new JSONObject(s);
|
JSONObject json = new JSONObject(s);
|
||||||
Log.d(TAG, s);
|
|
||||||
normalized = json.optString("id", null);
|
normalized = json.optString("id", null);
|
||||||
error = json.optString("error", null);
|
error = json.optString("error", null);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
|
|
|
@ -353,6 +353,7 @@ public class SyncthingService extends Service {
|
||||||
}
|
}
|
||||||
Log.i(TAG, "Web GUI has come online at " + mConfig.getWebGuiUrl());
|
Log.i(TAG, "Web GUI has come online at " + mConfig.getWebGuiUrl());
|
||||||
mCurrentState = State.ACTIVE;
|
mCurrentState = State.ACTIVE;
|
||||||
|
onApiChange();
|
||||||
for (OnWebGuiAvailableListener listener : mOnWebGuiAvailableListeners) {
|
for (OnWebGuiAvailableListener listener : mOnWebGuiAvailableListeners) {
|
||||||
listener.onWebGuiAvailable();
|
listener.onWebGuiAvailable();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue