From df9bb37fbed6656d2641672631d7ad6521cb087a Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Thu, 23 Mar 2023 22:01:49 -0700 Subject: [PATCH] More refactor Signed-off-by: Varun Patil --- lib/Db/TimelineQuery.php | 2 +- lib/Db/TimelineRoot.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/Db/TimelineQuery.php b/lib/Db/TimelineQuery.php index 3be7939c..967c14c3 100644 --- a/lib/Db/TimelineQuery.php +++ b/lib/Db/TimelineQuery.php @@ -36,7 +36,7 @@ class TimelineQuery { if (null === $this->_root) { $this->_root = new TimelineRoot(); - \OC::$server->get(FsManager::class)->populateRoot($this->_root); + $this->_root->populate(); } return $this->_root; diff --git a/lib/Db/TimelineRoot.php b/lib/Db/TimelineRoot.php index 05b3ad19..dc5d1ab6 100644 --- a/lib/Db/TimelineRoot.php +++ b/lib/Db/TimelineRoot.php @@ -17,6 +17,14 @@ class TimelineRoot { } + /** + * Populate the root with the current user's folders. + */ + public function populate() + { + \OC::$server->get(FsManager::class)->populateRoot($this); + } + /** * Add a folder to the root. *