Small improvement

pull/156/head
M66B 6 years ago
parent 35ed2e5187
commit c671c1b9d9

@ -586,8 +586,11 @@ public class ServiceSynchronize extends LifecycleService {
public void folderCreated(FolderEvent e) {
try {
wlFolder.acquire();
Log.i("Folder created=" + e.getFolder().getFullName());
reload(ServiceSynchronize.this, "folder created");
String name = e.getFolder().getFullName();
Log.i("Folder created=" + name);
if (db.folder().getFolderByName(account.id, name) == null)
reload(ServiceSynchronize.this, "folder created");
} finally {
wlFolder.release();
}
@ -597,14 +600,15 @@ public class ServiceSynchronize extends LifecycleService {
public void folderRenamed(FolderEvent e) {
try {
wlFolder.acquire();
Log.i("Folder renamed=" + e.getFolder().getFullName());
String old = e.getFolder().getFullName();
String name = e.getNewFolder().getFullName();
Log.i("Folder renamed from=" + old + " to=" + name);
int count = db.folder().renameFolder(account.id, old, name);
Log.i("Renamed to " + name + " count=" + count);
reload(ServiceSynchronize.this, "folder renamed");
if (count == 0)
reload(ServiceSynchronize.this, "folder renamed");
} finally {
wlFolder.release();
}
@ -614,8 +618,11 @@ public class ServiceSynchronize extends LifecycleService {
public void folderDeleted(FolderEvent e) {
try {
wlFolder.acquire();
Log.i("Folder deleted=" + e.getFolder().getFullName());
reload(ServiceSynchronize.this, "folder deleted");
String name = e.getFolder().getFullName();
Log.i("Folder deleted=" + name);
if (db.folder().getFolderByName(account.id, name) != null)
reload(ServiceSynchronize.this, "folder deleted");
} finally {
wlFolder.release();
}

Loading…
Cancel
Save