Skip to content

Commit 9808f96

Browse files
Merge pull request #16637 from nextcloud/file-list-refresh-after-conflict
fix(file-list): refresh directory
2 parents b51bb9b + 3f08832 commit 9808f96

4 files changed

Lines changed: 2 additions & 23 deletions

File tree

app/src/main/java/com/nextcloud/client/jobs/autoUpload/AutoUploadWorker.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import com.nextcloud.client.account.UserAccountManager
1818
import com.nextcloud.client.database.entity.toOCUpload
1919
import com.nextcloud.client.database.entity.toUploadEntity
2020
import com.nextcloud.client.device.PowerManagementService
21-
import com.nextcloud.client.jobs.BackgroundJobManager
2221
import com.nextcloud.client.jobs.upload.FileUploadBroadcastManager
2322
import com.nextcloud.client.jobs.upload.FileUploadWorker
2423
import com.nextcloud.client.jobs.utils.UploadErrorNotificationManager
@@ -430,7 +429,6 @@ class AutoUploadWorker(
430429
fileUploadBroadcastManager.sendFinished(
431430
operation,
432431
result,
433-
operation.oldFile?.storagePath,
434432
context
435433
)
436434
}

app/src/main/java/com/nextcloud/client/jobs/upload/FileUploadBroadcastManager.kt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,7 @@ class FileUploadBroadcastManager(private val broadcastManager: LocalBroadcastMan
8484
* - [com.owncloud.android.ui.preview.PreviewImageActivity.UploadFinishReceiver]
8585
*
8686
*/
87-
fun sendFinished(
88-
upload: UploadFileOperation,
89-
uploadResult: RemoteOperationResult<*>,
90-
unlinkedFromRemotePath: String?,
91-
context: Context
92-
) {
87+
fun sendFinished(upload: UploadFileOperation, uploadResult: RemoteOperationResult<*>, context: Context) {
9388
Log_OC.d(TAG, "upload finished broadcast sent")
9489
val intent = Intent(UPLOAD_FINISHED).apply {
9590
// real remote path, after possible automatic renaming
@@ -102,9 +97,6 @@ class FileUploadBroadcastManager(private val broadcastManager: LocalBroadcastMan
10297
putExtra(FileUploadWorker.EXTRA_OLD_FILE_PATH, upload.originalStoragePath)
10398
putExtra(FileUploadWorker.ACCOUNT_NAME, upload.user.accountName)
10499
putExtra(FileUploadWorker.EXTRA_UPLOAD_RESULT, uploadResult.isSuccess)
105-
if (unlinkedFromRemotePath != null) {
106-
putExtra(FileUploadWorker.EXTRA_LINKED_TO_PATH, unlinkedFromRemotePath)
107-
}
108100
setPackage(context.packageName)
109101
}
110102
broadcastManager.sendBroadcast(intent)

app/src/main/java/com/nextcloud/client/jobs/upload/FileUploadWorker.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ class FileUploadWorker(
8181
const val EXTRA_REMOTE_PATH = "REMOTE_PATH"
8282
const val EXTRA_OLD_REMOTE_PATH = "OLD_REMOTE_PATH"
8383
const val EXTRA_OLD_FILE_PATH = "OLD_FILE_PATH"
84-
const val EXTRA_LINKED_TO_PATH = "LINKED_TO"
8584
const val ACCOUNT_NAME = "ACCOUNT_NAME"
8685
const val EXTRA_ACCOUNT_NAME = "ACCOUNT_NAME"
8786
const val ACTION_CANCEL_BROADCAST = "CANCEL"
@@ -288,7 +287,6 @@ class FileUploadWorker(
288287
fileUploadBroadcastManager.sendFinished(
289288
operation,
290289
result,
291-
operation.oldFile?.storagePath,
292290
context
293291
)
294292
}

app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,10 +1698,7 @@ class FileDisplayActivity :
16981698
currentDir != null && uploadedRemotePath != null && uploadedRemotePath.startsWith(currentDir.remotePath)
16991699

17001700
if (sameAccount && isDescendant) {
1701-
val linkedToRemotePath = intent.getStringExtra(FileUploadWorker.EXTRA_LINKED_TO_PATH)
1702-
if (linkedToRemotePath == null || isAscendant(linkedToRemotePath)) {
1703-
updateListOfFilesFragment()
1704-
}
1701+
updateListOfFilesFragment()
17051702
}
17061703

17071704
val uploadWasFine = intent.getBooleanExtra(FileUploadWorker.EXTRA_UPLOAD_RESULT, false)
@@ -1749,12 +1746,6 @@ class FileDisplayActivity :
17491746
}
17501747
}
17511748
}
1752-
1753-
// TODO refactor this receiver, and maybe DownloadFinishReceiver; this method is duplicated :S
1754-
fun isAscendant(linkedToRemotePath: String): Boolean {
1755-
val currentDir = getCurrentDir()
1756-
return currentDir != null && currentDir.remotePath.startsWith(linkedToRemotePath)
1757-
}
17581749
}
17591750

17601751
/**

0 commit comments

Comments
 (0)