From: masensio Date: Tue, 6 May 2014 10:54:13 +0000 (+0200) Subject: Revert commit 6cdd830a7be28b77688efc3cd62857c1e71a1342 X-Git-Tag: oc-android-1.7.0_signed~309^2~56 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/40b5fb815613c4cf9023c9c9ad93cda0d2521f86?ds=sidebyside;hp=--cc Revert commit 6cdd830a7be28b77688efc3cd62857c1e71a1342 --- 40b5fb815613c4cf9023c9c9ad93cda0d2521f86 diff --git a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java index 8d6ad641..d8ef1c1f 100644 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -1,6 +1,6 @@ /* ownCloud Android client application * Copyright (C) 2011 Bartek Przybylski - * Copyright (C) 2012-2014 ownCloud Inc. + * Copyright (C) 2012-2013 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -152,14 +152,13 @@ public class FileDetailFragment extends FileFragment implements @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - // TODO: Remove this code. (Updated no needed) -// if (mAccount != null) { -// OCFile file = mContainerActivity.getStorageManager(). -// getFileByPath(getFile().getRemotePath()); -// if (file != null) { -// setFile(file); -// } -// } + if (mAccount != null) { + OCFile file = ((FileActivity)getActivity()).getStorageManager(). + getFileByPath(getFile().getRemotePath()); + if (file != null) { + setFile(file); + } + } } diff --git a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java index eb8af268..9d0edde1 100644 --- a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java @@ -1,5 +1,5 @@ /* ownCloud Android client application - * Copyright (C) 2012-2014 ownCloud Inc. + * Copyright (C) 2012-2013 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -46,6 +46,7 @@ import com.actionbarsherlock.view.MenuItem; import com.owncloud.android.R; import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.OCFile; +import com.owncloud.android.ui.activity.FileActivity; import com.owncloud.android.ui.dialog.ConfirmationDialogFragment; import com.owncloud.android.ui.fragment.FileFragment; import com.owncloud.android.utils.Log_OC; @@ -161,22 +162,20 @@ ConfirmationDialogFragment.ConfirmationDialogFragmentListener { if (savedInstanceState != null) { if (!mIgnoreFirstSavedState) { OCFile file = (OCFile)savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_FILE); - setFile(file); mAccount = savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_ACCOUNT); -// TODO remove this code: update file no needed -// // Update the file -//// if (mAccount!= null) { -// OCFile updatedFile = -// mContainerActivity.getStorageManager().getFileByPath(file.getRemotePath()); -// if (updatedFile != null) { -// setFile(updatedFile); -// } else { -// setFile(file); -// } -// } else { -// setFile(file); -// } - + + // Update the file + if (mAccount!= null) { + OCFile updatedFile = ((FileActivity) getSherlockActivity()). + getStorageManager().getFileByPath(file.getRemotePath()); + if (updatedFile != null) { + setFile(updatedFile); + } else { + setFile(file); + } + } else { + setFile(file); + } } else { mIgnoreFirstSavedState = false; }