X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/b9808f69380b70f3925f129854e9489cf695b6e3..1a3f202ac83f4f8868ee619b45b935f78c00f20b:/src/com/owncloud/android/ui/fragment/FileDetailFragment.java diff --git a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java index 66febdf4..49895260 100644 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -50,11 +50,11 @@ import com.owncloud.android.files.services.FileObserverService; import com.owncloud.android.files.services.FileUploader; import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder; import com.owncloud.android.files.services.FileUploader.FileUploaderBinder; -import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener; -import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener; -import com.owncloud.android.oc_framework.operations.RemoteOperation; -import com.owncloud.android.oc_framework.operations.RemoteOperationResult; -import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode; +import com.owncloud.android.lib.network.OnDatatransferProgressListener; +import com.owncloud.android.lib.operations.common.OnRemoteOperationListener; +import com.owncloud.android.lib.operations.common.RemoteOperation; +import com.owncloud.android.lib.operations.common.RemoteOperationResult; +import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; import com.owncloud.android.operations.RemoveFileOperation; import com.owncloud.android.operations.RenameFileOperation; import com.owncloud.android.operations.SynchronizeFileOperation; @@ -473,12 +473,10 @@ public class FileDetailFragment extends FileFragment implements @Override public void onNeutral(String callerTag) { - File f = null; OCFile file = getFile(); - if (file.isDown() && (f = new File(file.getStoragePath())).exists()) { - f.delete(); + mStorageManager.removeFile(file, false, true); // TODO perform in background task / new thread + if (file.getStoragePath() != null) { file.setStoragePath(null); - mStorageManager.saveFile(file); updateFileDetails(file, mAccount); } } @@ -817,7 +815,7 @@ public class FileDetailFragment extends FileFragment implements msg.show(); // TODO throw again the new rename dialog } if (result.getCode().equals(ResultCode.INVALID_CHARACTER_IN_NAME)) { - Toast msg = Toast.makeText(getActivity(), R.string.create_dir_fail_msg_invalid_characters, Toast.LENGTH_LONG); + Toast msg = Toast.makeText(getActivity(), R.string.filename_forbidden_characters, Toast.LENGTH_LONG); msg.show(); } else { Toast msg = Toast.makeText(getActivity(), R.string.rename_server_fail_msg, Toast.LENGTH_LONG); @@ -906,11 +904,6 @@ public class FileDetailFragment extends FileFragment implements } @Override - public void onTransferProgress(long progressRate) { - // old method, nothing here - }; - - @Override public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String filename) { int percent = (int)(100.0*((double)totalTransferredSoFar)/((double)totalToTransfer)); if (percent != mLastPercent) {