From 07e94eca6f9fc8ea0bc814d90f6b1403bb9f707a Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Tue, 25 Oct 2022 12:53:10 +0200 Subject: Emit typed event when preview is requested MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/PreviewManager.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'lib/private/PreviewManager.php') diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php index a2d34892c68..0d08ef3eba5 100644 --- a/lib/private/PreviewManager.php +++ b/lib/private/PreviewManager.php @@ -34,6 +34,7 @@ use OC\AppFramework\Bootstrap\Coordinator; use OC\Preview\Generator; use OC\Preview\GeneratorHelper; use OCP\AppFramework\QueryException; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\File; use OCP\Files\IAppData; use OCP\Files\IRootFolder; @@ -51,7 +52,8 @@ class PreviewManager implements IPreview { protected IConfig $config; protected IRootFolder $rootFolder; protected IAppData $appData; - protected EventDispatcherInterface $eventDispatcher; + protected IEventDispatcher $eventDispatcher; + protected EventDispatcherInterface $legacyEventDispatcher; private ?Generator $generator = null; private GeneratorHelper $helper; protected bool $providerListDirty = false; @@ -73,20 +75,22 @@ class PreviewManager implements IPreview { private IBinaryFinder $binaryFinder; public function __construct( - IConfig $config, - IRootFolder $rootFolder, - IAppData $appData, - EventDispatcherInterface $eventDispatcher, - GeneratorHelper $helper, - ?string $userId, - Coordinator $bootstrapCoordinator, - IServerContainer $container, - IBinaryFinder $binaryFinder + IConfig $config, + IRootFolder $rootFolder, + IAppData $appData, + IEventDispatcher $eventDispatcher, + EventDispatcherInterface $legacyEventDispatcher, + GeneratorHelper $helper, + ?string $userId, + Coordinator $bootstrapCoordinator, + IServerContainer $container, + IBinaryFinder $binaryFinder ) { $this->config = $config; $this->rootFolder = $rootFolder; $this->appData = $appData; $this->eventDispatcher = $eventDispatcher; + $this->legacyEventDispatcher = $legacyEventDispatcher; $this->helper = $helper; $this->userId = $userId; $this->bootstrapCoordinator = $bootstrapCoordinator; @@ -153,6 +157,7 @@ class PreviewManager implements IPreview { $this->rootFolder, $this->config ), + $this->legacyEventDispatcher, $this->eventDispatcher ); } -- cgit v1.2.3