Improved navitagation through navigation list, reducing the number of requests to...
[pub/Android/ownCloud.git] / src / com / owncloud / android / operations / SynchronizeFolderOperation.java
index 433a090..f8b69f4 100644 (file)
@@ -206,9 +206,9 @@ public class SynchronizeFolderOperation extends RemoteOperation {
                 Log_OC.i(TAG, "Synchronized " + mAccount.name + remotePath + ": " + result.getLogMessage());
             } else {
                 if (result.isException()) {
-                    Log_OC.e(TAG, "Synchroned " + mAccount.name + remotePath  + ": " + result.getLogMessage(), result.getException());
+                    Log_OC.e(TAG, "Synchronized " + mAccount.name + remotePath  + ": " + result.getLogMessage(), result.getException());
                 } else {
-                    Log_OC.e(TAG, "Synchroned " + mAccount.name + remotePath + ": " + result.getLogMessage());
+                    Log_OC.e(TAG, "Synchronized " + mAccount.name + remotePath + ": " + result.getLogMessage());
                 }
             }
             
@@ -327,12 +327,16 @@ public class SynchronizeFolderOperation extends RemoteOperation {
     private void removeObsoleteFiles() {
         mChildren = mStorageManager.getDirectoryContent(mLocalFolder);
         OCFile file;
-        String currentSavePath = FileStorageUtils.getSavePath(mAccount.name);
         for (int i=0; i < mChildren.size(); ) {
             file = mChildren.get(i);
             if (file.getLastSyncDateForProperties() != mCurrentSyncTime) {
-                Log_OC.d(TAG, "removing file: " + file);
-                mStorageManager.removeFile(file, (file.isDown() && file.getStoragePath().startsWith(currentSavePath)));
+                if (file.isDirectory()) {
+                    Log_OC.d(TAG, "removing folder: " + file);
+                    mStorageManager.removeDirectory(file, true, true);
+                } else {
+                    Log_OC.d(TAG, "removing file: " + file);
+                    mStorageManager.removeFile(file, true);
+                }
                 mChildren.remove(i);
             } else {
                 i++;