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
|
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',
|
if check_item_selected(self.listView, translate('ImagePlugin.MediaItem',
|
||||||
'You must select an image to delete.')):
|
'You must select an image to delete.')):
|
||||||
row_list = [item.row() for item in self.listView.selectedIndexes()]
|
row_list = [item.row() for item in self.listView.selectedIndexes()]
|
||||||
@ -111,6 +113,7 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
self.listView.takeItem(row)
|
self.listView.takeItem(row)
|
||||||
SettingsManager.set_list(self.settingsSection,
|
SettingsManager.set_list(self.settingsSection,
|
||||||
u'images', self.getFileList())
|
u'images', self.getFileList())
|
||||||
|
self.listView.blockSignals(False)
|
||||||
|
|
||||||
def loadList(self, images, initialLoad=False):
|
def loadList(self, images, initialLoad=False):
|
||||||
if not initialLoad:
|
if not initialLoad:
|
||||||
|
@ -399,8 +399,10 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
except:
|
except:
|
||||||
log.exception('Could not remove file: %s', audio)
|
log.exception('Could not remove file: %s', audio)
|
||||||
try:
|
try:
|
||||||
os.rmdir(os.path.join(AppLocation.get_section_data_path(
|
save_path = os.path.join(AppLocation.get_section_data_path(
|
||||||
self.plugin.name), 'audio', str(item_id)))
|
self.plugin.name), 'audio', str(item_id))
|
||||||
|
if os.path.exists(save_path):
|
||||||
|
os.rmdir(save_path)
|
||||||
except OSError:
|
except OSError:
|
||||||
log.exception(u'Could not remove directory: %s', save_path)
|
log.exception(u'Could not remove directory: %s', save_path)
|
||||||
self.plugin.manager.delete_object(Song, item_id)
|
self.plugin.manager.delete_object(Song, item_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user