projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use UnshareOperation instead an AsyncTask, for unshare with
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
utils
/
ErrorMessageAdapter.java
diff --git
a/src/com/owncloud/android/utils/ErrorMessageAdapter.java
b/src/com/owncloud/android/utils/ErrorMessageAdapter.java
index
c86346b
..
91ee87f
100644
(file)
--- a/
src/com/owncloud/android/utils/ErrorMessageAdapter.java
+++ b/
src/com/owncloud/android/utils/ErrorMessageAdapter.java
@@
-36,7
+36,7
@@
import com.owncloud.android.operations.RemoveFileOperation;
import com.owncloud.android.operations.RenameFileOperation;
import com.owncloud.android.operations.SynchronizeFileOperation;
import com.owncloud.android.operations.SynchronizeFolderOperation;
import com.owncloud.android.operations.RenameFileOperation;
import com.owncloud.android.operations.SynchronizeFileOperation;
import com.owncloud.android.operations.SynchronizeFolderOperation;
-import com.owncloud.android.operations.Unshare
Link
Operation;
+import com.owncloud.android.operations.UnshareOperation;
import com.owncloud.android.operations.UploadFileOperation;
import org.apache.commons.httpclient.ConnectTimeoutException;
import com.owncloud.android.operations.UploadFileOperation;
import org.apache.commons.httpclient.ConnectTimeoutException;
@@
-187,7
+187,7
@@
public class ErrorMessageAdapter {
message = res.getString(R.string.share_link_file_error);
}
message = res.getString(R.string.share_link_file_error);
}
- } else if (operation instanceof Unshare
Link
Operation) {
+ } else if (operation instanceof UnshareOperation) {
if (result.getCode() == ResultCode.SHARE_NOT_FOUND) { // Error --> SHARE_NOT_FOUND
message = res.getString(R.string.unshare_link_file_no_exist);
if (result.getCode() == ResultCode.SHARE_NOT_FOUND) { // Error --> SHARE_NOT_FOUND
message = res.getString(R.string.unshare_link_file_no_exist);
@@
-206,9
+206,10
@@
public class ErrorMessageAdapter {
}
} else if (operation instanceof MoveFileOperation) {
}
} else if (operation instanceof MoveFileOperation) {
- if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
+ if(isNetworkError(result.getCode())){
+ message = getErrorMessage(result, res);
+ } else if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
message = res.getString(R.string.move_file_not_found);
message = res.getString(R.string.move_file_not_found);
-
} else if (result.getCode() == ResultCode.INVALID_MOVE_INTO_DESCENDANT) {
message = res.getString(R.string.move_file_invalid_into_descendent);
} else if (result.getCode() == ResultCode.INVALID_MOVE_INTO_DESCENDANT) {
message = res.getString(R.string.move_file_invalid_into_descendent);
@@
-237,16
+238,16
@@
public class ErrorMessageAdapter {
} else { // Generic error
// Show a Message, operation finished without success
} else { // Generic error
// Show a Message, operation finished without success
- message = String.format(res.getString(R.string.
download
_folder_failed_content),
+ message = String.format(res.getString(R.string.
sync
_folder_failed_content),
folderPathName);
}
}
} else if (operation instanceof CopyFileOperation) {
folderPathName);
}
}
} else if (operation instanceof CopyFileOperation) {
-
- if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
+ if(isNetworkError(result.getCode())){
+ message = getErrorMessage(result, res);
+ } else if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
message = res.getString(R.string.copy_file_not_found);
message = res.getString(R.string.copy_file_not_found);
-
- } else if (result.getCode() == ResultCode.INVALID_MOVE_INTO_DESCENDANT) {
+ } else if (result.getCode() == ResultCode.INVALID_COPY_INTO_DESCENDANT) {
message = res.getString(R.string.copy_file_invalid_into_descendent);
} else if (result.getCode() == ResultCode.INVALID_OVERWRITE) {
message = res.getString(R.string.copy_file_invalid_into_descendent);
} else if (result.getCode() == ResultCode.INVALID_OVERWRITE) {