forked from openlp/openlp
Check that file exists
This commit is contained in:
parent
68d50d82ee
commit
a66f68d0df
@ -47,6 +47,7 @@ CLAPPERBOARD = u':/media/slidecontroller_multimedia.png'
|
||||
VIDEO = QtGui.QImage(u':/media/media_video.png')
|
||||
AUDIO = QtGui.QImage(u':/media/media_audio.png')
|
||||
DVD_ICON = QtGui.QImage(u':/media/media_video.png')
|
||||
ERROR = QtGui.QImage(u':/general/general_delete.png')
|
||||
|
||||
class MediaMediaItem(MediaManagerItem):
|
||||
"""
|
||||
@ -292,7 +293,12 @@ class MediaMediaItem(MediaManagerItem):
|
||||
key=lambda filename: os.path.split(unicode(filename))[1])
|
||||
for track in media:
|
||||
track_info = QtCore.QFileInfo(track)
|
||||
if track_info.isFile():
|
||||
if not os.path.exists(track):
|
||||
filename = os.path.split(unicode(track))[1]
|
||||
item_name = QtGui.QListWidgetItem(filename)
|
||||
item_name.setIcon(build_icon(ERROR))
|
||||
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(track))
|
||||
elif track_info.isFile():
|
||||
filename = os.path.split(unicode(track))[1]
|
||||
item_name = QtGui.QListWidgetItem(filename)
|
||||
item_name.setIcon(build_icon(VIDEO))
|
||||
|
Loading…
Reference in New Issue
Block a user