diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-10-29 00:51:49 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-10-29 01:05:00 +0300 |
commit | b8ed99723822d23c9a3a0b413eb237c93fc60c99 (patch) | |
tree | a3e2136a5faa0ac5bca63d3d2f6936272edbd0db /apps | |
parent | ef382f541c42f719b8dd30a4e0e248ef1bc39c84 (diff) |
Remove ISection in favor of IIconSection
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/lib/Controller/CommonSettingsTrait.php | 8 | ||||
-rw-r--r-- | apps/settings/lib/Search/SectionSearch.php | 7 | ||||
-rw-r--r-- | apps/theming/tests/ServicesTest.php | 4 |
3 files changed, 6 insertions, 13 deletions
diff --git a/apps/settings/lib/Controller/CommonSettingsTrait.php b/apps/settings/lib/Controller/CommonSettingsTrait.php index 20e0ef4a24f..4ad3d7497e9 100644 --- a/apps/settings/lib/Controller/CommonSettingsTrait.php +++ b/apps/settings/lib/Controller/CommonSettingsTrait.php @@ -34,7 +34,6 @@ use OCP\IGroupManager; use OCP\INavigationManager; use OCP\IUser; use OCP\IUserSession; -use OCP\Settings\IIconSection; use OCP\Settings\IManager as ISettingsManager; use OCP\Settings\ISettings; @@ -84,7 +83,7 @@ trait CommonSettingsTrait { protected function formatSections($sections, $currentSection, $type, $currentType, bool $subAdminOnly = false) { $templateParameters = []; - /** @var \OCP\Settings\ISection[] $prioritizedSections */ + /** @var \OCP\Settings\IIconSection[] $prioritizedSections */ foreach ($sections as $prioritizedSections) { foreach ($prioritizedSections as $section) { if ($type === 'admin') { @@ -96,10 +95,7 @@ trait CommonSettingsTrait { continue; } - $icon = ''; - if ($section instanceof IIconSection) { - $icon = $section->getIcon(); - } + $icon = $section->getIcon(); $active = $section->getID() === $currentSection && $type === $currentType; diff --git a/apps/settings/lib/Search/SectionSearch.php b/apps/settings/lib/Search/SectionSearch.php index 67dc0f5d156..e9cd9615db7 100644 --- a/apps/settings/lib/Search/SectionSearch.php +++ b/apps/settings/lib/Search/SectionSearch.php @@ -35,7 +35,7 @@ use OCP\Search\IProvider; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; use OCP\Search\SearchResultEntry; -use OCP\Settings\ISection; +use OCP\Settings\IIconSection; use OCP\Settings\IManager; class SectionSearch implements IProvider { @@ -117,7 +117,7 @@ class SectionSearch implements IProvider { /** * @param ISearchQuery $query - * @param ISection[][] $sections + * @param IIconSection[][] $sections * @param string $subline * @param string $routeName * @return array @@ -135,10 +135,7 @@ class SectionSearch implements IProvider { /** * We can't use the icon URL at the moment as they don't invert correctly for dark theme - * $iconUrl = ''; - * if ($section instanceof IIconSection) { * $iconUrl = $section->getIcon(); - * } */ $result[] = new SearchResultEntry( diff --git a/apps/theming/tests/ServicesTest.php b/apps/theming/tests/ServicesTest.php index ce893c8cccb..2705c7a4ece 100644 --- a/apps/theming/tests/ServicesTest.php +++ b/apps/theming/tests/ServicesTest.php @@ -34,7 +34,7 @@ use OCA\Theming\Util; use OCP\AppFramework\App; use OCP\Capabilities\ICapability; use OCP\IL10N; -use OCP\Settings\ISection; +use OCP\Settings\IIconSection; use OCP\Settings\ISettings; use Test\TestCase; @@ -75,7 +75,7 @@ class ServicesTest extends TestCase { [Admin::class], [Admin::class, ISettings::class], [Section::class], - [Section::class, ISection::class], + [Section::class, IIconSection::class], ]; } |