Rename global registry from obj to registry.
This commit is contained in:
parent
dc7ad3e2de
commit
dce5289b69
@ -53,7 +53,7 @@ class Application(QApplication):
|
|||||||
"""Main application instance.
|
"""Main application instance.
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
obj: The object registry.
|
registry: The object registry.
|
||||||
mainwindow: The MainWindow QWidget.
|
mainwindow: The MainWindow QWidget.
|
||||||
searchrunner: The main SearchRunner instance.
|
searchrunner: The main SearchRunner instance.
|
||||||
config: The main ConfigManager
|
config: The main ConfigManager
|
||||||
@ -92,7 +92,7 @@ class Application(QApplication):
|
|||||||
'tabs': False,
|
'tabs': False,
|
||||||
'main': False,
|
'main': False,
|
||||||
}
|
}
|
||||||
self.obj = utypes.ObjectRegistry()
|
self.registry = utypes.ObjectRegistry()
|
||||||
self._timers = []
|
self._timers = []
|
||||||
self._shutting_down = False
|
self._shutting_down = False
|
||||||
self._keyparsers = None
|
self._keyparsers = None
|
||||||
@ -130,10 +130,10 @@ class Application(QApplication):
|
|||||||
utilcmds.init()
|
utilcmds.init()
|
||||||
log.init.debug("Initializing cookies...")
|
log.init.debug("Initializing cookies...")
|
||||||
cookiejar = cookies.CookieJar(self)
|
cookiejar = cookies.CookieJar(self)
|
||||||
self.obj['cookiejar'] = cookiejar
|
self.registry['cookiejar'] = cookiejar
|
||||||
log.init.debug("Initializing cache...")
|
log.init.debug("Initializing cache...")
|
||||||
diskcache = cache.DiskCache(self)
|
diskcache = cache.DiskCache(self)
|
||||||
self.obj['cache'] = diskcache
|
self.registry['cache'] = diskcache
|
||||||
log.init.debug("Initializing commands...")
|
log.init.debug("Initializing commands...")
|
||||||
self._commandrunner = runners.CommandRunner()
|
self._commandrunner = runners.CommandRunner()
|
||||||
log.init.debug("Initializing search...")
|
log.init.debug("Initializing search...")
|
||||||
@ -475,7 +475,7 @@ class Application(QApplication):
|
|||||||
|
|
||||||
def get_all_objects(self):
|
def get_all_objects(self):
|
||||||
"""Get all children of an object recursively as a string."""
|
"""Get all children of an object recursively as a string."""
|
||||||
qtb_lines = self.obj.dump_objects()
|
qtb_lines = self.registry.dump_objects()
|
||||||
pyqt_lines = []
|
pyqt_lines = []
|
||||||
self._get_pyqt_objects(pyqt_lines, self)
|
self._get_pyqt_objects(pyqt_lines, self)
|
||||||
pyqt_lines.insert(0, '{} PyQt objects:'.format(len(pyqt_lines)))
|
pyqt_lines.insert(0, '{} PyQt objects:'.format(len(pyqt_lines)))
|
||||||
@ -757,7 +757,7 @@ class Application(QApplication):
|
|||||||
if hasattr(self, 'stateconfig'):
|
if hasattr(self, 'stateconfig'):
|
||||||
to_save.append(("window geometry", self.stateconfig.save))
|
to_save.append(("window geometry", self.stateconfig.save))
|
||||||
try:
|
try:
|
||||||
cookiejar = self.obj['cookiejar']
|
cookiejar = self.registry['cookiejar']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -582,9 +582,9 @@ def is_enum(obj):
|
|||||||
|
|
||||||
def get_object(name):
|
def get_object(name):
|
||||||
"""Helper function to get an object."""
|
"""Helper function to get an object."""
|
||||||
return QCoreApplication.instance().obj[name]
|
return QCoreApplication.instance().registry[name]
|
||||||
|
|
||||||
|
|
||||||
def register_object(name, obj):
|
def register_object(name, obj):
|
||||||
"""Helper function to register an object."""
|
"""Helper function to register an object."""
|
||||||
QCoreApplication.instance().obj[name] = obj
|
QCoreApplication.instance().registry[name] = obj
|
||||||
|
Loading…
Reference in New Issue
Block a user