From: jabarros Date: Wed, 7 Jan 2015 12:04:46 +0000 (+0100) Subject: Added folder name to 'file not found' error message X-Git-Tag: oc-android-1.7.0_signed~23^2~18 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/90e49a96e453fc4a97b546e9630ce3d67ae4c978?ds=inline;hp=-c Added folder name to 'file not found' error message --- 90e49a96e453fc4a97b546e9630ce3d67ae4c978 diff --git a/res/values/strings.xml b/res/values/strings.xml index c26a31cb..249f2567 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -323,7 +323,7 @@ Security Upload Video Path - The folder is no longer available on the server - Download of %1$s folder could not be completed + The %1$s folder is no longer available on the server + Download of %1$s folder could not be completed diff --git a/src/com/owncloud/android/utils/ErrorMessageAdapter.java b/src/com/owncloud/android/utils/ErrorMessageAdapter.java index 9e077c0a..992f0f6b 100644 --- a/src/com/owncloud/android/utils/ErrorMessageAdapter.java +++ b/src/com/owncloud/android/utils/ErrorMessageAdapter.java @@ -210,13 +210,16 @@ public class ErrorMessageAdapter { } else if (operation instanceof SynchronizeFolderOperation) { if (!result.isSuccess()) { + String folderPathName = new File( + ((SynchronizeFolderOperation) operation).getFolderPath()).getName(); if (result.getCode() == ResultCode.FILE_NOT_FOUND) { - message = res.getString(R.string.download_folder_not_found); + message = String.format(res.getString(R.string.download_folder_not_found), + folderPathName); } else { // Generic error // Show a Message, operation finished without success - message = String.format(res.getString(R.string.downloader_download_folder_failed_content), new File( - ((SynchronizeFolderOperation) operation).getFolderPath()).getName()); + message = String.format(res.getString(R.string.download_folder_failed_content), + folderPathName); } } }