From e296e212db072eba4a98122ac71549b18078b952 Mon Sep 17 00:00:00 2001 From: SimplifiedPrivacy Date: Fri, 16 Oct 2026 18:07:26 -0400 Subject: [PATCH] edit legacy comments --- core/controllers/SessionStateController.py | 36 ------------------- core/controllers/SystemStateController.py | 26 -------------- core/services/profiles/profile_connections.py | 5 +-- 3 files changed, 3 insertions(+), 64 deletions(-) diff --git a/core/controllers/SessionStateController.py b/core/controllers/SessionStateController.py index f1ee8e5..6f49a3f 100644 --- a/core/controllers/SessionStateController.py +++ b/core/controllers/SessionStateController.py @@ -42,39 +42,3 @@ class SessionStateController: def remove(profile_id: int): SessionState.dissolve(profile_id) ProfileStateRepository().sync_session_removed(profile_id) - - -# class SessionStateController: - -# @staticmethod -# def get(id: int): -# return SessionState.find_by_id(id) - -# @staticmethod -# def get_or_new(id: int): - -# session_state = SessionStateController.get(id) - -# if session_state is None: - -# # update global state: -# global_state = GlobalState() -# if id not in global_state.session_profile_ids: # sanity check. -# global_state.session_profile_ids.append(id) - -# # create new: -# return SessionState(id) - -# return session_state - -# @staticmethod -# def exists(id: int): -# return SessionState.exists(id) - -# @staticmethod -# def all(): -# return SessionState.all() - -# @staticmethod -# def update_or_create(session_state): -# session_state.save() diff --git a/core/controllers/SystemStateController.py b/core/controllers/SystemStateController.py index 9e057e0..808848b 100644 --- a/core/controllers/SystemStateController.py +++ b/core/controllers/SystemStateController.py @@ -35,29 +35,3 @@ class SystemStateController: ProfileStateRepository().global_state.systemwide_profile_id = None return res -# class SystemStateController: - -# @staticmethod -# def get(): -# return SystemState.get() - -# @staticmethod -# def exists(): -# return SystemState.exists() - -# @staticmethod -# def create(profile_id: int, firewalled: bool, dns_set: bool, protocol: ProtocolChoice, process_id: int = None) -> SystemState: -# if process_id: -# current_state = SystemState(profile_id, firewalled, dns_set, protocol, process_id) -# else: -# current_state = SystemState(profile_id, firewalled, dns_set, protocol) -# current_state.save() -# return current_state - -# @staticmethod -# def update_or_create(system_state): -# system_state.save() - -# @staticmethod -# def dissolve(): -# return SystemState.dissolve() diff --git a/core/services/profiles/profile_connections.py b/core/services/profiles/profile_connections.py index 069cb9d..fa91237 100644 --- a/core/services/profiles/profile_connections.py +++ b/core/services/profiles/profile_connections.py @@ -155,7 +155,8 @@ def enable_profile( if connection_result.valid: if profile_observer is not None: profile_observer.notify('enabled', profile) - return Result(valid=True, data=profile.type) + + return Result(valid=True, data=profile.type) else: logger.error(f"Couldn't enable the profile: {connection_result.error_type}") error_msg = connection_result.message @@ -253,7 +254,7 @@ def disable_profile( # if it made it this far, it worked (in theory). # wipe state: - SystemStateController.remove(profile.id) + SystemStateController.dissolve() # update ui: if profile_observer is not None: