Skip to content

Commit

Permalink
Fixed text preview filter to take into account local knowledge about …
Browse files Browse the repository at this point in the history
…MIME types
  • Loading branch information
davivel committed Sep 7, 2015
1 parent 68ce6e6 commit 3f40da0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/com/owncloud/android/ui/preview/PreviewTextFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,16 @@ private void openFile() {
public static boolean canBePreviewed(OCFile file) {
final List<String> unsupportedTypes = new LinkedList<String>();
unsupportedTypes.add("text/richtext");
unsupportedTypes.add("text/rtf");
unsupportedTypes.add("text/vnd.abc");
unsupportedTypes.add("text/vnd.fmi.flexstor");
unsupportedTypes.add("text/vnd.rn-realtext");
unsupportedTypes.add("text/vnd.wap.wml");
unsupportedTypes.add("text/vnd.wap.wmlscript");
return (file != null && file.isDown() && file.isText() && !unsupportedTypes.contains(file.getMimetype()));
return (file != null && file.isDown() && file.isText() &&
!unsupportedTypes.contains(file.getMimetype()) &&
!unsupportedTypes.contains(file.getMimeTypeFromName())
);
}

/**
Expand Down

0 comments on commit 3f40da0

Please sign in to comment.