Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Extend trashbin migrator
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Apr 8, 2022
commit 4750f232ebe353108c2547995cdbc656b784acae
28 changes: 27 additions & 1 deletion apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\IDBConnection;
use OCP\IL10N;
use OCP\IUser;
use OCP\UserMigration\IExportDestination;
use OCP\UserMigration\IImportSource;
Expand All @@ -50,12 +51,16 @@ class TrashbinMigrator implements IMigrator {

protected IDBConnection $dbc;

protected IL10N $l10n;

public function __construct(
IRootFolder $rootFolder,
IDBConnection $dbc
IDBConnection $dbc,
IL10N $l10n
) {
$this->root = $rootFolder;
$this->dbc = $dbc;
$this->l10n = $l10n;
}

/**
Expand Down Expand Up @@ -134,4 +139,25 @@ public function import(IUser $user, IImportSource $importSource, OutputInterface
$output->writeln("No trashbin to import…");
}
}

/**
* {@inheritDoc}
*/
public function getId(): string {
return 'trashbin';
}

/**
* {@inheritDoc}
*/
public function getDisplayName(): string {
return $this->l10n->t('Deleted files');
}

/**
* {@inheritDoc}
*/
public function getDescription(): string {
return $this->l10n->t('Deleted files and folders in the trash bin');
}
}