Merge branch 'develop' into refresh_folder_contents_when_browsed_into
authorDavid A. Velasco <dvelasco@solidgear.es>
Thu, 24 Oct 2013 14:31:56 +0000 (16:31 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Thu, 24 Oct 2013 14:31:56 +0000 (16:31 +0200)
1  2 
src/com/owncloud/android/operations/SynchronizeFolderOperation.java

@@@ -511,47 -360,4 +511,46 @@@ public class SynchronizeFolderOperatio
          }
      }
  
 +    /**
 +     * Scans the default location for saving local copies of files searching for
 +     * a 'lost' file with the same full name as the {@link OCFile} received as 
 +     * parameter.
 +     *  
 +     * @param file      File to associate a possible 'lost' local file.
 +     */
 +    private void searchForLocalFileInDefaultPath(OCFile file) {
 +        if (file.getStoragePath() == null && !file.isFolder()) {
 +            File f = new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file));
 +            if (f.exists()) {
 +                file.setStoragePath(f.getAbsolutePath());
 +                file.setLastSyncDateForData(f.lastModified());
 +            }
 +        }
 +    }
 +
 +    
 +    /**
 +     * Sends a message to any application component interested in the progress of the synchronization.
 +     * 
 +     * @param inProgress        'True' when the synchronization progress is not finished.
 +     * @param dirRemotePath     Remote path of a folder that was just synchronized (with or without success)
 +     */
 +    private void sendStickyBroadcast(boolean inProgress, String dirRemotePath, RemoteOperationResult result) {
 +        Intent i = new Intent(FileSyncService.getSyncMessage());
 +        i.putExtra(FileSyncService.IN_PROGRESS, inProgress);
 +        i.putExtra(FileSyncService.ACCOUNT_NAME, mAccount.name);
 +        if (dirRemotePath != null) {
 +            i.putExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH, dirRemotePath);
 +        }
 +        if (result != null) {
 +            i.putExtra(FileSyncService.SYNC_RESULT, result);
 +        }
 +        mContext.sendStickyBroadcast(i);
 +    }
 +
 +
 +    public boolean getRemoteFolderChanged() {
 +        return mRemoteFolderChanged;
 +    }
 +
  }