Browse Source

Fix glitch in reuse of thumbnails after crossed rename of files in the server side

David A. Velasco 10 years ago
parent
commit
d7de54a6a5

+ 1 - 1
src/com/owncloud/android/providers/FileContentProvider.java

@@ -168,7 +168,7 @@ public class FileContentProvider extends ContentProvider {
             String remoteId = "";
             if (c != null && c.moveToFirst()) {
                 remoteId = c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID));
-                ThumbnailsCacheManager.removeFileFromCache(remoteId);
+                //ThumbnailsCacheManager.removeFileFromCache(remoteId);
             }
             Log_OC.d(TAG, "Removing FILE " + remoteId);
 

+ 4 - 1
src/com/owncloud/android/ui/adapter/FileListListAdapter.java

@@ -197,9 +197,12 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
                                     new ThumbnailsCacheManager.ThumbnailGenerationTask(
                                             fileIcon, mStorageManager
                                     );
+                            if (thumbnail == null) {
+                                thumbnail = ThumbnailsCacheManager.mDefaultImg;
+                            }
                             final AsyncDrawable asyncDrawable = new AsyncDrawable(
                                     mContext.getResources(), 
-                                    ThumbnailsCacheManager.mDefaultImg, 
+                                    thumbnail, 
                                     task
                             );
                             fileIcon.setImageDrawable(asyncDrawable);