Small improvement

This commit is contained in:
M66B 2019-05-25 16:32:08 +02:00
parent 35ed2e5187
commit c671c1b9d9
1 changed files with 14 additions and 7 deletions

View File

@ -586,7 +586,10 @@ public class ServiceSynchronize extends LifecycleService {
public void folderCreated(FolderEvent e) {
try {
wlFolder.acquire();
Log.i("Folder created=" + e.getFolder().getFullName());
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,13 +600,14 @@ 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);
if (count == 0)
reload(ServiceSynchronize.this, "folder renamed");
} finally {
wlFolder.release();
@ -614,7 +618,10 @@ public class ServiceSynchronize extends LifecycleService {
public void folderDeleted(FolderEvent e) {
try {
wlFolder.acquire();
Log.i("Folder deleted=" + e.getFolder().getFullName());
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();