diff --git a/flatpak/hu.kramo.Cartridges.Devel.json b/flatpak/hu.kramo.Cartridges.Devel.json index 3c6d159..1c2ecea 100644 --- a/flatpak/hu.kramo.Cartridges.Devel.json +++ b/flatpak/hu.kramo.Cartridges.Devel.json @@ -97,20 +97,6 @@ "sha256": "bf548479d336726d7a0eceb6e767e179fbde37833ae42794602631a070d630f1" } ] - }, - { - "name": "python3-pyxdg", - "buildsystem": "simple", - "build-commands": [ - "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pyxdg\" --no-build-isolation" - ], - "sources": [ - { - "type": "file", - "url": "https://files.pythonhosted.org/packages/e5/8d/cf41b66a8110670e3ad03dab9b759704eeed07fa96e90fdc0357b2ba70e2/pyxdg-0.28-py2.py3-none-any.whl", - "sha256": "bdaf595999a0178ecea4052b7f4195569c1ff4d344567bccdc12dfdf02d545ab" - } - ] } ] }, diff --git a/src/importer/sources/flatpak_source.py b/src/importer/sources/flatpak_source.py index c8f375e..c2391a0 100644 --- a/src/importer/sources/flatpak_source.py +++ b/src/importer/sources/flatpak_source.py @@ -18,10 +18,11 @@ # SPDX-License-Identifier: GPL-3.0-or-later import re +import subprocess from pathlib import Path from time import time -import subprocess -from xdg import IconTheme + +from gi.repository import Gtk from src import shared from src.game import Game @@ -37,7 +38,8 @@ class FlatpakSourceIterator(SourceIterator): added_time = int(time()) - IconTheme.icondirs.append(self.source.data_location["icons"]) + icon_theme = Gtk.IconTheme.new() + icon_theme.add_search_path(str(self.source.data_location["icons"])) try: process = subprocess.run( @@ -104,7 +106,13 @@ class FlatpakSourceIterator(SourceIterator): additional_data = {} if icon_name := desktop_values["Icon"]: - if icon_path := IconTheme.getIconPath(icon_name, 512): + if ( + icon_path := icon_theme.lookup_icon( + icon_name, None, 512, 1, shared.win.get_direction(), 0 + ) + .get_file() + .get_path() + ): additional_data = {"local_icon_path": Path(icon_path)} else: pass