Show the download-in-progress icon in the folder as soon as the SynchronizeFolderOper...
[pub/Android/ownCloud.git] / src / com / owncloud / android / operations / SynchronizeFolderOperation.java
index 926e57f..534e16a 100644 (file)
@@ -116,6 +116,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
         mAccount = account;
         mContext = context;
         mRemoteFolderChanged = false;
         mAccount = account;
         mContext = context;
         mRemoteFolderChanged = false;
+        mFilesForDirectDownload = new Vector<OCFile>();
         mFilesToSyncContentsWithoutUpload = new Vector<SyncOperation>();
         mFavouriteFilesToSyncContents = new Vector<SyncOperation>();
         mFoldersToWalkDown = new Vector<SyncOperation>();
         mFilesToSyncContentsWithoutUpload = new Vector<SyncOperation>();
         mFavouriteFilesToSyncContents = new Vector<SyncOperation>();
         mFoldersToWalkDown = new Vector<SyncOperation>();
@@ -269,6 +270,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
                 + " changed - starting update of local data ");
 
         List<OCFile> updatedFiles = new Vector<OCFile>(folderAndFiles.size() - 1);
                 + " changed - starting update of local data ");
 
         List<OCFile> updatedFiles = new Vector<OCFile>(folderAndFiles.size() - 1);
+        mFilesForDirectDownload.clear();
         mFilesToSyncContentsWithoutUpload.clear();
         mFavouriteFilesToSyncContents.clear();
         mFoldersToWalkDown.clear();
         mFilesToSyncContentsWithoutUpload.clear();
         mFavouriteFilesToSyncContents.clear();
         mFoldersToWalkDown.clear();
@@ -396,7 +398,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
         startDirectDownloads();
         startContentSynchronizations(mFilesToSyncContentsWithoutUpload, client);
         startContentSynchronizations(mFavouriteFilesToSyncContents, client);
         startDirectDownloads();
         startContentSynchronizations(mFilesToSyncContentsWithoutUpload, client);
         startContentSynchronizations(mFavouriteFilesToSyncContents, client);
-        walkSubfolders(mFoldersToWalkDown, client);    // this must be the last!
+        walkSubfolders(client);    // this must be the last!
     }
 
     
     }
 
     
@@ -442,9 +444,9 @@ public class SynchronizeFolderOperation extends SyncOperation {
     }
 
 
     }
 
 
-    private void walkSubfolders(List<SyncOperation> foldersToWalkDown, OwnCloudClient client) {
+    private void walkSubfolders(OwnCloudClient client) {
         RemoteOperationResult contentsResult = null;
         RemoteOperationResult contentsResult = null;
-        for (SyncOperation op: foldersToWalkDown) {
+        for (SyncOperation op: mFoldersToWalkDown) {
             contentsResult = op.execute(client, getStorageManager());   // to watch out: possibly deep recursion
             if (!contentsResult.isSuccess()) {
                 // TODO - some kind of error count, and use it with notifications
             contentsResult = op.execute(client, getStorageManager());   // to watch out: possibly deep recursion
             if (!contentsResult.isSuccess()) {
                 // TODO - some kind of error count, and use it with notifications