More thumbnailer logic changes
This commit is contained in:
parent
d641c3dba8
commit
dcaa5ce626
@ -1,3 +1,3 @@
|
||||
"""
|
||||
Root of ShellFM
|
||||
Root of ShellFM
|
||||
"""
|
||||
|
@ -1,3 +1,3 @@
|
||||
"""
|
||||
Window module
|
||||
Window module
|
||||
"""
|
||||
|
@ -1,3 +1,3 @@
|
||||
"""
|
||||
Tabs module
|
||||
Tabs module
|
||||
"""
|
||||
|
@ -1,3 +1,3 @@
|
||||
"""
|
||||
Icons module
|
||||
Icons module
|
||||
"""
|
||||
|
@ -15,9 +15,9 @@ except Exception as e:
|
||||
PImage = None
|
||||
|
||||
# Application imports
|
||||
from .mixins.desktopiconmixin import DesktopIconMixin
|
||||
from .mixins.videoiconmixin import VideoIconMixin
|
||||
|
||||
from .mixins.meshsiconmixin import MeshsIconMixin
|
||||
from .mixins.desktopiconmixin import DesktopIconMixin
|
||||
|
||||
|
||||
|
||||
@ -41,11 +41,17 @@ class Icon(DesktopIconMixin, VideoIconMixin, MeshsIconMixin):
|
||||
elif full_path.lower().endswith( ('.desktop',) ): # .desktop file parsing
|
||||
thumbnl = self.parse_desktop_files(full_path)
|
||||
|
||||
if not thumbnl:
|
||||
thumbnl = self.get_system_thumbnail(full_path, self.sys_icon_wh[0])
|
||||
|
||||
if not thumbnl:
|
||||
thumbnl = self.return_generic_icon()
|
||||
|
||||
return thumbnl
|
||||
except Exception:
|
||||
...
|
||||
|
||||
return None
|
||||
return self.return_generic_icon()
|
||||
|
||||
def create_blender_thumbnail(self, dir, file, full_path=None):
|
||||
try:
|
||||
@ -117,9 +123,6 @@ class Icon(DesktopIconMixin, VideoIconMixin, MeshsIconMixin):
|
||||
|
||||
return None
|
||||
|
||||
def return_generic_icon(self):
|
||||
return GdkPixbuf.Pixbuf.new_from_file(self.DEFAULT_ICON)
|
||||
|
||||
def get_system_thumbnail(self, filename, size):
|
||||
try:
|
||||
gio_file = Gio.File.new_for_path(filename)
|
||||
@ -132,3 +135,6 @@ class Icon(DesktopIconMixin, VideoIconMixin, MeshsIconMixin):
|
||||
...
|
||||
|
||||
return None
|
||||
|
||||
def return_generic_icon(self):
|
||||
return GdkPixbuf.Pixbuf.new_from_file(self.DEFAULT_ICON)
|
||||
|
@ -1,3 +1,3 @@
|
||||
"""
|
||||
Icons mixins module
|
||||
Icons mixins module
|
||||
"""
|
||||
|
@ -1,3 +1,3 @@
|
||||
"""
|
||||
Utils module
|
||||
Utils module
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user