Create missing parent folders as unselectable

pull/162/head
M66B 5 years ago
parent 0be641794f
commit a0175a655c

@ -1308,6 +1308,20 @@ class Core {
Log.i("Updating folder parents=" + parentFolders.size());
for (String parentName : parentFolders.keySet()) {
EntityFolder parent = nameFolder.get(parentName);
if (parent == null && parentName != null) {
parent = new EntityFolder();
parent.account = account.id;
parent.name = parentName;
parent.type = EntityFolder.SYSTEM;
parent.synchronize = false;
parent.subscribed = false;
parent.poll = false;
parent.sync_days = 0;
parent.keep_days = 0;
parent.selectable = false;
parent.id = db.folder().insertFolder(parent);
nameFolder.put(parentName, parent);
}
for (EntityFolder child : parentFolders.get(parentName))
db.folder().setFolderParent(child.id, parent == null ? null : parent.id);
}

Loading…
Cancel
Save