}\r
\r
} else {\r
- mLastRemoteOperation = new SynchronizeFileOperation(mFile.getRemotePath(), fdsm, mAccount, true, false, getActivity());\r
+ mLastRemoteOperation = new SynchronizeFileOperation(mFile, fdsm, mAccount, true, false, getActivity());\r
WebdavClient wc = OwnCloudClientUtils.createOwnCloudClient(mAccount, getSherlockActivity().getApplicationContext());\r
mLastRemoteOperation.execute(wc, this, mHandler);\r
\r
mFile.setKeepInSync(cb.isChecked());\r
fdsm.saveFile(mFile);\r
\r
- /* NOT HERE\r
- * now that FileObserverService is involved, the easiest way to coordinate it with the download service\r
- * in every possible case is let the FileObserverService decide if the download should be started at\r
- * this moment or not\r
- * \r
- * see changes at FileObserverService#addObservedFile\r
- \r
- if (mFile.keepInSync()) {\r
- onClick(getView().findViewById(R.id.fdDownloadBtn));\r
- } else {\r
- mContainerActivity.onFileStateChanged(); // put inside 'else' to not call it twice (here, and in the virtual click on fdDownloadBtn)\r
- }*/\r
- \r
/// register the OCFile instance in the observer service to monitor local updates;\r
/// if necessary, the file is download \r
Intent intent = new Intent(getActivity().getApplicationContext(),\r
Log.e(TAG, "starting observer service");\r
getActivity().startService(intent);\r
\r
- mContainerActivity.onFileStateChanged(); \r
+ if (mFile.keepInSync()) {\r
+ onClick(getView().findViewById(R.id.fdDownloadBtn)); // force an immediate synchronization\r
+ }\r
break;\r
}\r
case R.id.fdRenameBtn: {\r