do not allow copying items in themselves

This commit is contained in:
tibbi 2016-11-05 20:27:19 +01:00
parent 5b79b025ce
commit 1de7985652
7 changed files with 11 additions and 0 deletions

View File

@ -49,6 +49,11 @@ class CopyDialog(val activity: Activity, val files: List<File>, val path: String
return@setOnClickListener
}
if (view.source.text.trimEnd('/') == destinationPath.trimEnd('/')) {
context.toast(R.string.source_and_destination_same)
return@setOnClickListener
}
val destinationDir = File(destinationPath)
if (!destinationDir.exists()) {
context.toast(R.string.invalid_destination)

View File

@ -29,6 +29,7 @@
<string name="select_destination">Ziel auswählen</string>
<string name="invalid_destination">Konnte nicht an ausgewähltes Ziel schreiben</string>
<string name="please_select_destination">Bitte wähle ein Ziel</string>
<string name="source_and_destination_same">Source and destination cannot be the same</string>
<string name="copy_failed">Konnte die Datei nicht kopieren</string>
<string name="copying">Kopiere</string>
<string name="initial_breadcrumb">home</string>

View File

@ -29,6 +29,7 @@
<string name="select_destination">Seleziona destinazione</string>
<string name="invalid_destination">Impossibile scrivere nella destinazione selezionata</string>
<string name="please_select_destination">Seleziona una destinazione</string>
<string name="source_and_destination_same">Source and destination cannot be the same</string>
<string name="copy_failed">Impossibile copiare i file</string>
<string name="copying">Copia in corso</string>
<string name="initial_breadcrumb">home</string>

View File

@ -29,6 +29,7 @@
<string name="select_destination">宛先を選択</string>
<string name="invalid_destination">選択した宛先に書き込みできませんでした</string>
<string name="please_select_destination">宛先を選択してください</string>
<string name="source_and_destination_same">Source and destination cannot be the same</string>
<string name="copy_failed">ファイルをコピーできませんでした</string>
<string name="copying">コピー中</string>
<string name="initial_breadcrumb">ホーム</string>

View File

@ -29,6 +29,7 @@
<string name="select_destination">Selecionar destino</string>
<string name="invalid_destination">Não foi possível escrever no destino selecionado</string>
<string name="please_select_destination">Por favor selecione um destino</string>
<string name="source_and_destination_same">Source and destination cannot be the same</string>
<string name="copy_failed">Não foi possível copiar os ficheiros</string>
<string name="copying">A copiar</string>
<string name="initial_breadcrumb">início</string>

View File

@ -29,6 +29,7 @@
<string name="select_destination">Välj mål</string>
<string name="invalid_destination">Det gick inte att skriva till målet</string>
<string name="please_select_destination">Please select a destination</string>
<string name="source_and_destination_same">Source and destination cannot be the same</string>
<string name="copy_failed">Kunde inte kopiera filen</string>
<string name="copying">Kopierar</string>
<string name="initial_breadcrumb">home</string>

View File

@ -29,6 +29,7 @@
<string name="select_destination">Select destination</string>
<string name="invalid_destination">Could not write to the selected destination</string>
<string name="please_select_destination">Please select a destination</string>
<string name="source_and_destination_same">Source and destination cannot be the same</string>
<string name="copy_failed">Could not copy the files</string>
<string name="copying">Copying</string>
<string name="initial_breadcrumb">home</string>