summaryrefslogtreecommitdiffstats
path: root/lib/private/preview
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-07-30 16:29:18 +0200
committerRobin Appelman <icewind@owncloud.com>2014-07-30 16:31:37 +0200
commit4a9b0d5465927b0b4cc856cebbc724264ffdd404 (patch)
tree2203c4dd985bebc76fd92b3237f6f72c3d8f7077 /lib/private/preview
parent2946a63f6bbcf298a30bb89ed72dbb650bc39def (diff)
downloadnextcloud-server-4a9b0d5465927b0b4cc856cebbc724264ffdd404.tar.gz
nextcloud-server-4a9b0d5465927b0b4cc856cebbc724264ffdd404.zip
Use svg mimeicons for empty text files
Diffstat (limited to 'lib/private/preview')
-rw-r--r--lib/private/preview/provider.php10
-rw-r--r--lib/private/preview/txt.php10
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/private/preview/provider.php b/lib/private/preview/provider.php
index f769823f6e6..f544c2c4b13 100644
--- a/lib/private/preview/provider.php
+++ b/lib/private/preview/provider.php
@@ -11,6 +11,16 @@ abstract class Provider {
abstract public function getMimeType();
/**
+ * Check if a preview can be generated for $path
+ *
+ * @param string $path
+ * @return bool
+ */
+ public function isAvailable($path) {
+ return true;
+ }
+
+ /**
* get thumbnail for file at path $path
* @param string $path Path of file
* @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image
diff --git a/lib/private/preview/txt.php b/lib/private/preview/txt.php
index 063543c6279..b81436baa06 100644
--- a/lib/private/preview/txt.php
+++ b/lib/private/preview/txt.php
@@ -14,6 +14,16 @@ class TXT extends Provider {
}
/**
+ * Check if a preview can be generated for $path
+ *
+ * @param \OC\Files\FileInfo $file
+ * @return bool
+ */
+ public function isAvailable($file) {
+ return $file->getSize() > 5;
+ }
+
+ /**
* @param string $path
* @param int $maxX
* @param int $maxY