From 33133eb2754b8a39340d748c76d1c7fc552556a8 Mon Sep 17 00:00:00 2001 From: Yuvi9587 <114073886+Yuvi9587@users.noreply.github.com> Date: Fri, 18 Jul 2025 08:28:58 -0700 Subject: [PATCH] Update assets.py --- src/ui/assets.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/ui/assets.py b/src/ui/assets.py index 58e719e..ac3ec13 100644 --- a/src/ui/assets.py +++ b/src/ui/assets.py @@ -5,9 +5,6 @@ import sys # --- PyQt5 Imports --- from PyQt5.QtGui import QIcon -# --- Asset Management --- - -# This global variable will cache the icon so we don't have to load it from disk every time. _app_icon_cache = None def get_app_icon_object(): @@ -22,17 +19,11 @@ def get_app_icon_object(): if _app_icon_cache and not _app_icon_cache.isNull(): return _app_icon_cache - # Declare a single variable to hold the base directory path. app_base_dir = "" - # Determine the project's base directory, whether running from source or as a bundled app if getattr(sys, 'frozen', False): - # The application is frozen (e.g., with PyInstaller). - # The base directory is the one containing the executable. app_base_dir = os.path.dirname(sys.executable) else: - # The application is running from a .py file. - # This path navigates up from src/ui/assets.py to the project root. app_base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) icon_path = os.path.join(app_base_dir, 'assets', 'Kemono.ico') @@ -40,7 +31,6 @@ def get_app_icon_object(): if os.path.exists(icon_path): _app_icon_cache = QIcon(icon_path) else: - # If the icon isn't found, especially in a frozen app, check the _MEIPASS directory as a fallback. if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'): fallback_icon_path = os.path.join(sys._MEIPASS, 'assets', 'Kemono.ico') if os.path.exists(fallback_icon_path):