more efficient mass unsharing

pull/62/head
Zlatin Balevsky 2021-06-12 10:56:01 +01:00
parent d7423e7e08
commit 300404915d
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 41 additions and 43 deletions

View File

@ -540,16 +540,16 @@ class MainFrameModel {
runInsideUIAsync {
synchronized (allSharedFiles) {
allSharedFiles.removeAll(e.unsharedFiles)
shared.retainAll(allSharedFiles)
}
loadedFiles = allSharedFiles.size()
for (SharedFile sharedFile : e.unsharedFiles) {
boolean wasVisible = shared.remove(sharedFile)
DefaultMutableTreeNode dmtn = fileToNode.remove(sharedFile)
if (dmtn != null) {
if (dmtn == null)
continue
if (wasVisible) {
Object[] path = dmtn.getUserObjectPath()
DefaultMutableTreeNode otherNode = treeRoot
for (int i = 1; i < path.length; i++) {
@ -573,7 +573,6 @@ class MainFrameModel {
} else
break
}
}
List<File> unshared = new ArrayList<>()
while (true) {
@ -595,7 +594,6 @@ class MainFrameModel {
core.eventBus.publish(new DirectoryUnsharedEvent(directory: unsharedRoot))
}
}
}
view.refreshSharedFiles()
}