Skip to content

Commit

Permalink
Solve git conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed May 3, 2024
2 parents aae1443 + 956b675 commit f23b0bd
Show file tree
Hide file tree
Showing 8 changed files with 453 additions and 249 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import com.nextcloud.client.network.ConnectivityService
import com.nextcloud.client.preferences.AppPreferences
import com.nextcloud.model.WorkerState
import com.nextcloud.model.WorkerStateLiveData
import com.nextcloud.utils.extensions.showToast
import com.owncloud.android.R
import com.owncloud.android.datamodel.FileDataStorageManager
import com.owncloud.android.datamodel.ThumbnailsCacheManager
import com.owncloud.android.datamodel.UploadsStorageManager
Expand Down Expand Up @@ -263,6 +265,7 @@ class FileUploadWorker(
uploadFileOperation.user, File(uploadFileOperation.storagePath), uploadFileOperation.remotePath, context
)
) {
context.showToast(R.string.file_upload_worker_same_file_already_exists)
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import android.os.Handler
import android.os.Looper
import android.widget.Toast
import com.owncloud.android.datamodel.ReceiverFlag

@SuppressLint("UnspecifiedRegisterReceiverFlag")
Expand All @@ -23,3 +26,11 @@ fun Context.registerBroadcastReceiver(receiver: BroadcastReceiver?, filter: Inte
registerReceiver(receiver, filter)
}
}

fun Context.showToast(message: String) {
Handler(Looper.getMainLooper()).post {
Toast.makeText(this, message, Toast.LENGTH_LONG).show()
}
}

fun Context.showToast(messageId: Int) = showToast(getString(messageId))

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Your Name <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

package com.owncloud.android.operations.e2e

import com.owncloud.android.lib.common.OwnCloudClient

data class E2EClientData(val client: OwnCloudClient, val token: String, val publicKey: String)
17 changes: 17 additions & 0 deletions app/src/main/java/com/owncloud/android/operations/e2e/E2EData.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Your Name <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

package com.owncloud.android.operations.e2e

import com.owncloud.android.datamodel.e2e.v1.encrypted.EncryptedFile

data class E2EData(
val key: ByteArray,
val iv: ByteArray,
val encryptedFile: EncryptedFile,
val encryptedFileName: String
)
46 changes: 46 additions & 0 deletions app/src/main/java/com/owncloud/android/operations/e2e/E2EFiles.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Your Name <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

package com.owncloud.android.operations.e2e

import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.common.utils.Log_OC
import java.io.File

data class E2EFiles(
var parentFile: OCFile,
var temporalFile: File?,
var originalFile: File,
var expectedFile: File?,
var encryptedTempFile: File?
) {
private val tag = "E2EFiles"

fun deleteTemporalFile() {
if (temporalFile?.exists() == true && temporalFile?.delete() == false) {
Log_OC.e(tag, "Could not delete temporal file " + temporalFile?.absolutePath)
}
}

fun deleteTemporalFileWithOriginalFileComparison() {
if (originalFile == temporalFile) {
return
}

val isTemporalFileDeleted = temporalFile?.delete()
Log_OC.d(tag, "isTemporalFileDeleted: $isTemporalFileDeleted")
}

fun deleteEncryptedTempFile() {
if (encryptedTempFile != null) {
val isTempEncryptedFileDeleted = encryptedTempFile?.delete()
Log_OC.e(tag, "isTempEncryptedFileDeleted: $isTempEncryptedFileDeleted")
} else {
Log_OC.e(tag, "Encrypted temp file cannot be found")
}
}
}
2 changes: 2 additions & 0 deletions app/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
<string name="auth_unknown_host_title">Sunucu adı bulunamadı</string>
<string name="auth_unsupported_multiaccount">%1$s birden çok hesabı desteklemiyor</string>
<string name="auth_wrong_connection_title">Bağlantı kurulamadı</string>
<string name="authenticator_activity_cancel_login">Oturum açmaktan vazgeç</string>
<string name="authenticator_activity_please_complete_login_process">Lütfen oturum açma işlemini tarayıcınızdan tamamlayın</string>
<string name="auto_upload_file_behaviour_kept_in_folder">salt okunur olduğundan özgün klasörde kaldı</string>
<string name="auto_upload_on_wifi">Yalnızca kullanıma göre ücretlendirilmeyen kablosuz ağ üzerinden yüklensin</string>
<string name="auto_upload_path">/OtomatikYükleme</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
<string name="uploader_upload_files_behaviour_only_upload">Keep file in source folder</string>
<string name="uploader_upload_files_behaviour_upload_and_delete_from_source">Delete file from source folder</string>
<string name="file_list_seconds_ago">seconds ago</string>
<string name="file_upload_worker_same_file_already_exists">Same file already exists, no conflict detected</string>
<string name="file_list_live">LIVE</string>
<string name="file_list_empty_headline">No files here</string>
<string name="folder_list_empty_headline">No folders here</string>
Expand Down

0 comments on commit f23b0bd

Please sign in to comment.