From: jabarros Date: Mon, 6 Oct 2014 12:58:34 +0000 (+0200) Subject: Merge branch 'master' of https://github.com/loripino21/android into instant_upload_pa... X-Git-Tag: oc-android-1.7.0_signed~141^2~7 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/1e7e893321e3939bf773349d41efc18caad7ab99?hp=45031a321f21143e2e91efd7f12442721b45eca0 Merge branch 'master' of https://github.com/loripino21/android into instant_upload_path_chooseable --- diff --git a/res/values/strings.xml b/res/values/strings.xml index 4c7cf34d..02021305 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -251,6 +251,7 @@ This image cannot be shown %1$s could not be copied to %2$s local folder + Upload Path Sorry, sharing is not enabled on your server. Please contact your administrator. diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 945e853c..9543cfc5 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -36,6 +36,11 @@ android:disableDependentsState="true" android:title="@string/instant_upload_on_wifi" android:key="instant_upload_on_wifi"/> + @@ -65,4 +70,4 @@ - \ No newline at end of file + diff --git a/src/com/owncloud/android/utils/FileStorageUtils.java b/src/com/owncloud/android/utils/FileStorageUtils.java index 58dda0da..3895821d 100644 --- a/src/com/owncloud/android/utils/FileStorageUtils.java +++ b/src/com/owncloud/android/utils/FileStorageUtils.java @@ -26,6 +26,8 @@ import com.owncloud.android.lib.resources.files.RemoteFile; import android.annotation.SuppressLint; import android.content.Context; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; import android.net.Uri; import android.os.Environment; import android.os.StatFs; @@ -73,7 +75,9 @@ public class FileStorageUtils { } public static String getInstantUploadFilePath(Context context, String fileName) { - String uploadPath = context.getString(R.string.instant_upload_path); + SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context); + String uploadPathdef = context.getString(R.string.instant_upload_path); + String uploadPath = pref.getString("instant_upload_path", uploadPathdef); String value = uploadPath + OCFile.PATH_SEPARATOR + (fileName == null ? "" : fileName); return value; } @@ -120,4 +124,4 @@ public class FileStorageUtils { return file; } -} \ No newline at end of file +}