DownloadManager listens to events, not FileManager

pull/4/head
Zlatin Balevsky 2019-06-09 16:19:35 +01:00
parent f39d7f4fa8
commit a7125963a7
3 changed files with 6 additions and 5 deletions

View File

@ -154,7 +154,6 @@ public class Core {
eventBus.register(FileDownloadedEvent.class, fileManager)
eventBus.register(FileUnsharedEvent.class, fileManager)
eventBus.register(SearchEvent.class, fileManager)
eventBus.register(UILoadedEvent.class, fileManager)
log.info "initializing persistence service"
persisterService = new PersisterService(new File(home, "files.json"), eventBus, 5000, fileManager)
@ -194,6 +193,7 @@ public class Core {
log.info("initializing download manager")
DownloadManager downloadManager = new DownloadManager(eventBus, i2pConnector, new File(home, "incompletes"), me)
eventBus.register(UIDownloadEvent.class, downloadManager)
eventBus.register(UILoadedEvent.class, downloadManager)
log.info("initializing upload manager")
UploadManager uploadManager = new UploadManager(eventBus, fileManager)

View File

@ -7,6 +7,7 @@ import net.i2p.data.Destination
import com.muwire.core.EventBus
import com.muwire.core.Persona
import com.muwire.core.UILoadedEvent
import java.util.concurrent.Executor
import java.util.concurrent.Executors
@ -57,4 +58,8 @@ public class DownloadManager {
void resume(Downloader downloader) {
executor.execute({downloader.download() as Runnable})
}
void onUILoadedEvent(UILoadedEvent e) {
// TODO: load downloads here
}
}

View File

@ -135,8 +135,4 @@ class FileManager {
}
rv
}
void onUILoadedEvent(UILoadedEvent e) {
// TODO: resume downloads
}
}