From: Soren Stoutner Date: Wed, 19 Oct 2016 19:42:20 +0000 (-0700) Subject: Make file download names more accurate. Updated German translation provided by Aaron... X-Git-Tag: v1.11~5 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=015b8984ce72dc3c4c541d8caab6ef78d4fb6a17;p=PrivacyBrowserAndroid.git Make file download names more accurate. Updated German translation provided by Aaron Gerlach . --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/DownloadFile.java b/app/src/main/java/com/stoutner/privacybrowser/DownloadFile.java index d8fabdea..0a1d1dca 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/DownloadFile.java +++ b/app/src/main/java/com/stoutner/privacybrowser/DownloadFile.java @@ -27,7 +27,6 @@ import android.content.DialogInterface; import android.net.Uri; import android.os.Bundle; // `android.support.v7.app.AlertDialog` uses more of the horizontal screen real estate versus `android.app.AlertDialog's` smaller width. -import android.support.v4.content.ContextCompat; import android.support.v7.app.AlertDialog; import android.view.KeyEvent; import android.view.LayoutInflater; @@ -49,8 +48,8 @@ public class DownloadFile extends DialogFragment { Bundle argumentsBundle = new Bundle(); String fileNameString; - if (!contentDisposition.isEmpty()) { // Extract `fileNameString` from `contentDisposition` using the substring beginning after `filename="` and ending one character before the end of `contentDisposition`. - fileNameString = contentDisposition.substring(contentDisposition.indexOf("filename=\"") + 10, contentDisposition.length() - 1); + if (!contentDisposition.isEmpty()) { // Extract `fileNameString` from `contentDisposition` using the substring beginning after `filename="` and ending with the next `"`. + fileNameString = contentDisposition.substring(contentDisposition.indexOf("filename=\"") + 10, contentDisposition.indexOf("\"", contentDisposition.indexOf("filename=\"") + 10)); } else { // `contentDisposition` is empty, so use the last path segment of the URL as the file name. Uri downloadUri = Uri.parse(urlString); fileNameString = downloadUri.getLastPathSegment(); diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 110a1d9d..587e93f6 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -49,6 +49,7 @@ Speichern unter Dateiname + Unbekannte Größe Download @@ -238,6 +239,8 @@ Herunterziehen zum Aktualisieren Einige Websites funktionieren nicht, wenn "Herunterziehen zum Aktualisieren" eingeschaltet ist. + Weitere Icons in der Titelleiste + Icons zum Umschalten von Cookies, DOM-Speicher und Formulardaten neben der Adresszeile anzeigen, wenn noch Platz dafür da ist. Orbot-Proxy wird nicht funktionieren, solange Orbot nicht installiert ist. diff --git a/build.gradle b/build.gradle index b1932998..573f4fd6 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:2.2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files