This commit is contained in:
masensio 2014-05-06 12:54:13 +02:00
parent c6edcab5a2
commit 40b5fb8156
2 changed files with 23 additions and 25 deletions

View file

@ -1,6 +1,6 @@
/* ownCloud Android client application /* ownCloud Android client application
* Copyright (C) 2011 Bartek Przybylski * 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 * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, * it under the terms of the GNU General Public License version 2,
@ -152,14 +152,13 @@ public class FileDetailFragment extends FileFragment implements
@Override @Override
public void onActivityCreated(Bundle savedInstanceState) { public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
// TODO: Remove this code. (Updated no needed) if (mAccount != null) {
// if (mAccount != null) { OCFile file = ((FileActivity)getActivity()).getStorageManager().
// OCFile file = mContainerActivity.getStorageManager(). getFileByPath(getFile().getRemotePath());
// getFileByPath(getFile().getRemotePath()); if (file != null) {
// if (file != null) { setFile(file);
// setFile(file); }
// } }
// }
} }

View file

@ -1,5 +1,5 @@
/* ownCloud Android client application /* 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 * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, * 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.R;
import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile; 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.dialog.ConfirmationDialogFragment;
import com.owncloud.android.ui.fragment.FileFragment; import com.owncloud.android.ui.fragment.FileFragment;
import com.owncloud.android.utils.Log_OC; import com.owncloud.android.utils.Log_OC;
@ -161,22 +162,20 @@ ConfirmationDialogFragment.ConfirmationDialogFragmentListener {
if (savedInstanceState != null) { if (savedInstanceState != null) {
if (!mIgnoreFirstSavedState) { if (!mIgnoreFirstSavedState) {
OCFile file = (OCFile)savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_FILE); OCFile file = (OCFile)savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_FILE);
setFile(file);
mAccount = savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_ACCOUNT); 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 { } else {
mIgnoreFirstSavedState = false; mIgnoreFirstSavedState = false;
} }