diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index e45a911a1..4ab0d1276 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -30,7 +30,6 @@ use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; -use OCP\EventDispatcher\IEventDispatcher; use OCA\Photos\Listener\FilesListLoadingListener; use OCA\Files\Event\LoadAdditionalScriptsEvent; @@ -59,15 +58,10 @@ class Application extends App implements IBootstrap { public function __construct() { parent::__construct(self::APP_ID); - - /* @var IEventDispatcher $eventDispatcher */ - $dispatcher = $this->getContainer()->query(IEventDispatcher::class); - - // Add photos button to files app - $dispatcher->addServiceListener(LoadAdditionalScriptsEvent::class, FilesListLoadingListener::class); } public function register(IRegistrationContext $context): void { + $context->registerEventListener(LoadAdditionalScriptsEvent::class, FilesListLoadingListener::class); } public function boot(IBootContext $context): void {