mirror of
https://github.com/lutris/lutris
synced 2024-11-05 18:10:49 +00:00
Check service game icons exitst before adding them to a store (Closes #2202)
This commit is contained in:
parent
85f1976e3a
commit
6f8bb9769b
2 changed files with 10 additions and 2 deletions
|
@ -254,7 +254,7 @@ class ServiceSyncBox(Gtk.Box):
|
|||
False,
|
||||
game.appid,
|
||||
game.name,
|
||||
get_pixbuf(game.icon, (32, 32)),
|
||||
get_pixbuf(game.icon, (32, 32)) if game.icon else None,
|
||||
str(game.details),
|
||||
]
|
||||
)
|
||||
|
|
|
@ -38,12 +38,20 @@ class XDGGame(ServiceGame):
|
|||
runner = "linux"
|
||||
installer_slug = "desktopapp"
|
||||
|
||||
@staticmethod
|
||||
def get_app_icon(xdg_app):
|
||||
"""Return the name of the icon for an XDG app if one if set"""
|
||||
icon = xdg_app.get_icon()
|
||||
if not icon:
|
||||
return ""
|
||||
return icon.to_string()
|
||||
|
||||
@classmethod
|
||||
def new_from_xdg_app(cls, xdg_app):
|
||||
"""Create a service game from a XDG entry"""
|
||||
service_game = cls()
|
||||
service_game.name = xdg_app.get_display_name()
|
||||
service_game.icon = xdg_app.get_icon().to_string()
|
||||
service_game.icon = cls.get_app_icon(xdg_app)
|
||||
service_game.appid = get_appid(xdg_app)
|
||||
service_game.slug = cls.get_slug(xdg_app)
|
||||
service_game.runner = "linux"
|
||||
|
|
Loading…
Reference in a new issue