Skip to content

Commit

Permalink
Use register context instead of IEventDispatcher
Browse files Browse the repository at this point in the history
Signed-off-by: cnmicha <[email protected]>
  • Loading branch information
cnmicha committed Dec 24, 2020
1 parent 46cf5ee commit 1d4545d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1d4545d

Please sign in to comment.