Merge branch 'main' into libadwaita-1.4

This commit is contained in:
kramo
2023-08-30 10:21:28 +02:00
parent e67977287d
commit 89bc0877fd
73 changed files with 4569 additions and 3197 deletions

View File

@@ -18,7 +18,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
from pathlib import Path
from time import time
from typing import NamedTuple
from gi.repository import GLib, Gtk
@@ -26,7 +25,7 @@ from gi.repository import GLib, Gtk
from src import shared
from src.game import Game
from src.importer.sources.location import Location, LocationSubPath
from src.importer.sources.source import Source, SourceIterable
from src.importer.sources.source import ExecutableFormatSource, SourceIterable
class FlatpakSourceIterable(SourceIterable):
@@ -35,8 +34,6 @@ class FlatpakSourceIterable(SourceIterable):
def __iter__(self):
"""Generator method producing games"""
added_time = int(time())
icon_theme = Gtk.IconTheme.new()
icon_theme.add_search_path(str(self.source.locations.data["icons"]))
@@ -51,6 +48,7 @@ class FlatpakSourceIterable(SourceIterable):
"com.heroicgameslauncher.hgl",
"com.usebottles.Bottles",
"io.itch.itch",
"org.libretro.RetroArch",
}
)
@@ -78,12 +76,10 @@ class FlatpakSourceIterable(SourceIterable):
values = {
"source": self.source.source_id,
"added": added_time,
"added": shared.import_time,
"name": name,
"game_id": self.source.game_id_format.format(game_id=flatpak_id),
"executable": self.source.executable_format.format(
flatpak_id=flatpak_id
),
"executable": self.source.make_executable(flatpak_id=flatpak_id),
}
game = Game(values)
@@ -108,7 +104,6 @@ class FlatpakSourceIterable(SourceIterable):
except GLib.GError:
pass
# Produce game
yield (game, additional_data)
@@ -116,7 +111,7 @@ class FlatpakLocations(NamedTuple):
data: Location
class FlatpakSource(Source):
class FlatpakSource(ExecutableFormatSource):
"""Generic Flatpak source"""
source_id = "flatpak"