summaryrefslogtreecommitdiffstats
path: root/lib/private/PreviewManager.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-11-10 14:04:59 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2016-11-10 14:28:09 +0100
commit99ada40df48af18396b8a99363832b1bffc58d37 (patch)
treecb517371491f913f1a3dc4969d7aa0d7061e4bb5 /lib/private/PreviewManager.php
parentcfda17d8f3c55cbbd8decb134c82c499e3c2c2f4 (diff)
downloadnextcloud-server-99ada40df48af18396b8a99363832b1bffc58d37.tar.gz
nextcloud-server-99ada40df48af18396b8a99363832b1bffc58d37.zip
Dispatch event on preview request
Fixes: #73 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/PreviewManager.php')
-rw-r--r--lib/private/PreviewManager.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php
index a2ef9659b3b..799f94f2bef 100644
--- a/lib/private/PreviewManager.php
+++ b/lib/private/PreviewManager.php
@@ -35,6 +35,7 @@ use OCP\Files\SimpleFS\ISimpleFile;
use OCP\IConfig;
use OCP\IPreview;
use OCP\Preview\IProvider;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class PreviewManager implements IPreview {
/** @var IConfig */
@@ -46,6 +47,9 @@ class PreviewManager implements IPreview {
/** @var IAppData */
protected $appData;
+ /** @var EventDispatcherInterface */
+ protected $eventDispatcher;
+
/** @var Generator */
private $generator;
@@ -65,16 +69,21 @@ class PreviewManager implements IPreview {
protected $defaultProviders;
/**
- * Constructor
+ * PreviewManager constructor.
*
- * @param \OCP\IConfig $config
+ * @param IConfig $config
+ * @param IRootFolder $rootFolder
+ * @param IAppData $appData
+ * @param EventDispatcherInterface $eventDispatcher
*/
public function __construct(IConfig $config,
IRootFolder $rootFolder,
- IAppData $appData) {
+ IAppData $appData,
+ EventDispatcherInterface $eventDispatcher) {
$this->config = $config;
$this->rootFolder = $rootFolder;
$this->appData = $appData;
+ $this->eventDispatcher = $eventDispatcher;
}
/**
@@ -165,7 +174,8 @@ class PreviewManager implements IPreview {
$this->appData,
new GeneratorHelper(
$this->rootFolder
- )
+ ),
+ $this->eventDispatcher
);
}