From 015b8984ce72dc3c4c541d8caab6ef78d4fb6a17 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Wed, 19 Oct 2016 12:42:20 -0700 Subject: [PATCH] Make file download names more accurate. Updated German translation provided by Aaron Gerlach . --- .../main/java/com/stoutner/privacybrowser/DownloadFile.java | 5 ++--- app/src/main/res/values-de/strings.xml | 3 +++ build.gradle | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) 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 -- 2.45.2