X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/5167e646ad8ee3ca074cdc58730aeeb942935089..ec6b9d7c70deb50152bfab5cb5f25c9a2dde28e7:/src/com/owncloud/android/operations/RenameFileOperation.java diff --git a/src/com/owncloud/android/operations/RenameFileOperation.java b/src/com/owncloud/android/operations/RenameFileOperation.java index 9bbf78c4..aa986079 100644 --- a/src/com/owncloud/android/operations/RenameFileOperation.java +++ b/src/com/owncloud/android/operations/RenameFileOperation.java @@ -29,8 +29,6 @@ import com.owncloud.android.lib.resources.files.RenameRemoteFileOperation; import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.utils.FileStorageUtils; -import android.accounts.Account; - /** * Remote operation performing the rename of a remote file (or folder?) in the ownCloud server. @@ -53,7 +51,6 @@ public class RenameFileOperation extends SyncOperation { * Constructor * * @param remotePath RemotePath of the OCFile instance describing the remote file or folder to rename - * @param account OwnCloud account containing the remote file * @param newName New name to set as the name of file. */ public RenameFileOperation(String remotePath, String newName) { @@ -119,7 +116,7 @@ public class RenameFileOperation extends SyncOperation { private void saveLocalFile() { mFile.setFileName(mNewName); - + // try to rename the local copy of the file if (mFile.isDown()) { String oldPath = mFile.getStoragePath(); @@ -131,8 +128,8 @@ public class RenameFileOperation extends SyncOperation { String newPath = parentStoragePath + mNewName; mFile.setStoragePath(newPath); - // notify MediaScanner about removed file - TODO really works? - getStorageManager().triggerMediaScan(oldPath); + // notify MediaScanner about removed file + getStorageManager().deleteFileInMediaScan(oldPath); // notify to scan about new file getStorageManager().triggerMediaScan(newPath); } @@ -160,7 +157,7 @@ public class RenameFileOperation extends SyncOperation { */ private boolean isValidNewName() throws IOException { // check tricky names - if (mNewName == null || mNewName.length() <= 0 || mNewName.contains(File.separator) || mNewName.contains("%")) { + if (mNewName == null || mNewName.length() <= 0 || mNewName.contains(File.separator)) { return false; } // create a test file