From f2cc48f705e0d99f3a6dba35cc6e2896b4e6c391 Mon Sep 17 00:00:00 2001 From: Toast Date: Mon, 2 Jun 2025 01:24:52 +0200 Subject: [PATCH] QModListModel: get game path with GameFinder --- src/leek/mod_list.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/leek/mod_list.py b/src/leek/mod_list.py index 5357bba..ee12488 100644 --- a/src/leek/mod_list.py +++ b/src/leek/mod_list.py @@ -3,16 +3,11 @@ from PySide6.QtCore import QAbstractListModel, QModelIndex from leek.mod import InvalidModError from leek.qmod import QMod from pathlib import Path +from leek.utils import GameFinder QML_IMPORT_NAME = "Leek" QML_IMPORT_MAJOR_VERSION = 1 -# TODO: Don't harcode the mods path -GAME_PATH = Path( - "/home/toast/.local/share/Steam/steamapps/common/Hatsune Miku Project DIVA Mega Mix Plus/" -) -MOD_PATH = Path(GAME_PATH, "mods") - # Qt follows C++ naming conventions # ruff: noqa: N802 @@ -22,7 +17,9 @@ class QModListModel(QAbstractListModel): super().__init__(parent=parent) mods: list[QMod] = [] - for dir in MOD_PATH.iterdir(): + mod_path: Path = GameFinder.find() / "mods" + + for dir in mod_path.iterdir(): if dir.name == ".stfolder": continue try: