mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 18:59:18 +03:00
Rename function and remove pending uploads variable
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
d67a87fdb4
commit
72e90e56bf
1 changed files with 3 additions and 6 deletions
|
@ -56,8 +56,6 @@ class FileUploadHelper {
|
|||
companion object {
|
||||
private val TAG = FileUploadWorker::class.java.simpleName
|
||||
|
||||
// TODO is needed with worker?
|
||||
// val pendingUploads = IndexedForest<UploadFileOperation>()
|
||||
val mBoundListeners = HashMap<String, OnDatatransferProgressListener>()
|
||||
|
||||
fun buildRemoteName(accountName: String, remotePath: String): String {
|
||||
|
@ -100,13 +98,13 @@ class FileUploadHelper {
|
|||
// since the operation will not get to be run by FileUploader#uploadFile
|
||||
uploadsStorageManager.removeUpload(accountName, remotePath)
|
||||
|
||||
restartUploadJob(user)
|
||||
cancelAndRestartUploadJob(user)
|
||||
} catch (e: NoSuchElementException) {
|
||||
Log_OC.e(TAG, "Error cancelling current upload because user does not exist!")
|
||||
}
|
||||
}
|
||||
|
||||
private fun restartUploadJob(user: User) {
|
||||
private fun cancelAndRestartUploadJob(user: User) {
|
||||
backgroundJobManager.run {
|
||||
cancelFilesUploadJob(user)
|
||||
startFilesUploadJob(user)
|
||||
|
@ -180,9 +178,8 @@ class FileUploadHelper {
|
|||
}
|
||||
|
||||
fun cancel(accountName: String) {
|
||||
// pendingUploads.remove(accountName)
|
||||
uploadsStorageManager.removeUploads(accountName)
|
||||
restartUploadJob(accountManager.getUser(accountName).get())
|
||||
cancelAndRestartUploadJob(accountManager.getUser(accountName).get())
|
||||
}
|
||||
|
||||
fun addUploadTransferProgressListener(
|
||||
|
|
Loading…
Reference in a new issue