mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-25 09:17:58 +00:00
parent
cd41d6812a
commit
cf6670a7d2
2 changed files with 21 additions and 3 deletions
|
@ -117,6 +117,9 @@ public interface DaoFolder {
|
||||||
@Query("UPDATE folder SET synchronize = :synchronize, unified = :unified, after = :after WHERE id = :id")
|
@Query("UPDATE folder SET synchronize = :synchronize, unified = :unified, after = :after WHERE id = :id")
|
||||||
int setFolderProperties(long id, boolean synchronize, boolean unified, int after);
|
int setFolderProperties(long id, boolean synchronize, boolean unified, int after);
|
||||||
|
|
||||||
|
@Query("UPDATE folder SET name = :name WHERE account = :account AND name = :old")
|
||||||
|
int renameFolder(long account, String old, String name);
|
||||||
|
|
||||||
@Query("DELETE FROM folder WHERE account= :account AND name = :name")
|
@Query("DELETE FROM folder WHERE account= :account AND name = :name")
|
||||||
void deleteFolder(Long account, String name);
|
void deleteFolder(Long account, String name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -440,17 +440,32 @@ public class ServiceSynchronize extends LifecycleService {
|
||||||
istore.addFolderListener(new FolderAdapter() {
|
istore.addFolderListener(new FolderAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void folderCreated(FolderEvent e) {
|
public void folderCreated(FolderEvent e) {
|
||||||
// TODO: folder created
|
Log.i(Helper.TAG, "Folder created=" + e.getFolder().getFullName());
|
||||||
|
synchronized (state) {
|
||||||
|
state.notifyAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void folderRenamed(FolderEvent e) {
|
public void folderRenamed(FolderEvent e) {
|
||||||
// TODO: folder renamed
|
Log.i(Helper.TAG, "Folder renamed=" + e.getFolder());
|
||||||
|
|
||||||
|
String old = e.getFolder().getFullName();
|
||||||
|
String name = e.getNewFolder().getFullName();
|
||||||
|
int count = db.folder().renameFolder(account.id, old, name);
|
||||||
|
Log.i(Helper.TAG, "Renamed to " + name + " count=" + count);
|
||||||
|
|
||||||
|
synchronized (state) {
|
||||||
|
state.notifyAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void folderDeleted(FolderEvent e) {
|
public void folderDeleted(FolderEvent e) {
|
||||||
// TODO: folder deleted
|
Log.i(Helper.TAG, "Folder deleted=" + e.getFolder().getFullName());
|
||||||
|
synchronized (state) {
|
||||||
|
state.notifyAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue