Skip to content

Commit

Permalink
Remove proxy access from all objects except the connections handler
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSazonov committed Aug 26, 2024
1 parent 68ae75d commit a591fca
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@


class BackendProxy(QObject):
def __init__(self, parent=None):
super().__init__(parent)
def __init__(self):
super().__init__()

self._logger = LoggerLevelHandler(self)

self._project = Project(self)
self._status = Status(self)
self._report = Report(self)
self._project = Project()
self._status = Status()
self._report = Report()

self._connections = ConnectionsHandler(self)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class ConnectionsHandler(QObject):
This allows, through the methods of this class, to update dependent objects, but keep them
unaware of each other."""

def __init__(self, parent):
super().__init__(parent)
self._proxy = parent
def __init__(self, proxy):
super().__init__(proxy)
self._proxy = proxy

# Project
self._proxy.project.name_changed.connect(self.on_project_name_changed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ class Project(QObject):
info_changed = Signal()
examples_changed = Signal()

def __init__(self, parent=None):
super().__init__(parent)
self._proxy = parent
def __init__(self):
super().__init__()
self._created = False
self._name = ''
self._info = _INFO
Expand Down
5 changes: 2 additions & 3 deletions examples/IntermediatePy/src/IntermediatePy/Logic/Py/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ class Report(QObject):
created_changed = Signal()
as_html_changed = Signal()

def __init__(self, parent):
super().__init__(parent)
self._proxy = parent
def __init__(self):
super().__init__()
self._created = False
self._as_html = _HTML

Expand Down
5 changes: 2 additions & 3 deletions examples/IntermediatePy/src/IntermediatePy/Logic/Py/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ class Status(QObject):
minimizer_changed = Signal()
variables_changed = Signal()

def __init__(self, parent):
super().__init__(parent)
self._proxy = parent
def __init__(self):
super().__init__()
self._project = 'Undefined'
self._phases_count = '1'
self._experiments_count = '1'
Expand Down

0 comments on commit a591fca

Please sign in to comment.