forked from openlp/openlp
[merge] merge with trunk r1747
This commit is contained in:
commit
8a11e790e5
@ -99,6 +99,8 @@ class ImageMediaItem(MediaManagerItem):
|
||||
"""
|
||||
Remove an image item from the list
|
||||
"""
|
||||
# Turn off auto preview triggers.
|
||||
self.listView.blockSignals(True)
|
||||
if check_item_selected(self.listView, translate('ImagePlugin.MediaItem',
|
||||
'You must select an image to delete.')):
|
||||
row_list = [item.row() for item in self.listView.selectedIndexes()]
|
||||
@ -111,6 +113,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
self.listView.takeItem(row)
|
||||
SettingsManager.set_list(self.settingsSection,
|
||||
u'images', self.getFileList())
|
||||
self.listView.blockSignals(False)
|
||||
|
||||
def loadList(self, images, initialLoad=False):
|
||||
if not initialLoad:
|
||||
|
@ -399,8 +399,10 @@ class SongMediaItem(MediaManagerItem):
|
||||
except:
|
||||
log.exception('Could not remove file: %s', audio)
|
||||
try:
|
||||
os.rmdir(os.path.join(AppLocation.get_section_data_path(
|
||||
self.plugin.name), 'audio', str(item_id)))
|
||||
save_path = os.path.join(AppLocation.get_section_data_path(
|
||||
self.plugin.name), 'audio', str(item_id))
|
||||
if os.path.exists(save_path):
|
||||
os.rmdir(save_path)
|
||||
except OSError:
|
||||
log.exception(u'Could not remove directory: %s', save_path)
|
||||
self.plugin.manager.delete_object(Song, item_id)
|
||||
|
Loading…
Reference in New Issue
Block a user