From: jabarros Date: Wed, 31 Dec 2014 12:48:36 +0000 (+0100) Subject: Fix. App does not realize that the folder does not exits when traying to download... X-Git-Tag: oc-android-1.7.0_signed~23^2~20 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/61b267d30983900ab1d4c61195e9034144d6fcf1?ds=inline;hp=--cc Fix. App does not realize that the folder does not exits when traying to download a folder --- 61b267d30983900ab1d4c61195e9034144d6fcf1 diff --git a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java index abbd1ba5..0dee54f9 100644 --- a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java +++ b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java @@ -162,13 +162,7 @@ public class SynchronizeFolderOperation extends SyncOperation { } if (mFilesForDirectDownload.isEmpty()) { - // Send a broadcast message for notifying UI update - Intent uiUpdate = new Intent(FileDownloader.getDownloadFinishMessage()); - uiUpdate.putExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, result.isSuccess()); - uiUpdate.putExtra(FileDownloader.ACCOUNT_NAME, mAccount.name); - uiUpdate.putExtra(FileDownloader.EXTRA_REMOTE_PATH, mRemotePath); - uiUpdate.putExtra(FileDownloader.EXTRA_FILE_PATH, mLocalFolder.getRemotePath()); - mContext.sendStickyBroadcast(uiUpdate); + sendBroadcastForNotifyingUIUpdate(result.isSuccess()); } } } catch (OperationCancelledException e) { @@ -221,6 +215,8 @@ public class SynchronizeFolderOperation extends SyncOperation { Log_OC.e(TAG, "Checked " + mAccount.name + mRemotePath + " : " + result.getLogMessage()); } + + sendBroadcastForNotifyingUIUpdate(result.isSuccess()); } return result; @@ -529,6 +525,16 @@ public class SynchronizeFolderOperation extends SyncOperation { } } + private void sendBroadcastForNotifyingUIUpdate(boolean result) { + // Send a broadcast message for notifying UI update + Intent uiUpdate = new Intent(FileDownloader.getDownloadFinishMessage()); + uiUpdate.putExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, result); + uiUpdate.putExtra(FileDownloader.ACCOUNT_NAME, mAccount.name); + uiUpdate.putExtra(FileDownloader.EXTRA_REMOTE_PATH, mRemotePath); + uiUpdate.putExtra(FileDownloader.EXTRA_FILE_PATH, mLocalFolder.getRemotePath()); + mContext.sendStickyBroadcast(uiUpdate); + } + /** * Cancel operation