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