-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace global access to Settings with a reference
A dependency is the use of a variable in another part of Kodi. These can be identified by searching StereoscopicsManager.cpp for all globals (starting with g_) and external services (starting with CServiceBroker::). Here is a list of all dependencies in StereoscopicsManager.cpp: * CServiceBroker::GetSettings() * CServiceBroker::GetDataCacheCore() * CServiceBroker::GetRenderSystem() * g_advancedSettings * g_windowManager * g_localizeStrings * g_graphicsContext * g_application We'll ignore the g_ globals for now and focus on removing the CServiceBroker ones. If you're feeling adventurous, you can recursively kill the globals and singletons you come across. Because CStereoscopicsManager now belongs to CServiceManager, we can remove the use of CServiceBroker by passing references to the constructor upon creation. For example, here we replace access to CSettings with a reference that comes from CServiceManager. Note that the reference was placed first in the list of private variables. Some helpful comments were added so future authors will know where to add new variables.
- Loading branch information
Showing
3 changed files
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters