From: purigarcia Date: Wed, 8 Jul 2015 08:22:41 +0000 (+0200) Subject: toggleKeepInSync is moved to FileOperationsHelper X-Git-Tag: oc-android-1.8~60^2~8 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/96e2a2b97bd4065e4218fcda6e99f3015d899935?ds=inline toggleKeepInSync is moved to FileOperationsHelper --- diff --git a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java index 7983c27c..b093ccb0 100644 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -268,7 +268,8 @@ public class FileDetailFragment extends FileFragment implements OnClickListener public void onClick(View v) { switch (v.getId()) { case R.id.fdKeepInSync: { - toggleKeepInSync(); + CheckBox cb = (CheckBox) getView().findViewById(R.id.fdKeepInSync); + mContainerActivity.getFileOperationsHelper().toggleKeepInSync(getFile(),cb.isChecked()); break; } case R.id.fdCancelBtn: { @@ -280,27 +281,6 @@ public class FileDetailFragment extends FileFragment implements OnClickListener } } - - private void toggleKeepInSync() { - Log_OC.e(TAG, "toggleKeepInSync"); - CheckBox cb = (CheckBox) getView().findViewById(R.id.fdKeepInSync); - OCFile file = getFile(); - file.setKeepInSync(cb.isChecked()); - mContainerActivity.getStorageManager().saveFile(file); - - /// register the OCFile instance in the observer service to monitor local updates - Intent observedFileIntent = FileObserverService.makeObservedFileIntent( - getActivity(), - file, - mAccount, - cb.isChecked()); - getActivity().startService(observedFileIntent); - - /// immediate content synchronization - if (file.keepInSync()) { - mContainerActivity.getFileOperationsHelper().syncFile(getFile()); - } - } /** * Check if the fragment was created with an empty layout. An empty fragment can't show file details, must be replaced. diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index 2fb525fb..7160973c 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -42,7 +42,6 @@ import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.files.FileMenuFilter; import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.resources.status.OwnCloudVersion; -import com.owncloud.android.services.observer.FileObserverService; import com.owncloud.android.ui.activity.FileActivity; import com.owncloud.android.ui.activity.FileDisplayActivity; import com.owncloud.android.ui.activity.FolderPickerActivity;