X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/ff2271a8c531efe4c2602c63934eca568c397510..97dd59063ba1bf16fa2c176563614a9ce310b158:/src/com/owncloud/android/ui/fragment/FileDetailFragment.java diff --git a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java index 01fc1866..53e0630d 100644 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -292,7 +292,7 @@ public class FileDetailFragment extends SherlockFragment implements } } else { - mLastRemoteOperation = new SynchronizeFileOperation(mFile.getRemotePath(), fdsm, mAccount, true, false, getActivity()); + mLastRemoteOperation = new SynchronizeFileOperation(mFile, fdsm, mAccount, true, false, getActivity()); WebdavClient wc = OwnCloudClientUtils.createOwnCloudClient(mAccount, getSherlockActivity().getApplicationContext()); mLastRemoteOperation.execute(wc, this, mHandler); @@ -309,19 +309,6 @@ public class FileDetailFragment extends SherlockFragment implements mFile.setKeepInSync(cb.isChecked()); fdsm.saveFile(mFile); - /* NOT HERE - * now that FileObserverService is involved, the easiest way to coordinate it with the download service - * in every possible case is let the FileObserverService decide if the download should be started at - * this moment or not - * - * see changes at FileObserverService#addObservedFile - - if (mFile.keepInSync()) { - onClick(getView().findViewById(R.id.fdDownloadBtn)); - } else { - mContainerActivity.onFileStateChanged(); // put inside 'else' to not call it twice (here, and in the virtual click on fdDownloadBtn) - }*/ - /// register the OCFile instance in the observer service to monitor local updates; /// if necessary, the file is download Intent intent = new Intent(getActivity().getApplicationContext(), @@ -335,7 +322,9 @@ public class FileDetailFragment extends SherlockFragment implements Log.e(TAG, "starting observer service"); getActivity().startService(intent); - mContainerActivity.onFileStateChanged(); + if (mFile.keepInSync()) { + onClick(getView().findViewById(R.id.fdDownloadBtn)); // force an immediate synchronization + } break; } case R.id.fdRenameBtn: {