forked from openlp/openlp
Change fileName to file_name
This commit is contained in:
parent
84dfb24674
commit
cdafe89624
@ -318,7 +318,7 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
"""
|
"""
|
||||||
Generate a path to the thumbnail
|
Generate a path to the thumbnail
|
||||||
|
|
||||||
:param imageFile: An instance of fImageFileNames
|
:param image: An instance of ImageFileNames
|
||||||
:return: A path to the thumbnail of type str
|
:return: A path to the thumbnail of type str
|
||||||
"""
|
"""
|
||||||
ext = os.path.splitext(image.filename)[1].lower()
|
ext = os.path.splitext(image.filename)[1].lower()
|
||||||
@ -345,26 +345,26 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
# Sort the images by its filename considering language specific.
|
# Sort the images by its filename considering language specific.
|
||||||
# characters.
|
# characters.
|
||||||
images.sort(key=lambda image_object: get_locale_key(os.path.split(str(image_object.filename))[1]))
|
images.sort(key=lambda image_object: get_locale_key(os.path.split(str(image_object.filename))[1]))
|
||||||
for imageFile in images:
|
for image_file in images:
|
||||||
log.debug('Loading image: %s', imageFile.filename)
|
log.debug('Loading image: %s', image_file.filename)
|
||||||
filename = os.path.split(imageFile.filename)[1]
|
filename = os.path.split(image_file.filename)[1]
|
||||||
thumb = self.generate_thumbnail_path(imageFile)
|
thumb = self.generate_thumbnail_path(image_file)
|
||||||
if not os.path.exists(imageFile.filename):
|
if not os.path.exists(image_file.filename):
|
||||||
icon = build_icon(':/general/general_delete.png')
|
icon = build_icon(':/general/general_delete.png')
|
||||||
else:
|
else:
|
||||||
if validate_thumb(imageFile.filename, thumb):
|
if validate_thumb(image_file.filename, thumb):
|
||||||
icon = build_icon(thumb)
|
icon = build_icon(thumb)
|
||||||
else:
|
else:
|
||||||
icon = create_thumb(imageFile.filename, thumb)
|
icon = create_thumb(image_file.filename, thumb)
|
||||||
item_name = QtGui.QTreeWidgetItem([filename])
|
item_name = QtGui.QTreeWidgetItem([filename])
|
||||||
item_name.setText(0, filename)
|
item_name.setText(0, filename)
|
||||||
item_name.setIcon(0, icon)
|
item_name.setIcon(0, icon)
|
||||||
item_name.setToolTip(0, imageFile.filename)
|
item_name.setToolTip(0, image_file.filename)
|
||||||
item_name.setData(0, QtCore.Qt.UserRole, imageFile)
|
item_name.setData(0, QtCore.Qt.UserRole, image_file)
|
||||||
if imageFile.group_id == 0:
|
if image_file.group_id == 0:
|
||||||
self.list_view.addTopLevelItem(item_name)
|
self.list_view.addTopLevelItem(item_name)
|
||||||
else:
|
else:
|
||||||
group_items[imageFile.group_id].addChild(item_name)
|
group_items[image_file.group_id].addChild(item_name)
|
||||||
if not initial_load:
|
if not initial_load:
|
||||||
self.main_window.increment_progress_bar()
|
self.main_window.increment_progress_bar()
|
||||||
if not initial_load:
|
if not initial_load:
|
||||||
|
Loading…
Reference in New Issue
Block a user