forked from openlp/openlp
Delete image thumbnails when the image is removed. Fixes bug 1446491.
Fixes: https://launchpad.net/bugs/1446491
This commit is contained in:
parent
f8114d0b97
commit
29f5efeb91
@ -205,6 +205,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
images = self.manager.get_all_objects(ImageFilenames, ImageFilenames.group_id == image_group.id)
|
||||
for image in images:
|
||||
delete_file(os.path.join(self.service_path, os.path.split(image.filename)[1]))
|
||||
delete_file(self.generate_thumbnail_path(image))
|
||||
self.manager.delete_object(ImageFilenames, image.id)
|
||||
image_groups = self.manager.get_all_objects(ImageGroups, ImageGroups.parent_id == image_group.id)
|
||||
for group in image_groups:
|
||||
@ -227,6 +228,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
item_data = row_item.data(0, QtCore.Qt.UserRole)
|
||||
if isinstance(item_data, ImageFilenames):
|
||||
delete_file(os.path.join(self.service_path, row_item.text(0)))
|
||||
delete_file(self.generate_thumbnail_path(item_data))
|
||||
if item_data.group_id == 0:
|
||||
self.list_view.takeTopLevelItem(self.list_view.indexOfTopLevelItem(row_item))
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user