Merge remote-tracking branch 'origin/refactor_update_filelist_from_database' into...
authorDavid A. Velasco <dvelasco@solidgear.es>
Tue, 6 May 2014 08:58:19 +0000 (10:58 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Tue, 6 May 2014 08:58:19 +0000 (10:58 +0200)
1  2 
src/com/owncloud/android/ui/fragment/FileDetailFragment.java
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
src/com/owncloud/android/ui/preview/PreviewImageFragment.java

@@@ -150,15 -165,31 +150,16 @@@ public class FileDetailFragment extend
       * {@inheritDoc}
       */
      @Override
 -    public void onAttach(Activity activity) {
 -        super.onAttach(activity);
 -        try {
 -            mContainerActivity = (ContainerActivity) activity;
 -            
 -        } catch (ClassCastException e) {
 -            throw new ClassCastException(activity.toString() + " must implement " + FileDetailFragment.ContainerActivity.class.getSimpleName());
 -        }
 -    }
 -    
 -    
 -    /**
 -     * {@inheritDoc}
 -     */
 -    @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);
-         if (mAccount != null) {
-             OCFile file = mContainerActivity.getStorageManager().
-                     getFileByPath(getFile().getRemotePath());
-             if (file != null) {
-                 setFile(file);
-             }
-         }
+         // TODO: Remove this code. (Updated no needed)
+ //        if (mAccount != null) {
 -//            OCFile file = ((FileActivity)getActivity()).getStorageManager().
 -//                    getFileByPath(getFile().getRemotePath());
++//            OCFile file = mContainerActivity.getStorageManager().
++//              getFileByPath(getFile().getRemotePath());
+ //            if (file != null) {
+ //                setFile(file);
+ //            }
+ //        }
      }
          
  
@@@ -161,19 -173,21 +161,21 @@@ ConfirmationDialogFragment.Confirmation
          if (savedInstanceState != null) {
              if (!mIgnoreFirstSavedState) {
                  OCFile file = (OCFile)savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_FILE);
+                 setFile(file);
                  mAccount = savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_ACCOUNT);
-                 
-                 // Update the file
-                 if (mAccount!= null) {
-                     OCFile updatedFile = mContainerActivity.getStorageManager().getFileByPath(file.getRemotePath());
-                     if (updatedFile != null) {
-                         setFile(updatedFile);
-                     } else {
-                         setFile(file);
-                     }
-                 } else {
-                     setFile(file);
-                 }
+ // TODO remove this code: update file no needed               
+ //                // Update the file
+ ////                if (mAccount!= null) {
 -//                    OCFile updatedFile = ((FileActivity)getSherlockActivity()).
 -//                            getStorageManager().getFileByPath(file.getRemotePath());
++//                    OCFile updatedFile = 
++//                      mContainerActivity.getStorageManager().getFileByPath(file.getRemotePath());
+ //                    if (updatedFile != null) {
+ //                        setFile(updatedFile);
+ //                    } else {
+ //                        setFile(file);
+ //                    }
+ //                } else {
+ //                    setFile(file);
+ //                }
  
              } else {
                  mIgnoreFirstSavedState = false;