ImageManager: Check if desktop icons are supported on current plaform
Before creating icons, check if desktop links are supported by Rare on the current platform. Fixes Dummerle/Rare#262
This commit is contained in:
parent
ae8cee76ae
commit
737730583f
2 changed files with 8 additions and 3 deletions
|
@ -34,7 +34,7 @@ from legendary.models.game import Game
|
||||||
from rare.lgndr.core import LegendaryCore
|
from rare.lgndr.core import LegendaryCore
|
||||||
from rare.models.image import ImageSize
|
from rare.models.image import ImageSize
|
||||||
from rare.models.signals import GlobalSignals
|
from rare.models.signals import GlobalSignals
|
||||||
from rare.utils.paths import image_dir, resources_path, desktop_icon_suffix
|
from rare.utils.paths import image_dir, resources_path, desktop_icon_suffix, desktop_links_supported
|
||||||
|
|
||||||
# from requests_futures.sessions import FuturesSession
|
# from requests_futures.sessions import FuturesSession
|
||||||
|
|
||||||
|
@ -281,6 +281,7 @@ class ImageManager(QObject):
|
||||||
painter.end()
|
painter.end()
|
||||||
|
|
||||||
cover = cover.scaled(ImageSize.Image.size, Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
cover = cover.scaled(ImageSize.Image.size, Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
||||||
|
if desktop_links_supported():
|
||||||
icon = self.__convert_icon(cover)
|
icon = self.__convert_icon(cover)
|
||||||
icon.save(str(self.__img_desktop_icon(game.app_name)), format=desktop_icon_suffix().upper())
|
icon.save(str(self.__img_desktop_icon(game.app_name)), format=desktop_icon_suffix().upper())
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,10 @@ __link_suffix = {
|
||||||
"link": "desktop",
|
"link": "desktop",
|
||||||
"icon": "png",
|
"icon": "png",
|
||||||
},
|
},
|
||||||
|
# "Darwin": {
|
||||||
|
# "link": "",
|
||||||
|
# "icon": "icns",
|
||||||
|
# },
|
||||||
}
|
}
|
||||||
|
|
||||||
def desktop_links_supported() -> bool:
|
def desktop_links_supported() -> bool:
|
||||||
|
|
Loading…
Reference in a new issue